`ansible-test sanity --requirements` builds one virtualenv per test under
~/.ansible/test/venv (keyed by the requirements hash) on every run: about
25s of the Build job. Prime them at image build time with --prime-venvs
against a stub collection, for the controller Python and the baked 3.11 and
3.13, and copy ~/.ansible/test into the final image as its own layer.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
The job container is git.rkdr.net/mortis/ci:0.1.0, pinned by tag and digest. It
carries git, shellcheck, the pinned Python tools (/opt/venv) and every
pre-commit hook environment (/opt/pre-commit). After the checkout the job
compares the pin files with the checksums recorded in the image; on a
mismatch (a PR that changes a pin) it installs the pinned tools for this run,
as before, and pre-commit builds the hook environments it is missing.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
Each image gets a version in the build matrix, pushed as a tag next to
sha-<12> and latest, so consumers can pin image:X.Y.Z@sha256:<digest>.
Gitea cannot make a tag immutable, so the prepare step asks the registry
first: when the version tag already exists it is left alone and the job warns
that the version needs bumping. Image versions are independent of the
Collection's release tags, so the v* tag trigger and tag handling go.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
`git add -A` also staged the copied .pre-commit-config.yaml, so the yamllint
smoke run linted it with the default rules (six lines over 80 characters)
and, under set -eu, aborted the build before gitleaks and actionlint ran.
pre-commit does not need its own config to be tracked.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
The first push of mortis/ci failed with 413 Payload Too Large: the
/opt/pre-commit layer was 377 MB, of which two environments of 172 and
176 MB (gitleaks and actionlint) each hold their own Go toolchain
(pre-commit keeps <env>/.go; only the built binaries in <env>/bin run).
Run the yamllint, gitleaks and actionlint hooks on a staged sample, delete
the toolchains and the Go build cache, and run the three hooks again, so a
cache that no longer works fails the build instead of the jobs.
Also stop the python3.X symlink loop from hiding a broken link (the RUN had
no -e, so only the last iteration decided the status).
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
Matrix over both images. molecule-ubuntu2404 keeps its sub-path context;
ci uses the repository root as context (its Dockerfile copies the pin
files) and also rebuilds when requirements-dev.txt or
.pre-commit-config.yaml change.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
Lint and Build install OS packages, the pinned Python tools and every
pre-commit hook environment on each run (about 40s of the 50 to 86s). Bake
them into git.rkdr.net/mortis/ci instead:
- images/ci/Dockerfile, multi-stage: the build stage creates the venv from
requirements-dev.txt, installs Python 3.11 and 3.13 (uv, for the ansible-test
compile check that is skipped today) and runs `pre-commit install-hooks`
from .pre-commit-config.yaml; the final stage copies only the results.
Several layers, each meant to stay below Cloudflare's 100 MB request limit.
- The image records the sha256 of the two pin files it was built from
(/opt/ci-pins.sha256) so a job can detect drift and fall back to
installing at run time.
- image.yml builds both images in a matrix (molecule-ubuntu2404 unchanged,
ci with the repository root as build context) and also runs when the pin
files change.
Nothing consumes the image yet: the workflows switch to its digest in a
follow-up once the first build has shown the real layer sizes.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
The first run on main built and pushed the image, then failed on
`read -r digest < /kaniko/digest`: the executor replaces the job
container's filesystem with the built image and removes /kaniko, so the
digest file and the credential-method file are gone by then.
Take the digest from the "Pushed <image>@sha256:<digest>" log line into a
shell variable, validate its shape, and drop the credential-method echo
(the prepare step already logs the credential in use).
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
State the real Gitea approval rule for fork pull requests, require a
REUSE.toml annotation for third-party material, describe the release
changelog files, and list the repository settings the workflows cannot
enforce (protected v* tags, protected main, the package push credential).
Drop the references to the private environment repository.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
One layer is about 30 MB compressed, far below the 100 MB proxy limit, and
saves three kaniko snapshots and three apt index downloads. Correct the size
estimate and the python3-systemd comment, note the build-time SSH host keys,
and drop the internal image name.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
Pass ref and repository values to run steps as environment instead of
interpolating them into the script (a tag name may contain shell
metacharacters). In the image workflow: refuse tags that are not
vMAJOR.MINOR.PATCH[-prerelease] before anything runs, purge exactly the
packages the prepare step added instead of autoremove and fail on any
package or /etc file difference from the base image, send the registry
write probe with an empty body, and remove the registry credential after
the push also when the build fails.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm