docs(contributing): split the contributor docs into CONTRIBUTING.md and docs/contributing/
CONTRIBUTING.md becomes a short entry point: the two positions and an index. The rules move to one file per trigger in docs/contributing/ (setup, making a change, AI assistance, code style, reviewing), each written as the rule, its reason and how it is held. GLOSSARY.md gains Driver, Unattended agent and Agent account. CLAUDE.md's bot-branch note now points to the new rule against pushing to someone else's branch. Closes #189 Assisted-by: Claude Code:claude-opus-5-5
This commit is contained in:
1 parent
10a3f88fbe
commit
95b5bf0c94
8 files changed
+364
-73
No files matched your search
+21
-71
@@ -1,78 +1,28 @@
|
||||
# Contributing
|
||||
|
||||
- Open a pull request against `main`. The forge does not allow self-registration, so only
|
||||
accounts the maintainer has created can open pull requests or issues for now. Fork
|
||||
pull requests are not a supported path: a fork controls its own workflow file. Workflows on fork pull requests get
|
||||
no secrets and a read-only token. To discuss a contribution, write to the address in
|
||||
`SECURITY.md`.
|
||||
- This repository stands alone: nothing public here (a tracked file, issue or pull request
|
||||
text or comment, release note or job output) refers to another repository of the maintainer's, its
|
||||
documents, hosts, network or namespaces, or states host sizing. When you bring content in
|
||||
from another repository, search the incoming diff for such mentions before committing,
|
||||
rewrite comments so they stand alone, and say in the pull request what you searched for.
|
||||
- Commit messages follow [Conventional Commits](https://www.conventionalcommits.org/)
|
||||
(`feat:`, `fix:`, `docs:`, `ci:` ...). CI checks every commit.
|
||||
- Every user-visible change needs a changelog fragment in `changelogs/fragments/`
|
||||
(antsibull-changelog format, a YAML file with a section such as
|
||||
`minor_changes:` or `bugfixes:`). Pure CI or docs changes use `trivial:`.
|
||||
- Role variables carry the role name as a prefix (`<role>_<name>`).
|
||||
- Third-party material needs an SPDX header, a `REUSE.toml` annotation (it
|
||||
overrides file headers) and an entry in `NOTICE`.
|
||||
- Set up the tooling once per clone with `scripts/dev-setup.sh`: it creates a virtualenv with
|
||||
the pinned tools (`requirements-dev.lock`, the hashed lock of `requirements-dev.txt`), installs the pinned collections the roles call
|
||||
(`requirements.yml`, into `.ansible/collections`, so local lint resolves the versions CI does)
|
||||
and installs git hooks that find the tools (the `ansible-lint` hook, `scripts/ansible-lint.sh`, uses those
|
||||
collections, also from a bare `pre-commit run`). Then
|
||||
`pre-commit run --all-files` before pushing. A `git push` runs `ansible-test sanity` on HEAD
|
||||
(`scripts/ansible-test-sanity.sh`, the Build job's check; the first run builds virtualenvs and
|
||||
takes minutes), so a finding only that test reports stops the push, not the Build check.
|
||||
- Never commit credentials, tokens or key material.
|
||||
- Releases are cut by the maintainer: bump `version` in `galaxy.yml`, add a
|
||||
`release_summary:` fragment, run `antsibull-changelog release` in a release PR
|
||||
(commit the generated `CHANGELOG.rst` and `changelogs/.plugin-cache.yaml`), then
|
||||
push an annotated `vX.Y.Z` tag.
|
||||
Who can contribute and how, then where the rules for each step live.
|
||||
|
||||
## Dependency and image updates
|
||||
## Positions
|
||||
|
||||
- A pin in `requirements-dev.txt` is changed together with its lock: Renovate does both (pip-compile manager);
|
||||
by hand, run `scripts/lock-requirements.sh` (`--upgrade` moves transitive packages too; needs PyPI and
|
||||
Python 3.13) and commit `requirements-dev.lock` in the same pull request. Installs use
|
||||
`pip install --require-hashes -r requirements-dev.lock -r requirements-dev.txt`: pip refuses an unhashed
|
||||
package and any disagreement between the two files. Hook repositories in `.pre-commit-config.yaml` are
|
||||
pinned by commit SHA with the release in a `# frozen: vX.Y.Z` comment; find the SHA with
|
||||
`git ls-remote <repo> "refs/tags/<tag>" "refs/tags/<tag>^{}"` (the `^{}` line, when there is one).
|
||||
- `requirements-dev.txt`, `requirements-dev.lock`, `requirements.yml`, `.pre-commit-config.yaml` and `images/**` are inputs of the CI and
|
||||
molecule images. A pull request that changes one needs a higher `version:` for that image in
|
||||
`.gitea/workflows/image.yml` (`python3 scripts/bump_image_versions.py` makes the edit; the
|
||||
`Check image versions were bumped` step enforces it). After the merge, `image.yml` builds the
|
||||
image on `main`, and a second pull request moves the `image:<version>@sha256:<digest>` pins in
|
||||
`lint.yml`, `build.yml` and `molecule.yml` to the printed digest. That second pull request
|
||||
touches no `image.yml` trigger path, so it rebuilds nothing.
|
||||
- These files are in `galaxy.yml` `build_ignore`: such bumps do not change the Collection or its
|
||||
version. A change consumers can see needs a changelog fragment, and only the maintainer
|
||||
bumps the version and tags.
|
||||
- `renovate.json` configures dependency bumps (minor and patch automerge, majors by hand). Renovate
|
||||
runs for this repository in `.gitea/workflows/renovate.yml` (daily cron on the Collection's own
|
||||
runner, as a Kamino-only bot user (repository secret `RENOVATE_BOT_TOKEN`); no credential from anywhere else is used). To dry-run after changing the
|
||||
config: Actions > Renovate > Run workflow with `dry_run=true`, then read the debug log (the job fails on a failed clone or an ERROR problem). The dry run
|
||||
proves reads (and runs the post-upgrade task); whether the bot can push and open a pull
|
||||
request, and whether such pull requests start the PR workflows, only the first live run shows
|
||||
(open item, see CLAUDE.md). Pull requests from `renovate/` branches must pass
|
||||
`scripts/check_bot_pr_diff.py`, which only allows version, tag, digest and pin lines.
|
||||
- Workflows must not mention `git.rkdr.net/defame1297/` (an image namespace this repository's
|
||||
CI must not use); the `Check image pins` step fails if they do.
|
||||
There are two positions, held per repository ([GLOSSARY.md](GLOSSARY.md)):
|
||||
|
||||
## Maintainer setup
|
||||
- **Trusted contributor**: the maintainer has given you write access to this repository, and with it
|
||||
the secrets that write access exposes. You push a branch here and open a pull request against `main`.
|
||||
- **Outsider**: anyone without write access. You contribute through issues, using a form in
|
||||
[.gitea/ISSUE_TEMPLATE/](.gitea/ISSUE_TEMPLATE/), not pull requests. What happens to a fork or AGit
|
||||
pull request is in [reviewing.md](docs/contributing/reviewing.md).
|
||||
|
||||
Settings the workflows cannot enforce and the repository needs before it accepts
|
||||
outside contributions:
|
||||
Accounts on this forge are created by the maintainer; there is no self-registration. Report a
|
||||
vulnerability as [SECURITY.md](SECURITY.md) says, never in an issue.
|
||||
|
||||
- Protect the `v*` tags so only maintainers can create them. A tag run uses the
|
||||
workflow files of the tagged commit and may receive organisation secrets.
|
||||
- Protect `main`: pull request required, with the `Lint` and `Build` checks. Molecule has no path filter
|
||||
on pull requests (the job always starts and chooses its scenarios itself), so it can be made a required
|
||||
check as well; that is the operator's decision.
|
||||
- The image workflow (`.gitea/workflows/image.yml`) pushes with the organisation secrets
|
||||
`PACKAGE_PUSH_USER` and `PACKAGE_PUSH_TOKEN` (a bot user with write access to the
|
||||
organisation's packages and a token with only the `write:package` scope). Keep
|
||||
those the only credentials stored at organisation level.
|
||||
## Contributor docs
|
||||
|
||||
- [setup.md](docs/contributing/setup.md): setting up a clone and an agent tool.
|
||||
- [making-a-change.md](docs/contributing/making-a-change.md): branches, commits, fragments, templates,
|
||||
third-party material, content from other repositories, dependency and image updates.
|
||||
- [ai-assistance.md](docs/contributing/ai-assistance.md): working with an agent, disclosure, agent accounts.
|
||||
- [code-style.md](docs/contributing/code-style.md): code style outside roles.
|
||||
- [reviewing.md](docs/contributing/reviewing.md): closing a fork pull request, merging someone else's,
|
||||
running an unmerged branch locally.
|
||||
|
||||
Rules for roles are in [roles/AGENTS.md](roles/AGENTS.md).
|
||||
Reference in new issue
Block a user