ci: fail the Molecule run when a scenario has molecule's prerun on #452

Open
opened 2026-11-27 22:03:43 +00:00 by Claude · 0 comments
Owner

Part of #419

Problem

.config/molecule/config.yml sets prerun: false, so molecule does not install the collection again for each scenario. The rule in .gitea/workflows/AGENTS.md (Molecule, "Scenarios load mortis.kamino from the checkout") relies on it, but nothing checks it. scripts/check_scenarios_load_checkout.py checks only where mortis.kamino resolves. Because the checkout stays first on ANSIBLE_COLLECTIONS_PATH, a scenario that turns prerun back on still passes that check. The run just gets slower again, and nothing fails.

Ways it can be lost: a scenario's molecule.yml sets prerun: true, or the base config is moved or renamed so that molecule no longer merges it.

Out of scope: the rest of the base config (gathering, pipelining), which only affects speed.

Proposal

In check_scenarios_load_checkout.py, read the merged config molecule builds for each scenario (Config(...).config["prerun"]) and fail the scenario when it is not False. Name the base config file in the message. Update the rule's Held line in .gitea/workflows/AGENTS.md to say so.

Acceptance criteria

  • A test in tests/scripts/ fails a scenario whose molecule.yml sets prerun: true, and passes one that inherits the base config (python3 -m unittest discover -s tests/scripts).
  • The rule's Held line in .gitea/workflows/AGENTS.md names the prerun check.

Amended per the #419 spec

Two corrections to the proposal:

  • The script builds Config with args={}. Molecule merges base configs only from args["base_config"], and the CLI fills that from its own base-config lookup. So the base config is not merged today, and prerun reads as molecule's default, True, even for a correct scenario. Pass the base config the way the CLI does, using molecule's own lookup.
  • The value is config_data["prerun"], which is what molecule's worker reads, not config["prerun"].

Added acceptance criteria:

  • The test checkout writes a base config with prerun: false. A missing base config fails, and a base config with prerun on fails (unit tests).
  • The run script's comment on prerun names the check (review).

Assisted-by: Claude Code

Part of #419 ### Problem `.config/molecule/config.yml` sets `prerun: false`, so molecule does not install the collection again for each scenario. The rule in `.gitea/workflows/AGENTS.md` (Molecule, "Scenarios load `mortis.kamino` from the checkout") relies on it, but nothing checks it. `scripts/check_scenarios_load_checkout.py` checks only where `mortis.kamino` resolves. Because the checkout stays first on `ANSIBLE_COLLECTIONS_PATH`, a scenario that turns `prerun` back on still passes that check. The run just gets slower again, and nothing fails. Ways it can be lost: a scenario's `molecule.yml` sets `prerun: true`, or the base config is moved or renamed so that molecule no longer merges it. Out of scope: the rest of the base config (`gathering`, `pipelining`), which only affects speed. ### Proposal In `check_scenarios_load_checkout.py`, read the merged config molecule builds for each scenario (`Config(...).config["prerun"]`) and fail the scenario when it is not `False`. Name the base config file in the message. Update the rule's *Held* line in `.gitea/workflows/AGENTS.md` to say so. ### Acceptance criteria - [ ] A test in `tests/scripts/` fails a scenario whose `molecule.yml` sets `prerun: true`, and passes one that inherits the base config (`python3 -m unittest discover -s tests/scripts`). - [ ] The rule's *Held* line in `.gitea/workflows/AGENTS.md` names the `prerun` check. ### Amended per the #419 spec Two corrections to the proposal: - The script builds `Config` with `args={}`. Molecule merges base configs only from `args["base_config"]`, and the CLI fills that from its own base-config lookup. So the base config is not merged today, and `prerun` reads as molecule's default, `True`, even for a correct scenario. Pass the base config the way the CLI does, using molecule's own lookup. - The value is `config_data["prerun"]`, which is what molecule's worker reads, not `config["prerun"]`. Added acceptance criteria: - [ ] The test checkout writes a base config with `prerun: false`. A missing base config fails, and a base config with `prerun` on fails (unit tests). - [ ] The run script's comment on `prerun` names the check (review). Assisted-by: Claude Code
Claude added this to the CI velocity (emergency) milestone 2026-11-27 22:03:43 +00:00
Claude added the Kind/Enhancement
Status
Needs Triage
labels 2026-11-27 22:03:43 +00:00
Claude added
Status
Ready for Agent
and removed
Status
Needs Triage
labels 2026-11-29 15:55:32 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mortis/Kamino#452