Commit Graph
62 Commits
Author SHA1 Message Date
Defame1297 96cb9246c6 ci(molecule): isolate runs per run and drop the push trigger on main
Two Molecule runs could not overlap on one Docker daemon because every
scenario's container name was fixed; only the runner's single slot kept
them apart. Each platform is now named and labelled by KAMINO_RUN_ID
(run id and attempt, "local" outside CI), the run script expands those
names with molecule's own interpolator before removing them, and the
workflow removes its own containers by label and only sweeps labelled
leftovers older than the job timeout, so a run still going is never hit.
Non-pull-request runs get a concurrency group of their own.

Push to main no longer triggers Molecule, Lint or Build: a merged pull
request was already tested, and the nightly and manual Molecule runs
cover every scenario. Build keeps its v* tag trigger.

Assisted-by: Claude Code:claude-opus-5-5
2026-11-24 09:35:03 +00:00
Defame1297 f86e339e5b test(scripts): avoid a disallowed name in the image-input test
Build / build (pull_request) Successful in 16s
Lint / lint (pull_request) Successful in 1m9s
Molecule / molecule (pull_request) Failing after 2m47s
Assisted-by: Claude Code
2026-11-24 07:26:06 +00:00
Defame1297 1d28f1a8bc test(scripts): cover a failing venv and name the extra collections path
Assisted-by: Claude Code
2026-11-24 07:25:10 +00:00
Defame1297 8c52c91dfd ci(molecule): run the in-image step from a tested script and list the fifth pin file
Assisted-by: Claude Code
2026-11-24 07:23:42 +00:00
Defame1297 2e32016c43 ci(molecule): run Molecule from the ci image instead of the runner's venv
Pin molecule and its Docker driver in requirements-dev.txt and bake them,
with the driver's collection, into the ci image. The Molecule job runs
docker run on the pinned ci image with the Docker socket and the checkout
mounted at the same path, as the runner user. A pull request whose pins
differ from the image installs its own pins first, so a core bump runs its
scenarios on the new core. gitea_runner no longer installs the molecule
venv and collections.

Closes #225

Assisted-by: Claude Code
2026-11-24 07:14:19 +00:00
Defame1297 30316c5a7d fix(images): name the registry client and report a refused request
Build / build (pull_request) Successful in 15s
Lint / lint (pull_request) Successful in 59s
Molecule / molecule (pull_request) Successful in 2s
The first Images run after #165 failed: the runner's first registry request
from next_image_version.py got HTTP 403, as a bare traceback, while the same
request works from elsewhere and curl reaches the host in the same job. The
suspected cause, a bot filter refusing Python's default User-Agent, is not
confirmed.

Every registry request, the token request included, now sends its own
User-Agent. Every HTTP error becomes a RegistryError that names the status and
the visible text of the response body, and main prints it as one ::error::
line and exits 1. The client logs in at most once, so an empty token cannot
loop. The script takes the registry URL, so the tests drive it against a local
fake registry.

Refs #165

Assisted-by: Claude Code:claude-opus-5-5
2026-11-23 22:13:05 +00:00
Defame1297 b12c990b6a ci(images): assign image versions in CI and open the pin PR right after a push
Build / build (pull_request) Canceled after 0s
Lint / lint (pull_request) Canceled after 0s
Molecule / molecule (pull_request) Canceled after 0s
The image.yml matrix holds a hand-edited base (MAJOR.MINOR) per image instead
of a version. On main, scripts/next_image_version.py compares a checksum of the
image's inputs with the inputs-sha256 label of the newest published <base>.N
and the job publishes <base>.N+1 when they differ, or builds nothing when they
match. A published tag is still never moved.

renovate.yml runs live on the successful completion of Images (workflow_run),
so the pin pull request opens minutes after a push instead of on the schedule.

Removed: bump_image_versions.py and its tests, check_image_versions.py bump,
Lint's bump step, Renovate's postUpgradeTasks, and the bot-diff allowance for
matrix version lines.

Closes #165

Assisted-by: Claude Code:claude-opus-5-5
2026-11-23 21:15:16 +00:00
Defame1297 35e780cf79 ci(check_tarball): refuse AGENTS.md at any depth
Build / build (pull_request) Successful in 18s
Lint / lint (pull_request) Successful in 1m21s
Molecule / molecule (pull_request) Successful in 1s
An AGENTS.md under roles/ holds contributor rules; shipped in the
Collection, a consumer's agent reading an installed role would load
them. galaxy.yml build_ignore lists the current ones, and the archive
check now refuses any AGENTS.md, compared case-insensitively, as the
allow list behind that deny list. A root AGENTS.md was already refused
by ALLOWED_TOP.

Refs: #244

Assisted-by: Claude Code
2026-11-23 19:16:17 +00:00
Defame1297 fa661be5c2 ci(molecule): skip scenarios for a change under .claude/ only
Build / build (pull_request) Successful in 14s
Molecule / molecule (pull_request) Canceled after 0s
Lint / lint (pull_request) Canceled after 23s
No scenario reads .claude/: Claude Code reads it on a contributor's
machine. Add it to the IGNORED list beside apm.yml, so a change to the
agent settings or apm-deployed hooks no longer runs every scenario.

Assisted-by: Claude Code
2026-11-23 10:41:45 +00:00
Defame1297 1ab01b6e3a ci(molecule): run the selected scenarios side by side in four lanes
Build / build (pull_request) Successful in 19s
Lint / lint (pull_request) Successful in 1m7s
Molecule / molecule (pull_request) Successful in 11m58s
A full run executes 15 scenarios one after another, about 1100 s in
total, with the slowest (traefik/default) at about 216 s. The scenarios
share nothing on the runner's Docker daemon but the daemon itself: their
container names are unique. So scripts/run_molecule_scenarios.sh now runs
MOLECULE_LANES (default 4, a positive integer) of them at once inside the
one job, with the slowest scenario as the floor; the saving will be
measured in CI.

Each scenario gets its own ANSIBLE_HOME under the job tree. With
Runtime(isolated=False), ansible-compat uses ANSIBLE_HOME as molecule's
cache dir: molecule's prerun installs the collection under test there with
`ansible-galaxy collection install --force` (which first deletes the
installed copy), and the scenario's ephemeral directory (inventory,
ansible.cfg, state) lives under it. A shared one would let a scenario
delete the copy another is running.

Each scenario's output goes to its own log, printed afterwards in the
selection order inside its own group with its wall time, plus a timing
summary. The failure list, the ran-N-of-M guard, </dev/null stdin, the
role-directory cwd and the per-scenario container removal are kept. A
TERM, INT or HUP to the script stops each lane's whole process tree,
including the process groups of ansible's detached workers (they call
setsid), terminates it, ignores further signals until done, and exits
128 plus the first signal. A kill of the step's process group reaches
the lanes and molecule but not ansible's detached workers. Either way a
cancelled job leaves no molecule behind to recreate a container after
the next run's cleanup. The logic moved from the workflow into a script
so a unit test with stub molecule and docker can hold it; the test also
fails a scenario whose platform name is not unique or not matched by the
stale-container filter, which is what makes running side by side safe.

Assisted-by: Claude Code:claude-opus-5-5
2026-11-22 22:37:00 +00:00
Defame1297 5c8b8f5342 ci(molecule): run only the image-smoke scenario a pull request changes
Build / build (pull_request) Successful in 20s
Lint / lint (pull_request) Successful in 1m6s
Molecule / molecule (pull_request) Successful in 1s
A file under extensions/molecule/<name>/ ran every scenario, although
only that image-smoke scenario reads it: they test the images, not the
roles. It now selects that scenario only. A shared file such as
extensions/molecule/requirements.yml, or a name that is not a scenario,
still runs everything.

Assisted-by: Claude Code:claude-opus-5-5
2026-11-22 21:14:45 +00:00
Defame1297 00bac19705 ci(molecule): stop running every scenario for files no scenario reads
Build / build (pull_request) Canceled after 0s
Lint / lint (pull_request) Canceled after 0s
Molecule / molecule (pull_request) Canceled after 0s
A pull request ran every scenario when it changed the selector itself,
which happened whenever a new file was added to its IGNORED list.
Molecule runs the base branch's copy, so the pull request's copy is
never exercised by a scenario. Ignore it, nested AGENTS.md files, role
READMEs, .python-version and scripts/lock-requirements.sh.

Assisted-by: Claude Code:claude-opus-5-5
2026-11-22 20:09:08 +00:00
Defame1297 7183913c8f docs(agents): replace CLAUDE.md with a root AGENTS.md
Build / build (pull_request) Successful in 15s
Lint / lint (pull_request) Successful in 46s
Molecule / molecule (pull_request) Successful in 17m21s
A root CLAUDE.md stops Claude Code loading the nested AGENTS.md files,
so it goes, with no adapter. The root AGENTS.md holds the seven
principles, the five code-style rules, the working rules, the verify
commands, the repository structure and one triggered pointer per
contributor doc and nested AGENTS.md.

AGENTS.md replaces CLAUDE.md in galaxy.yml build_ignore (the tarball
check allows no AGENTS.md) and on the Molecule selector's IGNORED list
(no scenario reads it). The setup and issue-tracker docs stop naming
CLAUDE.md.

Closes #185

Assisted-by: Claude Code:claude-opus-5-5
2026-11-22 16:35:14 +00:00
Defame1297 957dd4f95f Merge branch 'main' into ci/gitea-release-key
Build / build (pull_request) Successful in 17s
Gitea release key / check (pull_request) Successful in 23s
Lint / lint (pull_request) Successful in 50s
Molecule / molecule (pull_request) Successful in 19m44s
2026-11-22 08:08:09 +00:00
Defame1297andClaude Opus 5.5 f67f200c43 feat(gitea): add issue forms and a pull request template
Build / build (pull_request) Successful in 14s
Lint / lint (pull_request) Successful in 52s
Molecule / molecule (pull_request) Successful in 19m20s
Bug and feature-request YAML forms with blank issues disabled and a
contact link to SECURITY.md, and a pull request template with What and
why, Verified and Not verified plus the third-party-material statement.

The templates are on the Molecule selector's IGNORED list: no scenario
reads them, so a template-only change runs no scenarios.

Closes #191

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNmHMc85bomfevwUDG
2026-11-22 07:44:02 +00:00
Defame1297andClaude Opus 5.5 0837cc387f ci(gitea): warn before the Gitea release key stops verifying releases
Build / build (pull_request) Successful in 15s
Gitea release key / check (pull_request) Successful in 9s
Lint / lint (pull_request) Successful in 51s
Molecule / molecule (pull_request) Canceled after 36s
The gitea role accepts a release only when it carries a valid signature by
gitea_gpg_key_id or one of its subkeys, so an expired, revoked or replaced
Gitea release key makes every install and update fail closed, without
warning, on the day it happens.

scripts/check_gitea_release_key.py reads the pins from the role defaults,
fetches the release key into a throwaway keyring and only the .asc of the
pinned release (never the binary), and fails when the primary key or a
signing subkey expires within 60 days, is revoked or expired, or when a
signature in the .asc is not by a valid signing key of the pinned key. Its
docstring says what to do on a failure.

The Gitea release key workflow runs it weekly, by hand, and on pull requests
that change the role defaults or the check, so a gitea_version bump is
checked against the new release's signature. It runs in the ci image at the
pin of lint.yml; that image has gpgv but not gpg, so the job installs gpg and
gpg-agent from the Ubuntu archive per run instead of making the check an
image input. The tests that make keys skip without gpg, so the Lint job's
unittest run (no gpg) still covers the parsing and rendering tests.

The workflow pins the ci image, so it joins the pin consumers of
check_image_versions.py and check_bot_pr_diff.py: Renovate's pin follow-up
edits every workflow, and the bot-diff gate would otherwise refuse that pull
request. The new workflow and script are on the molecule selector's IGNORED
list, since no scenario reads them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
2026-11-22 07:29:31 +00:00
Defame1297 fef9e16765 Merge branch 'main' into feat/gitea-role
Build / build (pull_request) Successful in 12s
Lint / lint (pull_request) Successful in 44s
Molecule / molecule (pull_request) Successful in 1m20s
2026-11-21 22:41:11 +00:00
Defame1297andClaude Opus 5.5 a197536ba6 test(scripts): run SelectTest on a fixture tree
Build / build (pull_request) Successful in 12s
Lint / lint (pull_request) Successful in 44s
Molecule / molecule (pull_request) Successful in 1m21s
SelectTest called select() against the repository itself, so its expectations
depended on which real roles use which: with gitea using fail2ban, a change to
fail2ban also selects gitea, and test_two_roles failed with "role without a
molecule scenario". The selection tests now run on a temporary tree that holds
the roles of ALL and no use of one role by another, like UsersTest, which
covers the users.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
2026-11-21 21:59:33 +00:00
Defame1297andClaude Opus 5.5 e524eef4e8 docs(agents): write roles/AGENTS.md with the role rules
State every role rule in force with its reason and how it is held. Rules
whose control has not landed say "review until #N lands".

Keep the file out of the Collection tarball (build_ignore) until the
tarball check refuses AGENTS.md at any depth, and put it on the Molecule
selector's IGNORED list: no scenario reads it.

Closes #181

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNmHMc85bomfevwUDG
2026-11-21 21:20:10 +00:00
Defame1297andClaude Opus 5.5 e45b92551a ci: lint workflows with zizmor
Add zizmor (v1.32.0, pinned by SHA) as a pre-commit hook over
.gitea/workflows, offline at its default level; it fails on
pull_request_target and on ${{ }} expanded into run:. The ci image
bakes and smoke-tests the new hook environment, so its version moves
to 0.2.32.

image.yml drops `packages: write` and the job-token probe: Gitea 28
refuses the job token for organisation packages, and the latest build
used the org push token. One probe of that token now fails fast.

Refs #145

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNmHMc85bomfevwUDG
2026-11-21 18:52:22 +00:00
Defame1297andClaude Fable 5.2 3384ff2836 docs: remove references to anything outside this repository
Build / build (pull_request) Successful in 17s
Lint / lint (pull_request) Successful in 1m3s
Molecule / molecule (pull_request) Successful in 15m33s
This repository is public and stands alone. Comments and prose no longer
describe another repository, its documents, hosts, network or runner
sizing; each one states its own reason or is gone.

- Workflow headers keep the conclusions (disposable runner with no
  outside secret, the if: guard is not a boundary, no fork pull
  requests, the image build's memory cap) and drop the description.
- Isolation lines are worded as a property of this repository.
- The denied image namespace stays in check_image_versions.py, described
  only as a namespace this repository's CI must not use.
- CLAUDE.md and CONTRIBUTING.md gain the standing rule and the search to
  run when bringing content in from another repository.
- ci image 0.2.29 -> 0.2.30: .pre-commit-config.yaml and
  requirements-dev.txt are image inputs.

The ADR 0004 pointers, the README Roadmap, the skills-source mentions
and released changelog entries stay as they are.

Closes #108

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNmHMc85bomfevwUDG
2026-11-20 22:57:17 +00:00
Defame1297andClaude Opus 5.5 fcb51da065 feat(ci): run the molecule scenarios of the roles that use a changed role
Build / build (pull_request) Successful in 13s
Lint / lint (pull_request) Successful in 1m1s
Molecule / molecule (pull_request) Successful in 9m45s
The scenario picker assumed the roles were independent and a test enforced it. Wave 2
roles call other Collection roles (traefik includes ufw and the internal _binary_update),
so a change to the called role must also run the callers' scenarios.

A role uses another when a file under its directory names it as mortis.kamino.<role>;
the relation is followed transitively and read from the tree under test. A role the
pull request deletes or renames still counts as used by the roles that name it, so
their scenarios run and show the break.

The independence test becomes a test that fails a bare or templated role name in an
include, import (also in the k=v form), play roles: entry or meta dependency, and task
includes that reach outside the role through '..'. It walks .yml and .yaml files and has
its own cases for each form. This lands before the first such role because the workflow
runs the picker from the base branch's copy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
2026-11-20 18:33:02 +00:00
Defame1297andClaude Sonnet 5.5 b0607a39e2 ci(python): one Python (3.14) for the lock, a clone and the ci image
Build / build (pull_request) Successful in 14s
Molecule / molecule (pull_request) Canceled after 0s
Lint / lint (pull_request) Canceled after 56s
.python-version (3.14) is the source. dev-setup.sh and lock-requirements.sh
require exactly that minor; the ci image builds /opt/venv from its baked
python-build-standalone of that version (ARG PYTHON_VERSION) instead of the
distribution's python3, and derives the python<MINOR> links for
ansible-test from it; `check_image_versions.py pins` fails when
.python-version, the lock header or an `ARG PYTHON_VERSION` differs.
The lock already carries the 3.14 header (Renovate's -full container runs
pip-compile on its own python 3.14.8); renovate.yml now says that python's
minor version must equal .python-version. ci image 0.2.25 -> 0.2.26.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNmHMc85bomfevwUDG
2026-11-16 07:42:45 +00:00
Dragonish 4058978353 ci(deps): pin hook revisions by SHA and install dev tools from a hashed lock
Build / build (pull_request) Successful in 10s
Lint / lint (pull_request) Successful in 1m42s
Molecule / molecule (pull_request) Successful in 5m23s
Refs #113.

- .pre-commit-config.yaml: every hook repo is pinned by commit SHA with the release in a
  `# frozen:` comment, so a moved tag cannot change the code a hook environment is built from.
- requirements-dev.lock: hashed lock of requirements-dev.txt. Installs use
  `pip install --require-hashes -r requirements-dev.lock -r requirements-dev.txt` (dev-setup.sh,
  the ci image, the fallback install of Lint and Build): pip refuses an unhashed package and any
  disagreement between the two files.
- scripts/lock-requirements.sh regenerates the lock (pinned pip and pip-tools, --upgrade mode).
- renovate.json: the pip-compile manager replaces pip_requirements for the lock, plus a weekly,
  never automerged lock-file maintenance PR for transitive packages. Not yet dry-run on Renovate.
- check_bot_pr_diff.py accepts `rev: <sha>  # frozen: <tag>` and lock entries, hashes and plain
  comments, but not a changed pip-compile header command.
- ci image 0.2.18 -> 0.2.19 (image inputs changed).
2026-11-14 16:52:38 +00:00
Defame1297andClaude Sonnet 5.5 18a7e26e4f ci(hooks): run ansible-test sanity before a push
Build / build (pull_request) Successful in 11s
Lint / lint (pull_request) Successful in 30s
Molecule / molecule (pull_request) Successful in 5m22s
Add a pre-push hook that runs scripts/ansible-test-sanity.sh, so the Build job's sanity check, which ruff and the other hooks do not cover (it failed on a name only its pylint disallows), stops a push instead of the pull request. It is pre-push and not pre-commit because a cold run builds virtualenvs and needs the network; CI's pre-commit run does not run that stage, and a local system hook builds no environment. pre-push joins default_install_hook_types, and dev-setup.sh and its test treat it like the other two hook types, so its hook script also gets the virtualenv on PATH.

Verified through git push --dry-run in a throwaway clone: a commit with a disallowed name inside a function is blocked (exit 1, the same pylint message as CI, failed to push), and the push passes once it is removed.

Image input: .pre-commit-config.yaml is baked into the ci image, so ci 0.2.17 -> 0.2.18 (scripts/bump_image_versions.py). The new hook adds no hook environment and no layer size; the merge builds 0.2.18 and a pin PR follows.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNmHMc85bomfevwUDG
2026-11-14 15:52:35 +00:00
Defame1297andClaude Sonnet 5.5 574c0d00f9 ci(scripts): add a wrapper that runs ansible-test sanity on HEAD
ansible-test only runs a collection from an ansible_collections/<namespace>/<name> directory, so scripts/ansible-test-sanity.sh copies HEAD (git archive: the committed files only) into a temporary one, applies the Build job's ignore-file step and runs ansible-test sanity --requirements, passing extra arguments through. The sanity tests carry their own pylint, pep8 and shellcheck settings and also scan the Python under tests/, which ruff and the other hooks do not (the Build check failed on a name only that pylint disallows). The hook that runs it before a push follows in the next commit.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNmHMc85bomfevwUDG
2026-11-14 15:49:51 +00:00
Defame1297andClaude Sonnet 5.5 6b930a0f7e fix(tests): drop a name that ansible-test sanity pylint disallows
The Build check failed in ansible-test sanity: pylint reported tests/scripts/test_ansible_lint_wrapper.py:37:13 disallowed-name for `_`, from unpacking the middle of str.partition. Ruff accepts the name, but the pylint configuration of ansible-test, which also scans the Python under tests/, does not. Index the partition result instead. Reproduced locally with ansible-test sanity --test pylint on a copy of the tree under ansible_collections/mortis/kamino: the committed file fails with the same message, this one passes.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNmHMc85bomfevwUDG
2026-11-14 15:44:11 +00:00
Defame1297andClaude Sonnet 5.5 3289c0d430 ci(lint): resolve the Collection's own roles and drop mock_roles
Build / build (pull_request) Failing after 11s
Lint / lint (pull_request) Successful in 20s
Molecule / molecule (pull_request) Successful in 1s
Step 5 of #118. The scenarios' converge plays call the roles by FQCN (mortis.kamino.<role>), which only resolves from an ansible_collections/<namespace>/<name> directory, and a checkout is not one, so .ansible-lint listed the five roles in mock_roles and ansible-lint never checked those plays against the real roles.

scripts/ansible-lint.sh, which the ansible-lint hook runs in CI and locally, now links the checkout as ansible_collections/<namespace>/<name> in a temporary root (namespace and name read from galaxy.yml), puts that root first on ANSIBLE_COLLECTIONS_PATH and removes it on exit, so ansible-lint reads the checkout itself. Removing mock_roles reproduced five syntax-check[specific] role-not-found errors; with the link the run passes with no warnings, locally and with CI's preset path. A bare ansible-lint, outside the hook, does not get the link; .ansible-lint says so.

No image input changes: .pre-commit-config.yaml, requirements and images/** are untouched, so no version bump or second pull request. Closes the last open item of #118.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNmHMc85bomfevwUDG
2026-11-14 15:38:34 +00:00
Defame1297andClaude Sonnet 5.5 068bec93a9 fix(molecule): install community.docker for the Docker driver
Build / build (pull_request) Successful in 11s
Lint / lint (pull_request) Successful in 43s
Molecule / molecule (pull_request) Successful in 6m19s
Every scenario failed in its create step (couldn't resolve module community.docker.docker_login): molecule's Docker driver runs community.docker modules in its own create and destroy playbooks, and the collection came from the runner-provisioned /opt/molecule-collections that the previous commit stopped reading. The roles do not call it, so it is not in requirements.yml, which the ci image bakes for Lint and which Renovate would rebuild the image for. It is pinned in extensions/molecule/requirements.yml instead; the Molecule job installs both files, cached by their combined checksum. Renovate tracks the new file and the bot-diff gate allows only its version: lines.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNmHMc85bomfevwUDG
2026-11-14 14:30:11 +00:00
Defame1297andClaude Sonnet 5.5 bdb34cf98e fix(dev): run ansible-lint against the clone's pinned collections from any shell
Build / build (pull_request) Successful in 12s
Lint / lint (pull_request) Successful in 43s
Molecule / molecule (pull_request) Failing after 49s
The hook scripts written by dev-setup.sh exported ANSIBLE_HOME and ANSIBLE_COLLECTIONS_PATH, so only a hook run through git commit saw the pinned collections; a bare pre-commit run fell back to the control host's ~/.ansible, the drift #118 removes. The ansible-lint hook now runs scripts/ansible-lint.sh, which uses .ansible/collections of the clone when ANSIBLE_COLLECTIONS_PATH is unset, fails with the fix when they are missing, and leaves a preset path (CI's /opt/collections) alone. dev-setup.sh keeps installing the collections and no longer edits the hook scripts beyond the PATH block it always wrote.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNmHMc85bomfevwUDG
2026-11-14 14:14:37 +00:00
Defame1297andClaude Sonnet 5.5 bb57077fb3 build(dev): install the pinned collections in dev-setup
dev-setup.sh installs requirements.yml into .ansible/collections of the clone and
exports ANSIBLE_HOME and ANSIBLE_COLLECTIONS_PATH from the hook scripts, so local
ansible-lint resolves the collection versions CI does and not the control host's
~/.ansible (#118, part of #80). The install scopes the path to its target so a
copy elsewhere is not skipped as already installed. A hook written by the previous
version gains only the new block.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNmHMc85bomfevwUDG
2026-11-14 13:52:09 +00:00
Defame1297andClaude Sonnet 5.5 87b23ea4f3 ci(renovate): track requirements.yml and allow its version bumps
Enable Renovate's ansible-galaxy manager for requirements.yml and let a bot pull
request change only the version: lines of that file (check_bot_pr_diff.py), so a
collection bump can automerge like the other pins while a changed name or source
still fails the gate (#118).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNmHMc85bomfevwUDG
2026-11-14 13:51:58 +00:00
Defame1297andClaude Sonnet 5.5 697e4b6092 fix(scripts): resolve the ruff findings in the scripts and tests
Fix what ruff 0.17.5's default rule set and the complexity rules report (#112):
removeprefix/removesuffix instead of slicing, `_unused` for discarded tuple
members, obsolete `noqa: E402` removed, a parenthesised string pair and an
immutable class constant in the tests.

Three functions stay over a complexity threshold and carry an inline
`# noqa` with the rule code and a reason: matrix_of and copy_sources of
check_image_versions.py (#96 may replace them) and path_problems of
check_tarball.py. No rule is ignored globally and no threshold is tuned.

ruff writes .ruff_cache/ into the checkout, which test_real_build_passes
caught in the Collection archive: add it to galaxy.yml build_ignore. ruff.toml
joins the molecule selector's IGNORED paths, since no scenario reads it.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNmHMc85bomfevwUDG
2026-11-14 13:34:05 +00:00
Defame1297andClaude Sonnet 5.5 db1c1e176f style(scripts): format the scripts and their tests with ruff
Output of `ruff format` and nothing else, in its own commit so the diff is
reviewable (#112). The ruff-check hook is skipped for this commit only: its
findings are fixed in the next one.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNmHMc85bomfevwUDG
2026-11-14 13:25:58 +00:00
Defame1297andClaude Sonnet 5.5 a94bee8fd3 fix(lint): satisfy ansible-test pylint in the molecule selector
Build / build (pull_request) Successful in 11s
Lint / lint (pull_request) Successful in 24s
Molecule / molecule (pull_request) Successful in 7m0s
ansible-test sanity runs pylint over scripts/ and tests/scripts/ too and
rejects a mutable default argument (environ=os.environ) and `_` as a variable
name. main() now takes environ=None and reads os.environ itself, and the tests
name the values they ignore.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNmHMc85bomfevwUDG
2026-11-14 11:34:13 +00:00
Defame1297andClaude Sonnet 5.5 4d330d41c7 ci(molecule): run only the scenarios of the roles a pull request changes
Build / build (pull_request) Failing after 12s
Lint / lint (pull_request) Successful in 21s
Molecule / molecule (pull_request) Successful in 6m53s
A pull request now runs the scenarios of the roles it touches, none when it
touches only paths no scenario reads, and everything for any other file, for
every push to main and for manual dispatch. The job stays unconditional so
Molecule can remain a required check.

scripts/select_molecule_scenarios.py makes the choice and is run from the base
branch's copy, so a pull request cannot edit its own rules. A changed role
that exists but has no scenario fails instead of passing with nothing tested.

The scenario loop no longer gives molecule the list as stdin, which a child
could have drained, and fails when it ran fewer scenarios than were selected.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNmHMc85bomfevwUDG
2026-11-14 11:05:46 +00:00
Defame1297andClaude Sonnet 5.5 6c85d61827 fix(image): no single quote in a label (kaniko rejects it) and a check for it
Molecule / molecule (pull_request) Skipped
Build / build (pull_request) Successful in 11s
Lint / lint (pull_request) Successful in 13s
Run 2556: the ci image failed at its LABEL step (unexpected end of statement while looking for
matching single-quote) on the apostrophe in 'the distribution's python3'. Docker accepts it,
kaniko's own LABEL parser does not, and the molecule images built only because their labels
have none. The label text is reworded and check_image_versions.py pins now fails on a single
quote in any label. ci 0.2.6 was never pushed; the gate wants a higher version than main's,
so the fix is 0.2.7.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
2026-10-26 19:44:12 +00:00
Defame1297andClaude Sonnet 5.5 b90acd7147 style(tests): one blank line fewer before labelled() (pep8 E303)
Build / build (pull_request) Successful in 9s
Lint / lint (pull_request) Successful in 14s
Molecule / molecule (pull_request) Successful in 1m6s
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
2026-10-26 19:34:35 +00:00
Defame1297andClaude Sonnet 5.5 aa1848a995 fix(image): act on the review of the image metadata
Build / build (pull_request) Failing after 10s
Lint / lint (pull_request) Successful in 13s
Molecule / molecule (pull_request) Successful in 58s
Label parser: split the LABEL instruction like a shell (a value may hold NAME=value text), read
the last stage only, require base.name and tie it to the FROM tag, require the documentation
link to be <source>/src/branch/main/docs/images/<name>.md and the page to be non-empty.
Docs: do not name a Python version the base may not ship, show the lint.yml pin check as it
is, say which workflow paths start a build, name the system-language local hooks, add the
apparmor option and the registry path to the molecule usage, and soften unverified Renovate
and host-release statements.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
2026-10-26 19:32:03 +00:00
Defame1297andClaude Sonnet 5.5 c3c665e799 feat(image): describe every image: labels, a readme page and build metadata
The registry page shows the description as plain text, every label, and links to source,
documentation and licence; it renders no readme. Each Dockerfile now carries one label
block (title, description, source, url, documentation, licenses, authors, base.name and
net.rkdr.mortis.purpose/contents/usage), the build adds version, revision and created, and
docs/images/<name>.md says what the image is for, what it contains and how to use it.
check_image_versions.py pins fails when a label or that page is missing. The labels are
image inputs, so the three images get their PATCH bump.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
2026-10-26 19:27:15 +00:00
Defame1297andClaude Sonnet 5.5 43b8acbe87 fix(image): drop the ci Dockerfile comment edit and the empty f-strings
A comment edit in images/ci/Dockerfile is an image input, so the bump check wants a
version bump and a rebuild for nothing; the stale base comment waits for the next real ci
change. Two test strings had no interpolation (pylint f-string-without-interpolation).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
2026-10-26 19:06:53 +00:00
Defame1297andClaude Sonnet 5.5 bc5ae09de7 fix(image): make the job container check fail closed
Molecule / molecule (pull_request) Skipped
Build / build (pull_request) Failing after 10s
Lint / lint (pull_request) Failing after 6s
Review findings: a non-ubuntu or variable FROM went unchecked, the registry-prefixed
ubuntu forms were missed, the container line could be satisfied by a lookalike in a run
block, and a quoted job_image passed the check but not the bot-diff guard or Renovate.
Also: stale ci Dockerfile base comment, the pins error now says what to edit, and the
docs state that a job_image-only bump rebuilds nothing.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
2026-10-26 19:03:19 +00:00
Defame1297andClaude Sonnet 5.5 c3d0d7df65 fix(image): give every image its own job container release
kaniko runs inside the job container and unpacks the image it builds over it, so the
job container must be the same Ubuntu release as the image's FROM lines. A single
ubuntu:26.04 job container broke the molecule-ubuntu2404 build (run 2529: GLIBC_2.42
not found, then the credential cleanup step died too).

Each matrix entry now names job_image, check_image_versions.py pins fails when it
differs from the Dockerfile's release, the bot-diff guard allows tag and digest edits
of job_image lines, Renovate tracks them with a regex manager (never automerged), and
major ubuntu updates are disabled everywhere: a new release is a deliberate edit.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
2026-10-26 18:58:21 +00:00
Defame1297andClaude Sonnet 5.5 eaa38cb03a fix(scripts): read the image matrix without PyYAML
Molecule / molecule (pull_request) Skipped
Build / build (pull_request) Successful in 11s
Lint / lint (pull_request) Successful in 12s
Dry run 2453 ran the bump post-upgrade task in the Renovate image and it
failed with ModuleNotFoundError: yaml, so every bump PR would have opened
without the version bump. matrix_of() is now a small block-style reader that
fails closed on anything else; a test compares it with PyYAML on the real
image.yml and another forbids importing yaml in the scripts.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
2026-10-26 16:57:08 +00:00
Defame1297andClaude Sonnet 5.5 d6837217c0 fix(scripts): name the unused tuple members instead of using _
Build / build (pull_request) Successful in 11s
Lint / lint (pull_request) Successful in 14s
Molecule / molecule (pull_request) Successful in 32s
ansible-test sanity's pylint disallows _ as a name (18 findings in the bot-diff gate, the bump script and their tests, build run 2423).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
2026-10-26 06:54:55 +00:00
Defame1297andClaude Sonnet 5.5 8e9a8c5df0 fix(ci): close the bypasses of the bot pull request diff guard
A change git treats as binary (NUL byte, UTF-16, a -diff attribute) or one with
no removed or no added line now fails, and the line diff runs with --text
--no-ext-diff --no-textconv. Tags are limited to [A-Za-z0-9._-]; the digest must
be present on both sides of an ubuntu job container line and of a FROM line;
matrix version lines must stay in place and rise; paths are taken literally
(--literal-pathspecs); an empty head ref on a pull_request fails closed
(EVENT_NAME). The lint workflow runs the guard from origin/main (the whole
scripts/ directory, since it imports check_image_versions) and falls back to
the pull request's copy with a notice while main has none.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
2026-10-26 06:41:20 +00:00
Defame1297andClaude Sonnet 5.5 a57714342b fix(scripts): attribute bumped versions to their own matrix entry
bump_image_versions.py now locates each matrix.include entry and rewrites the
version: line of the entry whose name: it is, whatever the key order; an entry
it cannot parse unambiguously is a one-line error, and the rewrite is verified
against the YAML before it is written. Files are read and written as UTF-8 with
newline="" so CRLF survives. A shallow clone without a merge-base names the fix
(git fetch --unshallow). check_image_versions.py decodes git's stderr, so errors
no longer print a bytes repr. Untracked files that git ignores were already
skipped; a test now pins that.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
2026-10-26 06:39:11 +00:00
Defame1297andClaude Sonnet 5.5 f2e1139562 ci(lint): limit renovate pull requests to pin and version lines
scripts/check_bot_pr_diff.py fails a pull request from a renovate/ branch
that touches anything but version, tag, digest and image pin lines, so the
automerge of bot pull requests cannot alter workflow logic or reach the org
secrets. Wired as a pull-request-only step of the lint workflow.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
2026-10-25 21:08:21 +00:00
Defame1297andClaude Sonnet 5.5 359e016307 feat(scripts): deny the production image set in the Collection's workflows
The pins check now fails when any file under .gitea/workflows mentions
git.rkdr.net/defame1297/, so the environment repo's production images can
never appear in the Collection's CI.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
2026-10-25 21:08:14 +00:00
Defame1297andClaude Sonnet 5.5 ec15abf400 feat(scripts): add bump_image_versions.py for the image version bump
Factor the changed-path listing and the per-image input detection out of
check_image_versions.py (changed_paths, changed_images) and reuse them in a
new script that bumps the PATCH version of every image whose inputs changed.
It is meant to run later as a Renovate postUpgradeTasks command.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
2026-10-25 21:06:33 +00:00