test_roles_call_each_other_by_full_name_only in
tests/scripts/test_select_molecule_scenarios.py already fails when a role's
meta/main.yml declares dependencies, and Lint runs it through the
script-tests hook. That test is the Lint check the rule waited for, so the
rule now names it as its control, and the workflow rules and the selector's
docstring no longer describe a meta dependency as allowed.
Refs: #246
Assisted-by: Claude Code
A contributor learns about a broken renovate.json, a failing script test or
a bad image pin from Lint today; as hooks they fail before the push.
- check-json from pre-commit-hooks covers renovate.json.
- script-tests runs the suite at pre-push, since it takes minutes. Its
GIT_DIR points at an uncreatable path, so a fixture that keeps the
caller's git environment fails instead of writing to this repository.
Lint runs it by id; the suite now runs under the network guard.
- check-image-pins runs check_image_versions.py pins on every commit: its
inputs span workflows, Dockerfiles and docs/images, and it fails when one
is missing. Lint's pre-commit run replaces its separate step.
Adding hooks changes .pre-commit-config.yaml, an input of the ci image, so
this pull request takes Lint's slow path and the next Images run publishes
a new ci version.
Refs: #187
Assisted-by: Claude Code
Raise the renovate-config timeout to 15 minutes: after a self-bump the
runner pulls the large -full image first. The comment on the validator
step now says the clone credential is kept out of it, not the job token,
which the runner may still pass to every step. The workflow rules note
that renovate-config is the Lint job outside the ci image.
Refs: #188
Assisted-by: Claude Code
The dockerfile rule no longer claims the bump's own CI builds the new
image: Images builds it only after the merge, and the pin-follow pull
request's CI runs on it. The top-level description says code-owned files
automerge only once a code owner approves.
making-a-change.md quotes the full validator command and marks it a
control only once Lint / renovate-config is a required check. The
renovate.yml concurrency comment drops an unverified queueing claim.
Refs: #172
Refs: #188
Assisted-by: Claude Code
The renovate-config job clones in its own step and validates in a second
step, so the job token is not in the environment that reads the pull
request's renovate.json.
check_bot_pr_diff.py now refuses a moved image line in every workflow
whose pins a bot may move, lint.yml included, not only in image.yml and
renovate.yml. Tests cover a moved lint.yml line, an added second
Renovate line and a changed indentation.
Refs: #188
Assisted-by: Claude Code
Renovate runs on every push to main, so after each merge the next bot
pull request is rebased without waiting for the daily schedule; the
renovate concurrency group still queues at most one run. The job timeout
drops from 30 to 10 minutes.
The rule that disabled updates to renovate.yml is replaced by a weekly
rule for renovate/renovate: a 3-day release age, never automerged, since
the job runs with the write-capable bot token. One pull request moves
the pin in renovate.yml and its copy in lint.yml. RENOVATE_DOCKER_MAX_PAGES
stays within Docker Hub's anonymous paging limit, so the image's release
timestamps are found and the wait applies.
Our own Docker images get an explicit zero release age. Every rule
description is cut to at most two sentences, and the top-level one now
says that an update with no release timestamp gets no wait.
Closes: #172Closes: #188
Assisted-by: Claude Code
Add a renovate-config job to Lint that runs renovate-config-validator
--strict --no-global in a copy of renovate.yml's Renovate image, so the
config is checked by the Renovate that runs it and the check can be
required. The ci image stays without Node.
check_bot_pr_diff.py now lets a bot pull request move the tag and digest
of the renovate/renovate image line in renovate.yml and lint.yml, in
place, keeping the name and the -full flavour. A test holds the two pins
equal.
Refs: #188
Assisted-by: Claude Code
A Renovate pull request may now change pyproject.toml and uv.lock, but
only together, so the pep621 manager can move the apm pin. In
pyproject.toml only the version of a quoted name==version pin may change.
uv.lock is parsed with tomllib in a module of its own, check_uv_lock.py,
because uv installs whatever the lock names and a line-shape rule cannot
tie a file to its package: a file of another package under apm-cli, an
added package, a marker that drops a dependency and a downgrade all passed
one. The parsed rule allows only apm-cli moving up to the pin in
pyproject.toml, as plain releases compared as numbers, with the same kinds
of file as before (an sdist if it had one, the same wheel tags), each on
files.pythonhosted.org under /packages/ without dot segments or escapes,
named for apm-cli at the pin, by sha256. Every other package, the root
project beyond its apm-cli specifier and the top level beyond `revision`
must stay as they are. Without the same file kinds, a lock could drop the
wheels and make uv build apm-cli from its sdist with a build backend
fetched at sync time. A bump that moves anything else is made by hand.
Refs: #518
Assisted-by: Claude Code
uv uses .venv as its project environment, and `uv sync --frozen` removes
every package that is not in uv.lock. The tools the git hooks need would
go with it, so they get a directory of their own.
Re-running scripts/dev-setup.sh switches the hooks of an older clone and
leaves its .venv alone. Ignore rules and prunes cover both directories.
Refs: #516
Assisted-by: Claude Code
Installing the job container's tools upgrades base packages once Ubuntu
has newer ones, and the purge does not downgrade them, so the version
check failed every image. Kaniko now empties the root filesystem and
unpacks the base image before its first snapshot (--pre-cleanup), so the
versions no longer matter. Extra packages and files no package owns
still fail the job.
With the filesystem emptied, a failed build can leave no rm for the last
step, so the build step empties the credential file itself.
The images also kept the base image's package versions. Each Dockerfile
now upgrades them, and the base digests move to the newest published.
Refs #508
Assisted-by: Claude Code
image.yml's push paths listed extensions/molecule/requirements.yml under
the ci image, which no longer bakes it; it now sits with the
molecule-controller files. The list only triggers the build, so the paths
are unchanged. requirements-dev.txt no longer feeds Molecule, so the
proxmoxer comment names lint only. The ufw probe comments now say the
probe's stdout is empty in check mode, in two lines each, and two lines
in lint.yml and the workflow rules are re-wrapped.
Assisted-by: Claude Code
Molecule runs in the molecule-controller image. In the ci image, only
Lint's "Test the repository scripts" step uses molecule:
test_check_scenarios_load_checkout.py runs check_scenarios_load_checkout.py,
which imports molecule's config lookup, and test_run_molecule_scenarios.py
expands platform names with molecule's interpolator. Both skip silently
without molecule, so molecule stays, with a comment naming the step.
Nothing in Lint or Build uses the Docker driver (molecule-plugins[docker])
or the docker SDK it pulls in: those tests use molecule's default driver
and a stub docker module. No linted file calls a community.docker module,
and a local clone, which never installs extensions/molecule/requirements.yml,
passes ansible-lint. So the driver, docker, selinux and community.docker
leave the ci image, and extensions/molecule/requirements.yml leaves its
pin record: a community.docker bump no longer publishes a ci version.
The lock is regenerated with scripts/lock-requirements.sh. Every script
test passes, none skipped, in a venv installed from the new lock.
Assisted-by: Claude Code
scripts/run_molecule_in_ci_image.sh runs inside the molecule-controller
image, not the ci image, so its name pointed readers at the wrong image.
Its test file and class follow, and every reference is updated. ADR 0003
keeps the old name: it records what that change touched.
main's selector sees the old and the new path (it diffs with
--no-renames) and neither is on IGNORED, so this pull request runs every
scenario through the renamed script of its own checkout.
Assisted-by: Claude Code
An empty select output meant "nothing selected", so an output lost on
the way from select to result also passed the required check. select now
writes `none` for an empty selection; scenarios runs for neither `none`
nor an empty output, and result passes a skipped scenarios only for
`none`.
The result-logic test runs under sh, as act runs a job container's step
without a shell, and a new test parses what select writes to
GITHUB_OUTPUT. The fork-guard test compares each job with the literal
guard.
Assisted-by: Claude Code
A pull request that selects no scenario still took the single Molecule
runner slot to pull the controller image, select nothing and exit.
The workflow now has three jobs. select runs the selector from main's
copy in a job container on kamino-docker, in the molecule-controller pin,
and outputs the selected list. scenarios runs it on kamino-molecule and
is skipped when the list is empty. result runs always() and is the one
job to require: it fails unless select passed and scenarios passed or
was skipped for an empty list, because Gitea counts a skipped job as
passing. Scheduled and dispatched runs still select every scenario.
container.image cannot read env, so the controller pin is written in all
three jobs; a test holds the copies equal. The pin moves to 0.1.1, which
has git for the select job's checkout. Branch protection must then
require "Molecule / Result (pull_request)".
Closes#433
Assisted-by: Claude Code
The ci image's labels and doc, the consumer lists, the Molecule rules in
.gitea/workflows/AGENTS.md and the accepted risk on pin bumps in SECURITY.md said Molecule
runs in the ci image. They now name the molecule-controller image, its pin files and which
pin files select scenarios.
Closes#431
Assisted-by: Claude Code
Molecule ran in the ci image, so a ci pin bump for a tool only Lint uses selected every
scenario (ADR 0003). The workflow now pins molecule-controller 0.1.0 by digest as
CONTROLLER_IMAGE, the hand-made first pin the ADR calls for.
- The run script checks /opt/molecule-pins.sha256 and installs requirements-molecule.lock
when a pull request changed a pin file.
- The selector reads CONTROLLER_IMAGE: a controller pin change selects every scenario; a ci
pin bump touches only lint.yml and build.yml, which are on IGNORED, so it selects none.
- Tests show requirements-molecule.* selects every scenario and requirements-dev.* none.
- Renovate's molecule.yml regex matches CONTROLLER_IMAGE.
Closes#434
Assisted-by: Claude Code
ADR 0003 moves Molecule out of the ci image, so a ci bump for a tool
only Lint uses stops selecting every scenario. This builds and publishes
the image; nothing pins it yet (#431).
It bakes requirements-molecule.lock (ansible-core, molecule,
molecule-plugins[docker]) on the Python of .python-version and the
collections of both requirements.yml files, and records their checksums
in /opt/molecule-pins.sha256. Its last RUN checks the tool versions
against the lock, the Docker driver, every pinned collection and the
pin record, so a broken image fails its build. It has no image-smoke
scenario: it is the controller of every scenario, and the full run of
its pin pull request proves it; images/AGENTS.md records the exception.
check_image_versions.py pins now checks the Python header of both locks
and fails when their ansible-core pins differ, so Lint and Molecule
judge the code with one ansible-core. The new requirements files stay
off the selector's IGNORED list, so a bump there runs every scenario.
Refs #477
Assisted-by: Claude Code
check_scenarios_load_checkout.py now merges the base config the way
molecule's CLI does (its own lookup of .config/molecule/config.yml) and
fails a scenario whose merged prerun is not false, naming the base
config. Before, it built Config with no base config, so a scenario that
turned prerun back on, or a moved base config, slowed every run and
nothing failed.
Closes#452
Assisted-by: Claude Code
A reader of the time limit needs to know its limits: on expiry only
molecule is signalled, so its ansible-playbook and workers run until the
run container ends, and the run-label cleanup step removes anything they
recreate. The default's reasoning holds at the default 2 lanes, and the
variable is for local runs and tests only.
The timeout test now runs on one lane, so beta running proves the stalled
lane was freed. The workflows rule gives the limit its reason and names
the two tests that hold it.
Refs #474
Assisted-by: Claude Code
A hung scenario held its lane until the job's 90-minute timeout, and the
cancel then lost every scenario's log, since the groups print only after
the final wait. Each molecule test now runs under coreutils timeout with
MOLECULE_SCENARIO_TIMEOUT seconds (default 1800), so the hang fails by
itself, its log says it timed out, and the other lanes finish.
timeout runs with --foreground so it and molecule stay in the script's
process group: without it timeout leads a group of its own, which a
cancel that kills the step's group no longer reaches (the killed-group
test fails). On expiry molecule alone is signalled; anything it leaves
ends with the run container (docker run --init).
Closes#474
Assisted-by: Claude Code
A full run on main took 34 minutes with 2 lanes and 35 with 4: with 4 every scenario ran
about twice as slowly, so the runner is full at two, and two leave it room for pull request
jobs. The duration list now holds the 2-lane run's times and adds nfs_client.
Closes#432
Assisted-by: Claude Code
Two full runs on the docker_api connection took 45 and 49 minutes against 35 on the
CLI connection, with the same tasks a median 13% slower. The fixed Python interpreter
from the same change stays.
Refs #455
Assisted-by: Claude Code
The docker driver's community.docker.docker connection starts the docker CLI for every task
on every host, and each playbook run discovers the interpreter on every container although
both molecule images ship /usr/bin/python3. The shared base config now sets
provisioner.connection_options, which molecule merges over the driver's own connection vars
for the container hosts only, so localhost keeps the controller's Python.
community.docker 5.4.1's docker_api connection supports pipelining and become and needs only
requests, which requirements-dev.lock already pins. The docker CLI bind mount in molecule.yml
stays until a green run shows nothing needs it; its comment and two others that named the
CLI's calls now describe the API connection.
Closes#455
Assisted-by: Claude Code
Part of #432. A long scenario started late sets the end of a full run, so
run_molecule_scenarios.sh now starts scenarios by the durations of the last
full run, longest first, with an unlisted scenario first; the log groups keep
the selection order. A workflow_dispatch input `lanes` reaches the script as
MOLECULE_LANES, so full runs with different lane counts can be compared; an
empty value keeps the default of 4.
The shared molecule config enables ansible.posix.profile_tasks (summary only)
and ansible.posix.timer, so each scenario's log shows where its time goes.
Assisted-by: Claude Code
Add .config/molecule/config.yml, which molecule merges under every
scenario's molecule.yml. prerun is off: the CI wrapper already puts the
checkout first on ANSIBLE_COLLECTIONS_PATH, so molecule's per-scenario
reinstall of mortis.kamino into ANSIBLE_HOME is redundant. gathering is
smart, so each host's facts are gathered once per playbook run instead
of in every play.
Add .config to build_ignore so scripts/check_tarball.py does not fail
the build, and reword the Molecule rule and the two script comments that
said molecule installs the collection into each scenario's ANSIBLE_HOME.
Assisted-by: Claude Code:claude-opus-5-5
A change to .gitea/workflows/molecule.yml selected every scenario, so a
molecule image pin bump or a comment edit ran the full set. The selector
now compares the merge-base and HEAD copies of the workflow:
- `#` and blank lines outside a block scalar are dropped; inside one
(a `run: |` script, where they may be heredoc content) they count;
- the line after each CI_IMAGE, MOLECULE_IMAGE and MOLECULE_IMAGE_2604
`>-` key must be its value, deeper than the key and in the shape
Renovate writes, in both copies;
- comments only select nothing; a MOLECULE_IMAGE* pin selects every
scenario with a file naming it, or every scenario when a shared
molecule file names it or a file is unreadable or a symlink;
- CI_IMAGE, any other difference or a git error selects everything.
reason_for() is split out of select() to stay under ruff's complexity
limit. The Molecule rule in .gitea/workflows/AGENTS.md describes the
new case.
Assisted-by: Claude Code:claude-opus-5-5
Removing timeout-minutes left the sweep step's 45 minute bound without
the job timeout it must equal, and the script test that holds the two
equal failed with a KeyError. Restore the key at 90 minutes, which also
leaves a full run under load (PR #405 took 44m53s) real margin, and move
the sweep bound to match so a live run's containers are never removed.
Assisted-by: Claude Code
The runner's job container refuses unshare, even with a user namespace, so the
fast path sets PIP_NO_INDEX and a dead proxy instead; a raw socket is not caught.
Assisted-by: Claude Code
When the pins match the ci image every tool is baked in, so a runtime
download is a bake-in defect; failing the job makes it visible.
Assisted-by: Claude Code
Guard gitea_runner's docker group membership like its Docker start, run
user_management's getent probe unconditionally, and state the
play-level check_mode limit in every touched README. The check-mode
rule now allows the pihole guard form and names roles whose --check
needs their package installed.
Assisted-by: Claude Code