ci(molecule): stop selecting every scenario on pull requests that do not need it #338
Notifications
Due Date
No due date set.
Blocks
Reference: Mortis/Kamino#338
Reference in new issue
Block a user
Problem
From 2 to 23 Nov, 45 of 243 pull request Molecule runs selected every scenario. They took 576 of 2081 runner-minutes, about 28% of all CI time. Every job shares one runner slot, so these runs also hold back every other pull request's Lint and Build.
scripts/select_molecule_scenarios.pyselects every scenario for any changed path that is not underroles/<role>/, not an extension scenario and not onIGNORED. This fails safe by design. The paths that still select everything are:.gitea/workflows/molecule.yml, including the Molecule image pinscripts/run_molecule_scenarios.shIGNOREDrequirements.ymlandextensions/molecule/requirements.ymlmeta/,galaxy.ymlandplugins/It is not yet known which of these paths caused the 45 runs. The selector writes its reason as a
::notice::line in each job log.Out of scope:
Proposal
Measure. For every pull request run since 2026-11-02 that selected every scenario, read the path that caused it from the selector notice, and count the runs per path.
Narrow by evidence. Add to
IGNOREDthe paths that no scenario reads. Likely candidates are scripts that neithermolecule.ymlnorrun_molecule_scenarios.shcalls.Decide, maintainer. Some changes affect the test setup itself:
molecule.yml,run_molecule_scenarios.sh, the requirements files and the Molecule image pin. For these, choose between:This touches what Molecule proves (#256). After #166 lands, the nightly run is the only full run on
main.Acceptance criteria
IGNOREDis shown to be read by no scenario (grep ofmolecule.yml,run_molecule_scenarios.shandroles/*/molecule/) and has a test case intests/scripts/.python3 -m unittest discover -s tests/scriptspasses..gitea/workflows/AGENTS.mdif it changes a rule.Triage: step 3 decided, scope amended
Decision (maintainer): a pull request that changes the Molecule setup itself (
.gitea/workflows/molecule.ymlincluding the Molecule image pin,scripts/run_molecule_scenarios.sh,requirements.yml,extensions/molecule/requirements.yml) keeps selecting every scenario. No canary subset.Reason: these files change what every scenario runs on, and with push-to-main Molecule gone (#166) the nightly run is the only full run on
main; a canary would let a break merge and show up only overnight. Revisit if the step-1 count shows these paths cause most of the full-selection runs.This keeps the current behaviour, so it changes no rule in
.gitea/workflows/AGENTS.md; acceptance criterion 3 is met by this comment. These paths must not be added toIGNORED.Scope change: acceptance criterion 4 (re-measure one week after merge) moves to a follow-up issue, since it cannot be done in the pull request. This issue is done when criteria 1 and 2 are met.
Assisted-by: Claude Code
Step 1: full-selection pull request runs since 2026-11-02, by causing path.
.gitea/workflows/molecule.yml26 runs (246 min);galaxy.yml22 (226);requirements.yml1 (8); paths that are now onIGNORED17 (211);CLAUDE.md(removed) 1. Total 67 runs, 703 min. Another 40 runs ended in a selector error and 25 logs were unreadable.Step 2: every path that still selects every scenario is read by the run (the workflow,
run_molecule_in_ci_image.sh, the requirements files,meta/runtime.yml,galaxy.yml), so nothing is added toIGNORED.test_anything_else_selects_everythingalready covers them.Follow-up:
galaxy.ymlis the largest cause after the workflow itself, mostly release version bumps; narrowing it needs a content-aware rule, filed as #352. The re-measure is #351.Closing: criteria 1 and 2 are met, criterion 3 by the triage comment above, criterion 4 moved to #351.
Assisted-by: Claude Code