ci: follow-ups after moving Molecule to the molecule-controller image #506

Open
Claude wants to merge 7 commits from ci/505-controller-followups into main
pull from: ci/505-controller-followups
Owner

What and why

Closes #505

Five follow-ups after Molecule moved to the molecule-controller image, one commit each, plus one comment-only commit for the review's findings.

  1. requirements.yml header. It now says the ci image bakes the collections for Lint, the molecule-controller image bakes them for Molecule, and the run script installs them when a pull request changes them.
  2. The run script is renamed. scripts/run_molecule_in_ci_image.sh becomes scripts/run_molecule_in_controller.sh, and its test moves with it. Every reference is updated, except ADR 0003. As an accepted ADR, it stays as decided (docs/adr/AGENTS.md).
  3. The ci image drops molecule's Docker driver and community.docker.
    • molecule itself stays, because Lint's "Test the repository scripts" step imports it, through check_scenarios_load_checkout.py and the run-scenarios tests. The comments and the image label now say so.
    • molecule-plugins[docker] is removed, and with it docker and selinux. The lock was regenerated with lock-requirements.sh.
    • extensions/molecule/requirements.yml (community.docker) is removed from the ci image and /opt/ci-pins.sha256. No linted file uses it.
  4. The ufw check-mode probes no longer read a skipped result.
    • ansible-core 2.22 deprecates a module returning skipped, with removal in 2.25. Evidence: ansible/modules/command.py:344 carries deprecated ... core_version='2.25', and the 2.22 changelog lists it under Deprecated Features.
    • The probes in install.yml, orphan_rules.yml, service_rules.yml and sysctl.yml now run echo ran and read stdout != 'ran'. The command does not run in check mode, under either --check or the check_mode keyword.
    • ansible_check_mode doesn't work for this, because it reflects only --check.
    • A trivial fragment is included, because consumer behaviour does not change.
  5. next_image_version.py returns no tags only for a 404 with the OCI error code NAME_UNKNOWN. RegistryError now carries the body's errors[].code values, and any other 404 raises.

Verified

  • Unit tests: 333 pass. They were also run in a fresh venv built from the new requirements-dev.lock, without molecule-plugins, docker or selinux, and none were skipped. So no skipped test hides a removed dependency.
  • Checks: pre-commit run --all-files and scripts/check_image_versions.py pins pass.
  • ufw probe, run as local plays against ansible-core 2.22:
    • a normal run, --diff and become give check=False with no change;
    • --check, --check --diff and the check_mode: true play keyword give check=True.
    • On a copy of ansible-core with the skipped line removed, the new signal stays right, and the old is skipped signal reports wrong.
  • The next_image_version tests cover:
    • a 404 with a plain-text body (it raises);
    • a 404 with NOT_FOUND (it raises);
    • a 404 with NAME_UNKNOWN (no tags).
  • Review: a clean-context review found no blocking issues, and its comment findings are fixed.

Not verified

  • Molecule: it runs in this pull request's CI. It selects every scenario, including the ufw check-mode steps with the new probe.

  • The image rebuilds: they only run on main. The merge rebuilds the ci image, now without the driver and community.docker, and the molecule-controller image, because the requirements.yml comment is an input of both. Renovate then opens the pin pull requests.

  • Files I added carry SPDX headers, or are covered by REUSE.toml (REUSE-clean); no third-party NOTICE is needed.

Assisted-by: Claude Code

## What and why Closes #505 Five follow-ups after Molecule moved to the molecule-controller image, one commit each, plus one comment-only commit for the review's findings. 1. **`requirements.yml` header.** It now says the ci image bakes the collections for Lint, the molecule-controller image bakes them for Molecule, and the run script installs them when a pull request changes them. 2. **The run script is renamed.** `scripts/run_molecule_in_ci_image.sh` becomes `scripts/run_molecule_in_controller.sh`, and its test moves with it. Every reference is updated, except ADR 0003. As an accepted ADR, it stays as decided (`docs/adr/AGENTS.md`). 3. **The ci image drops molecule's Docker driver and community.docker.** - `molecule` itself stays, because Lint's "Test the repository scripts" step imports it, through `check_scenarios_load_checkout.py` and the run-scenarios tests. The comments and the image label now say so. - `molecule-plugins[docker]` is removed, and with it `docker` and `selinux`. The lock was regenerated with `lock-requirements.sh`. - `extensions/molecule/requirements.yml` (community.docker) is removed from the ci image and `/opt/ci-pins.sha256`. No linted file uses it. 4. **The ufw check-mode probes no longer read a `skipped` result.** - ansible-core 2.22 deprecates a module returning `skipped`, with removal in 2.25. Evidence: `ansible/modules/command.py:344` carries `deprecated ... core_version='2.25'`, and the 2.22 changelog lists it under Deprecated Features. - The probes in `install.yml`, `orphan_rules.yml`, `service_rules.yml` and `sysctl.yml` now run `echo ran` and read `stdout != 'ran'`. The command does not run in check mode, under either `--check` or the `check_mode` keyword. - `ansible_check_mode` doesn't work for this, because it reflects only `--check`. - A `trivial` fragment is included, because consumer behaviour does not change. 5. **`next_image_version.py` returns no tags only for a 404 with the OCI error code `NAME_UNKNOWN`.** `RegistryError` now carries the body's `errors[].code` values, and any other 404 raises. ## Verified - **Unit tests:** 333 pass. They were also run in a fresh venv built from the new `requirements-dev.lock`, without molecule-plugins, docker or selinux, and none were skipped. So no skipped test hides a removed dependency. - **Checks:** `pre-commit run --all-files` and `scripts/check_image_versions.py pins` pass. - **ufw probe,** run as local plays against ansible-core 2.22: - a normal run, `--diff` and become give `check=False` with no change; - `--check`, `--check --diff` and the `check_mode: true` play keyword give `check=True`. - On a copy of ansible-core with the `skipped` line removed, the new signal stays right, and the old `is skipped` signal reports wrong. - **The `next_image_version` tests cover:** - a 404 with a plain-text body (it raises); - a 404 with `NOT_FOUND` (it raises); - a 404 with `NAME_UNKNOWN` (no tags). - **Review:** a clean-context review found no blocking issues, and its comment findings are fixed. ## Not verified - **Molecule:** it runs in this pull request's CI. It selects every scenario, including the ufw check-mode steps with the new probe. - **The image rebuilds:** they only run on `main`. The merge rebuilds the ci image, now without the driver and community.docker, and the molecule-controller image, because the `requirements.yml` comment is an input of both. Renovate then opens the pin pull requests. - [x] Files I added carry SPDX headers, or are covered by `REUSE.toml` (REUSE-clean); no third-party NOTICE is needed. Assisted-by: Claude Code
Claude added this to the CI velocity (emergency) milestone 2026-12-02 09:37:14 +00:00
Claude added 6 commits 2026-12-02 09:37:14 +00:00
Molecule runs in the molecule-controller image, which bakes these
collections, and the run script installs them when a pull request changes
them. The header still said the ci image served Molecule and that the
workflow installed them itself.

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
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
The probes in install.yml, orphan_rules.yml, service_rules.yml and
sysctl.yml took a skipped `command` task as the sign of check mode.
ansible-core 2.22 deprecates that: command.py marks its check-mode
`r['skipped'] = True` for removal in 2.25, and the 2.22 changelog says
"Returning skipped from a module or action plugin is deprecated and will be
removed in ansible-core 2.25". The probe would then report ok, and the role
would delete rules and edit sysctl.conf under --check.

The probe now runs `echo ran` and reads its output: a command does not run
in check mode, under --check or the check_mode keyword, so the output is
empty there. Checked against ansible-core 2.22 and a copy with the skipped
return removed, in a normal play, a check_mode play and --check.
service_rules.yml had the same probe and is changed with the others.

Assisted-by: Claude Code
next_image_version.py read any 404 on the first tags/list page as a
repository not pushed yet, so a wrong registry path or a proxy's 404 page
would restart the image at <base>.0 instead of failing. The OCI
distribution spec answers a missing repository with 404 and the error
code NAME_UNKNOWN, so only that answer now means no tags.

RegistryError carried only the readable text of the body, so it now also
carries the body's OCI error codes. The tests cover a plain 404 page and a
404 with another code, both of which now raise.

Assisted-by: Claude Code
chore: correct comments the ci image change left stale
Build / build (pull_request) Successful in 28s
Molecule / select (pull_request) Successful in 12s
Lint / lint (pull_request) Successful in 3m0s
Molecule / Result (pull_request) Canceled after 0s
Molecule / scenarios (pull_request) Canceled after 18m22s
22f5bc33e9
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
CODEOWNERS rules requested review from Defame1297 2026-12-02 09:37:15 +00:00
Defame1297 added 1 commit 2026-12-02 09:56:23 +00:00
Merge remote-tracking branch 'origin/main' into ci/505-controller-followups
Build / build (pull_request) Successful in 24s
Molecule / select (pull_request) Successful in 5s
Lint / lint (pull_request) Successful in 2m57s
Molecule / scenarios (pull_request) Successful in 35m31s
Molecule / Result (pull_request) Successful in 1s
2f5a997dd7
# Conflicts:
#	requirements-dev.lock
All checks were successful
Build / build (pull_request) Successful in 24s
Required
Details
Molecule / select (pull_request) Successful in 5s
Lint / lint (pull_request) Successful in 2m57s
Required
Details
Molecule / scenarios (pull_request) Successful in 35m31s
Molecule / Result (pull_request) Successful in 1s
Required
Details
This pull request has official review requests.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin ci/505-controller-followups:ci/505-controller-followups
git checkout ci/505-controller-followups
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mortis/Kamino#506