dev-setup.sh creates the virtualenv with the pinned tools and installs the git hooks with the virtualenv first on PATH inside the hook scripts. Without that, the language: system hooks (REUSE, changelog lint, ansible-lint) fail with "No such file or directory: 'reuse'" on a plain `git commit`; found while testing the hooks in a fresh clone. CLAUDE.md records the rules of the repository for Claude Code: commit with git so the hooks run (the Gitea API skips them, which let four lint failures reach CI), feature branches and protected main/tags, the workflow rules, how the images are versioned and pinned, and the 100 MB layer limit. It is written for a repository that will be public: no addresses, no host names beyond the public Gitea. CONTRIBUTING.md points at the script. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
3.6 KiB
3.6 KiB
CLAUDE.md
Guidance for Claude Code (claude.ai/code) in this repository.
What this is
mortis.kamino: an Ansible Collection (GPL-3.0-or-later, REUSE-compliant), extracted role by
role from the author's homelab Environment repo (Defame1297/ansible-homelab-mono). The
design contract is ADR 0004 in that repo (docs/adr/0004-collection-consumption-and-release.md)
and the tracking issue is its epic #486. There are no roles here yet: wave 1 arrives with the
extraction.
The repo is private and takes no fork pull requests until the author has verified the isolation of its CI runner. Do not change visibility, repository settings, branch or tag protection, or create tags: those are the operator's.
Working here
- Set up once per clone:
scripts/dev-setup.sh(a virtualenv with the pinned tools and git hooks that find them). Thelanguage: systemhooks runreuse,ansible-lintandantsibull-changelogby name, so a hook run without that virtualenv onPATHfails. - Commit with git in a clone, never through the Gitea API. The hooks (REUSE, yamllint,
actionlint, ansible-lint, gitleaks, changelog lint, Conventional Commits) only run in
git commit; an API commit skips them and CI finds the problem after the push. The first hook run builds the Go hook environments and takes minutes: run commits in the background. - Feature branch and pull request;
mainandv*tags are protected. Never push tomain. Releases are the operator's: annotatedvX.Y.Ztags equal togalaxy.yml's version. - Conventional Commits. A PR says what was verified and what was not.
- There is no local molecule and no container runtime on the control host: do not install one.
Molecule runs in CI, on the repository's own runner (label
kamino-molecule). - Changes that can affect a consumer need a changelog fragment (
changelogs/fragments/). New files are covered byREUSE.toml; third-party-derived content needs its own annotation.
Workflows (.gitea/workflows/)
- Never
pull_request_target. No secrets onpull_request. Pass ref, repo and name values to scripts throughenv:, never interpolate${{ github.* }}into arun:block. - Runner labels are
kamino-dockerandkamino-moleculeonly (.gitea/actionlint.yaml). Use thegithub.*contexts, which Gitea aliases; actionlint does not knowgitea.*. - Lint and Build run in the
ciimage. After the checkout they compare the pin files with the checksums baked into the image: a PR that changesrequirements-dev.txtor.pre-commit-config.yamltakes the slower path that installs the pinned tools. - Molecule discovers
extensions/molecule/*/androles/*/molecule/*/. Theimage-smokescenario tests the molecule image itself.
Images (images/)
ciandmolecule-ubuntu2404, built byimage.ymlwith kaniko on push tomain(never on pull requests) and pushed togit.rkdr.net/mortis/<name>.- Each has a semver
version:in the workflow's build matrix. A published version tag is never moved (the job looks it up in the registry first): bump the version in the PR that changes the image. - Consumers pin
image:<version>@sha256:<digest>(lint.yml,build.yml,molecule.yml). A build prints the new digest; moving a pin is a reviewed edit, and every build has a new digest. - Each pushed layer must stay below 100 MB: Cloudflare rejects larger request bodies with
HTTP 413. That is why the
ciimage deletes the Go toolchains from the hook cache. - The push credential is the org Actions secrets
PACKAGE_PUSH_USERandPACKAGE_PUSH_TOKEN. Never print or use them anywhere else.