Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
57 lines
3.6 KiB
Markdown
57 lines
3.6 KiB
Markdown
# Contributing
|
|
|
|
- Open a pull request against `main`. A first-time contributor's fork pull
|
|
request needs a maintainer's approval before workflows run (Gitea waives this
|
|
once you have a merged pull request). Workflows on fork pull requests get no
|
|
secrets and a read-only token.
|
|
- 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.txt`) and installs git hooks that find them. Then
|
|
`pre-commit run --all-files` before pushing.
|
|
- 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.
|
|
|
|
## Dependency and image updates
|
|
|
|
- `requirements-dev.txt`, `.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). It is
|
|
not active yet: Renovate does not run against this repository, and until it does the bumps above
|
|
are made by hand. 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/` (the production image set); the
|
|
`Check image pins` step fails if they do.
|
|
|
|
## Maintainer setup
|
|
|
|
Settings the workflows cannot enforce and the repository needs before it accepts
|
|
outside contributions:
|
|
|
|
- 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 is not a required
|
|
check: its path filter would leave the check pending forever on a pull request that touches no role.
|
|
- The image workflow (`.gitea/workflows/image.yml`) tries the Actions job token first;
|
|
Gitea 28 refuses it for an organisation's packages, so it 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.
|