ci(molecule): run Molecule in the molecule-controller image #487

Merged
Defame1297 merged 6 commits from ci/431-pin-molecule-controller into main 2026-12-01 22:23:41 +00:00
Owner

What and why

Closes #431
Closes #434

This is the second half of ADR 0003. The Molecule job now runs molecule in the molecule-controller image instead of the ci image. A change to a tool only Lint uses then no longer bumps the image Molecule runs in, and so no longer runs every scenario.

The pin

  • molecule.yml's CI_IMAGE becomes CONTROLLER_IMAGE, pinned by hand to the first published build: git.rkdr.net/mortis/molecule-controller:0.1.0@sha256:d4ab16d5…29e2, the reference printed by image.yml job 8295.
  • molecule.yml no longer pins the ci image.

The run script

  • run_molecule_in_ci_image.sh checks the controller's /opt/molecule-pins.sha256 from the checkout root.
  • When a pull request changed those pins, it installs requirements-molecule.lock with --require-hashes into a separate venv, and the collections into a directory that comes first on the collections path.

The selector

  • A CONTROLLER_IMAGE change selects every scenario.
  • A ci pin bump in lint.yml, build.yml or gitea-release-key.yml selects none (#434).
  • requirements-molecule.* selects every scenario.
  • requirements-dev.* stays IGNORED.
  • All four cases are tested.

Renovate

  • The pin regex matches CONTROLLER_IMAGE.

Docs

  • Updated: .gitea/workflows/AGENTS.md (selector and pins rules), the accepted risk in SECURITY.md, the consumers per image in images/AGENTS.md, and the image docs.
  • The ci image's description, purpose and usage labels are updated too. They are image inputs, so the merge publishes a new ci version, and its pin bump selects no scenarios.

Verified

  • python -m unittest discover -s tests/scripts: 323 tests pass.
  • pre-commit run --all-files passes.
  • scripts/check_image_versions.py pins passes.
  • renovate-config-validator --strict passes.
  • renovate --platform=local --dry-run=extract at 44.161.0 found the controller pin and both target pins. It exited 1 only because the local Node is newer than it supports.
  • A clean-context review compared the pins file with the script's check and install path, and the job's environment with the controller image. It found no blocking issues.
  • CI: this pull request runs every scenario in the controller image. The selector runs from main and reads the renamed key as an unknown change.

Not verified

  • A full Molecule run in the controller image, until this pull request's run finishes.
  • Left for follow-ups:
    • The comment in requirements.yml still says the ci image serves Molecule. That file is hashed into both images' pins, so editing it here would rebuild both images.
    • The script is still named run_molecule_in_ci_image.sh.
    • The ci image still bakes molecule.

  • I confirm third-party material is recorded in NOTICE and REUSE.toml, or there is none.

Assisted-by: Claude Code

## What and why Closes #431 Closes #434 This is the second half of ADR 0003. The Molecule job now runs molecule in the `molecule-controller` image instead of the ci image. A change to a tool only Lint uses then no longer bumps the image Molecule runs in, and so no longer runs every scenario. **The pin** - `molecule.yml`'s `CI_IMAGE` becomes `CONTROLLER_IMAGE`, pinned by hand to the first published build: `git.rkdr.net/mortis/molecule-controller:0.1.0@sha256:d4ab16d5…29e2`, the reference printed by image.yml job 8295. - `molecule.yml` no longer pins the ci image. **The run script** - `run_molecule_in_ci_image.sh` checks the controller's `/opt/molecule-pins.sha256` from the checkout root. - When a pull request changed those pins, it installs `requirements-molecule.lock` with `--require-hashes` into a separate venv, and the collections into a directory that comes first on the collections path. **The selector** - A `CONTROLLER_IMAGE` change selects every scenario. - A ci pin bump in `lint.yml`, `build.yml` or `gitea-release-key.yml` selects none (#434). - `requirements-molecule.*` selects every scenario. - `requirements-dev.*` stays IGNORED. - All four cases are tested. **Renovate** - The pin regex matches `CONTROLLER_IMAGE`. **Docs** - Updated: `.gitea/workflows/AGENTS.md` (selector and pins rules), the accepted risk in `SECURITY.md`, the consumers per image in `images/AGENTS.md`, and the image docs. - The ci image's description, purpose and usage labels are updated too. They are image inputs, so the merge publishes a new ci version, and its pin bump selects no scenarios. ## Verified - `python -m unittest discover -s tests/scripts`: 323 tests pass. - `pre-commit run --all-files` passes. - `scripts/check_image_versions.py pins` passes. - `renovate-config-validator --strict` passes. - `renovate --platform=local --dry-run=extract` at 44.161.0 found the controller pin and both target pins. It exited 1 only because the local Node is newer than it supports. - A clean-context review compared the pins file with the script's check and install path, and the job's environment with the controller image. It found no blocking issues. - CI: this pull request runs every scenario in the controller image. The selector runs from main and reads the renamed key as an unknown change. ## Not verified - A full Molecule run in the controller image, until this pull request's run finishes. - Left for follow-ups: - The comment in `requirements.yml` still says the ci image serves Molecule. That file is hashed into both images' pins, so editing it here would rebuild both images. - The script is still named `run_molecule_in_ci_image.sh`. - The ci image still bakes molecule. --- - [x] I confirm third-party material is recorded in `NOTICE` and `REUSE.toml`, or there is none. Assisted-by: Claude Code
Claude added this to the CI velocity (emergency) milestone 2026-11-29 19:27:14 +00:00
Claude added 3 commits 2026-11-29 19:27:14 +00:00
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
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
docs(molecule): say the profile callbacks come from the molecule-controller image
Build / build (pull_request) Successful in 1m11s
Lint / lint (pull_request) Successful in 5m7s
Molecule / molecule (pull_request) Successful in 52m5s
91cc633665
Assisted-by: Claude Code
CODEOWNERS rules requested review from Defame1297 2026-11-29 19:27:14 +00:00
Defame1297 added 1 commit 2026-12-01 20:09:20 +00:00
Merge branch 'main' into ci/431-pin-molecule-controller
Build / build (pull_request) Successful in 33s
Lint / lint (pull_request) Successful in 4m4s
Molecule / molecule (pull_request) Canceled after 9m7s
bdf2cd8e59
Defame1297 approved these changes 2026-12-01 20:10:14 +00:00
Dismissed
Defame1297 scheduled this pull request to auto merge when all checks succeed 2026-12-01 20:10:19 +00:00
Defame1297 added 1 commit 2026-12-01 21:23:45 +00:00
Merge branch 'main' into ci/431-pin-molecule-controller
Build / build (pull_request) Successful in 40s
Lint / lint (pull_request) Successful in 3m27s
Molecule / molecule (pull_request) Canceled after 19m49s
5fd5d63984
Defame1297 dismissed Defame1297's review 2026-12-01 21:23:47 +00:00
Reason:

New commits pushed, approval review dismissed automatically according to repository settings

CODEOWNERS rules requested review from Defame1297 2026-12-01 21:23:49 +00:00
Defame1297 added 1 commit 2026-12-01 21:46:35 +00:00
Merge branch 'main' into ci/431-pin-molecule-controller
Build / build (pull_request) Successful in 39s
Lint / lint (pull_request) Successful in 3m32s
Molecule / molecule (pull_request) Successful in 36m15s
70adc0de29
Defame1297 approved these changes 2026-12-01 21:46:57 +00:00
Defame1297 merged commit 2ad2fe6060 into main 2026-12-01 22:23:41 +00:00
Defame1297 deleted branch ci/431-pin-molecule-controller 2026-12-01 22:23:46 +00:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mortis/Kamino#487