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
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
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
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
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
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
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
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
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
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).
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
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
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
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
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
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