Commit Graph
64 Commits
Author SHA1 Message Date
Defame1297 07fb8a6d21 chore: call the bot-diff check by its name outside the docs
The glossary avoids gate and guard; the check is
scripts/check_bot_pr_diff.py, so name it as the docs now do.

Assisted-by: Claude Code
2026-11-23 17:12:09 +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 fbc9b375a6 docs(agents): write nested AGENTS.md for scripts, workflows, images and ADRs
Build / build (pull_request) Successful in 17s
Lint / lint (pull_request) Successful in 54s
Molecule / molecule (pull_request) Successful in 20m4s
Each file holds its directory's rules in full: the rule, a one-sentence
reason and how it is held (control, review or aspirational). The interim
dependency and image section of making-a-change.md moves into
scripts/AGENTS.md and images/AGENTS.md; the contributor docs point to the
new files.

Closes #182

Assisted-by: Claude Code:claude-opus-5-5
2026-11-22 15:42:51 +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
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 3c6fd325fb ci: require maintainer review for gate files through CODEOWNERS
Add the root CODEOWNERS with one owner, the maintainer, over the gate files:
workflows, scripts, images, lint and REUSE configs, sanity ignores, the
changelog config, galaxy.yml, the contributor and agent docs and the apm
setup. It owns itself, and Gitea reads the root path first.

Gitea drops one backslash before compiling a pattern, so literal dots are
written \\. and reach the engine as \.

The pin files and README.md stay unowned. CODEOWNERS joins galaxy.yml
build_ignore, so the tarball check does not refuse it, and the molecule
selector's IGNORED, since no scenario reads it.

Refs #144

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNmHMc85bomfevwUDG
2026-11-21 17:29:29 +00:00
Defame1297andClaude Fable 5.2 dfeb423db1 docs: remove the ADR 0004 citations
Build / build (pull_request) Successful in 15s
Lint / lint (pull_request) Successful in 49s
Molecule / molecule (pull_request) Successful in 15m15s
The comments and docstrings that cited a document outside this
repository now state their reason inline or nothing. No pointer to a
future ADR is added, and no behaviour changes.

Closes #128

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNmHMc85bomfevwUDG
2026-11-21 06:22:57 +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 f4965db6f3 feat(_binary_update): add the internal binary update role
Build / build (pull_request) Successful in 12s
Lint / lint (pull_request) Successful in 1m17s
Molecule / molecule (pull_request) Successful in 11m34s
Swaps a staged, verified binary into place for a systemd service: refuse when nothing
executable is staged, then reload, stop and wait, back up the live binary, rename the
staged file over it, start and wait for active, and compare the reported version. A
failure after the stop restores this run's backup, starts the service again and fails
with a message that says whether the restore and the restart worked. Under --check the
waits and the version check are skipped, so a preview against a stopped service does
not fall into the rollback. The staged file is removed in every case.

The role is internal (ADR 0004 in the environment repository): called only by roles of
this Collection by FQCN, outside the public API, marked by the underscore, [INTERNAL]
in its meta and argument_specs, and a first task that refuses a call without a parent
role. traefik is its first caller and arrives in the same release.

Two molecule scenarios use stub binaries under a stub unit, without network: default
(successful bump and idempotence, a binary that cannot start, a binary that reports the
wrong version, nothing staged, a direct call, a first install) and check_mode (the bump
under molecule check against a stopped service changes nothing).

Lint: role-name is skipped (its regex rejects the leading underscore, as for
prometheus.prometheus roles/_common), meta has no role_name (schema[meta] uses the same
regex and cannot be skipped), and .ansible-lint-ignore lists the role's own files for
var-naming[no-role-prefix], which strips the underscore from the variable but not from
the role name and so cannot pass. The ignore file is kept out of the Collection build
and is on the scenario picker's IGNORED list. The README Roadmap no longer lists the role.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
2026-11-20 19:00:19 +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
Defame1297andClaude Sonnet 5.5 bbb4f1f888 fix(renovate): run the image bump task on every branch
Build / build (pull_request) Successful in 15s
Lint / lint (pull_request) Successful in 39s
Molecule / molecule (pull_request) Successful in 2s
The postUpgradeTasks lived in a packageRule matching package "*". Branch
renovate/pip-compile-refresh (a lock regeneration, no package upgrade) did not
get the task, so its requirements-dev.lock change reached the lint check
without the ci image version bump and failed `check_image_versions.py bump`.
A top-level postUpgradeTasks applies to every branch.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNmHMc85bomfevwUDG
2026-11-16 07:13:53 +00:00
Defame1297andClaude Sonnet 5.5 1c6a80d3d5 ci(deps): make Renovate read the lock and look the hooks up without a token
Build / build (pull_request) Successful in 11s
Lint / lint (pull_request) Successful in 34s
Molecule / molecule (pull_request) Successful in 8m7s
Dry run 3880 showed that since #124 Renovate proposed no bump at all:

- pip-compile: the manager refused the lock's header ("Option --newline=LF
  not supported (yet)"), extracted nothing and only logged a WARN, so the
  Python tools were never bumped. Drop --newline from
  scripts/lock-requirements.sh and the lock header (the 81 entries and
  hashes are unchanged); the manager now reads 81 dependencies. The lock is
  an image input: ci 0.2.19 -> 0.2.20.
- pre-commit: every hook was skipped (skipReason github-token-required, no
  GitHub token exists), and with the warning off the GitHub GraphQL lookup is
  refused at once (403 rate limit). Look the hooks up with git ls-remote
  (packageRule overrideDatasource git-tags, which needs
  RENOVATE_GITHUB_TOKEN_WARN=false because the token check runs before
  package rules apply). Renovate dereferences annotated tags, so the new rev
  is the commit (checked against git ls-remote for conventional-pre-commit
  v4.5.0). git-tags has no release timestamps, so hook bumps are not
  automerged.

Tested with [email protected].0 --platform=local against this checkout. Not
tested: the real job (renovate.json is read from main), the lock replay by
Renovate's pip-compile artifact step, and the ci 0.2.20 image build.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTRacjtXvmKxHr5TM5G
2026-11-14 21:43:21 +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 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 a0091abc14 fix(scripts): require Python 3.13 in dev-setup.sh
Build / build (pull_request) Successful in 10s
Lint / lint (pull_request) Successful in 17s
Molecule / molecule (pull_request) Successful in 4m49s
requirements-dev.txt pins ansible-core 2.22.0, which needs Python 3.13+.
The script still accepted 3.11+, so on a 3.11 host pip failed with an
opaque 'no matching distribution' error, and an existing 3.11 venv was
kept instead of rebuilt. Raise the guard, fix the message and comments.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-10 21:36:29 +00:00
Defame1297andClaude Sonnet 5.5 562ed76bfc chore(release): 1.0.0
Build / build (pull_request) Successful in 22s
Lint / lint (pull_request) Successful in 15s
Molecule / molecule (pull_request) Successful in 2m18s
First release, holding the docker role. Version bump in galaxy.yml, the
changelog built by antsibull-changelog release, README and CLAUDE.md no
longer say there are no roles, CHANGELOG.rst is allowed in the archive
(scripts/check_tarball.py) and the generated changelog.yaml is exempt from
yamllint like changelogs/config.yaml.

Verified: the commit hooks; the tarball script's unit tests; a local
ansible-galaxy build of 1.0.0 passes scripts/check_tarball.py. Not verified:
ansible-test sanity and the importer (CI). The tag is the maintainer's.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
2026-11-08 19:23:44 +00:00
Defame1297andClaude Sonnet 5.5 79a78f2921 docs: prepare the repository for publication
Build / build (pull_request) Failing after 4s
Lint / lint (pull_request) Failing after 12s
Molecule / molecule (pull_request) Successful in 1m8s
Rewrite stale gate wording and trim private references so the repository
can be made public.

- molecule.yml header: the runner sits in an isolated network segment, not
  behind the Proxmox firewall; state that a fork PR's workflow started
  without approval in a live test (unproven for outsiders) and that the
  `if:` guard is a convenience, not a boundary. Fork PRs are not claimed
  disabled; the repository should not accept them from untrusted users.
- CONTRIBUTING.md: same fork PR statement.
- SECURITY.md: new, with a TODO(operator) for the reporting contact.
- CLAUDE.md trimmed. Removed: the private environment-repo links and issue
  numbers, the two-sentence extraction history, run numbers, the registry
  push secret names and the Renovate token name and scopes, the Renovate
  dry-run and first-live-run narrative, the runner hostname and the
  cron time. Kept: git -C and commit-with-git rules, runner labels, image
  and Renovate rules.
- ADR 0004 references in workflows and scripts now say it lives in the
  maintainer's environment repository; docs/images/ci.md drops "private".

Comment and doc text only; image pins, the bot e-mail and runner labels
are unchanged.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
2026-11-08 17:38:58 +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 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 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 b92adb931c fix(renovate): fail-safe dry run, catch-all post-upgrade rule, merge open items
Molecule / molecule (pull_request) Skipped
Build / build (pull_request) Successful in 13s
Lint / lint (pull_request) Successful in 15s
- renovate.yml: a workflow_dispatch is a dry run unless the input is exactly
  "false" (an empty input no longer goes live); drop RENOVATE_BINARY_SOURCE
  install, the -full image ships its tools.
- renovate.json: the postUpgradeTasks rule matches every package, because with
  executionMode branch only the first upgrade of a branch counts; the script is
  a no-op when no image input changed.
- bump_image_versions.py: docstring describes the real wiring.
- CLAUDE.md, CONTRIBUTING.md: one open item for the first live run, runner slot note.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
2026-10-26 08:19:02 +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
Defame1297 3852bce32a Merge branch 'main' into fix/collection-tarball-contents
Build / build (pull_request) Successful in 10s
Lint / lint (pull_request) Successful in 10s
Molecule / molecule (pull_request) Successful in 31s
2026-10-25 20:39:06 +00:00
Defame1297andClaude Sonnet 5.5 ad2e4aa959 merge: bring main into fix/collection-tarball-contents and keep one script-test step
Build / build (pull_request) Successful in 11s
Lint / lint (pull_request) Successful in 11s
Molecule / molecule (pull_request) Successful in 37s
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
2026-10-25 20:23:29 +00:00
Defame1297andClaude Sonnet 5.5 9dfec118a2 merge: bring main into fix/dev-setup-robustness and keep one script-test step
Molecule / molecule (pull_request) Skipped
Build / build (pull_request) Successful in 13s
Lint / lint (pull_request) Successful in 10s
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
2026-10-25 20:12:30 +00:00