galaxy.yml goes on IGNORED in scripts/select_molecule_scenarios.py: a pull request changing only it selects no scenario; with a role change it selects that role's.
New guard scripts/check_scenarios_load_checkout.py, run by scripts/run_molecule_in_ci_image.sh on the selected scenarios before they start. For each it builds the environment molecule hands ansible-playbook (molecule's own Config(...).provisioner.env, so a scenario's own env counts), reads the ordered COLLECTIONS_PATHS from ansible-config dump in that environment, puts the scenario's own collections/ directory first (as ansible-playbook does), and fails with the rule as its message unless the first mortis.kamino is this checkout.
The rule is in .gitea/workflows/AGENTS.md (Molecule), with the IGNORED rule pointing to it.
Ruled out: ansible-galaxy collection list (its output is sorted, not in search order); a task in every scenario (touches every role, and the issue makes it the fallback); a check of the inherited environment only (the issue asks for molecule's).
The guard anchors on the checkout the script lives in, which in CI is $AC_ROOT/ansible_collections/mortis/kamino. It uses a throwaway ANSIBLE_HOME: if ANSIBLE_COLLECTIONS_PATH were ever unset, it finds no copy and fails rather than passing.
The selector runs from origin/main's copy, so this pull request still runs every scenario; the change applies from the next one.
Verified
Which copy a scenario loads: throwaway draft #356 (closed unmerged), its Molecule job. role_path of mortis.kamino.sshd was $AC_ROOT/ansible_collections/mortis/kamino/roles/sshd; COLLECTIONS_PATHS was [$AC_ROOT, /opt/collections]; molecule's install at $ANSIBLE_HOME/collections/... exists but is not on the path.
python3 -m unittest discover -s tests/scripts: 244 tests OK (12 skipped without molecule), and with the repository venv's python (molecule 26.11.0, ansible-core 2.22.0): 244 OK, none skipped. The guard's tests cover the checkout first (pass), another copy first, a scenario env putting another copy first, a copy in the scenario's collections/, no copy at all, and naming only the failing scenario.
pre-commit run --all-files: passed. ansible-test sanity ran in the pre-push hook.
Two review sub-agents (standards and spec) ran on the diff; their findings are addressed in this commit.
Not verified
The guard on the real runner: this pull request's own Molecule run (every scenario) is its first run there. Each check takes about 1 to 2 s per scenario locally; the time over a full run is not measured yet.
A real galaxy.yml-only pull request selecting nothing: covered by the selector test, not by a CI run, because the selector runs from main.
I confirm third-party material is recorded in NOTICE and REUSE.toml, or there is none.
Assisted-by: Claude Code
## What and why
Closes #355 (decision: #352).
- `galaxy.yml` goes on `IGNORED` in `scripts/select_molecule_scenarios.py`: a pull request changing only it selects no scenario; with a role change it selects that role's.
- New guard `scripts/check_scenarios_load_checkout.py`, run by `scripts/run_molecule_in_ci_image.sh` on the selected scenarios before they start. For each it builds the environment molecule hands `ansible-playbook` (molecule's own `Config(...).provisioner.env`, so a scenario's own `env` counts), reads the ordered `COLLECTIONS_PATHS` from `ansible-config dump` in that environment, puts the scenario's own `collections/` directory first (as `ansible-playbook` does), and fails with the rule as its message unless the first `mortis.kamino` is this checkout.
- The rule is in `.gitea/workflows/AGENTS.md` (Molecule), with the IGNORED rule pointing to it.
Ruled out: `ansible-galaxy collection list` (its output is sorted, not in search order); a task in every scenario (touches every role, and the issue makes it the fallback); a check of the inherited environment only (the issue asks for molecule's).
The guard anchors on the checkout the script lives in, which in CI is `$AC_ROOT/ansible_collections/mortis/kamino`. It uses a throwaway `ANSIBLE_HOME`: if `ANSIBLE_COLLECTIONS_PATH` were ever unset, it finds no copy and fails rather than passing.
The selector runs from `origin/main`'s copy, so this pull request still runs every scenario; the change applies from the next one.
## Verified
- Which copy a scenario loads: throwaway draft #356 (closed unmerged), [its Molecule job](https://git.rkdr.net/Mortis/Kamino/actions/runs/5379/jobs/6538). `role_path` of `mortis.kamino.sshd` was `$AC_ROOT/ansible_collections/mortis/kamino/roles/sshd`; `COLLECTIONS_PATHS` was `[$AC_ROOT, /opt/collections]`; molecule's install at `$ANSIBLE_HOME/collections/...` exists but is not on the path.
- `python3 -m unittest discover -s tests/scripts`: 244 tests OK (12 skipped without molecule), and with the repository venv's python (molecule 26.11.0, ansible-core 2.22.0): 244 OK, none skipped. The guard's tests cover the checkout first (pass), another copy first, a scenario `env` putting another copy first, a copy in the scenario's `collections/`, no copy at all, and naming only the failing scenario.
- `pre-commit run --all-files`: passed. `ansible-test sanity` ran in the pre-push hook.
- Two review sub-agents (standards and spec) ran on the diff; their findings are addressed in this commit.
## Not verified
- The guard on the real runner: this pull request's own Molecule run (every scenario) is its first run there. Each check takes about 1 to 2 s per scenario locally; the time over a full run is not measured yet.
- A real `galaxy.yml`-only pull request selecting nothing: covered by the selector test, not by a CI run, because the selector runs from `main`.
---
- [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-24 15:57:07 +00:00
Scenarios load mortis.kamino from the checkout, not the copy molecule installs from
galaxy.yml, so galaxy.yml goes on the selector's IGNORED list. A new check, run by
run_molecule_in_ci_image.sh before the scenarios, fails the run when the environment
molecule gives ansible-playbook would resolve the collection anywhere else.
Closes#355
Assisted-by: Claude Code
CODEOWNERS rules
requested review from Defame1297 2026-11-24 15:57:07 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What and why
Closes #355 (decision: #352).
galaxy.ymlgoes onIGNOREDinscripts/select_molecule_scenarios.py: a pull request changing only it selects no scenario; with a role change it selects that role's.scripts/check_scenarios_load_checkout.py, run byscripts/run_molecule_in_ci_image.shon the selected scenarios before they start. For each it builds the environment molecule handsansible-playbook(molecule's ownConfig(...).provisioner.env, so a scenario's ownenvcounts), reads the orderedCOLLECTIONS_PATHSfromansible-config dumpin that environment, puts the scenario's owncollections/directory first (asansible-playbookdoes), and fails with the rule as its message unless the firstmortis.kaminois this checkout..gitea/workflows/AGENTS.md(Molecule), with the IGNORED rule pointing to it.Ruled out:
ansible-galaxy collection list(its output is sorted, not in search order); a task in every scenario (touches every role, and the issue makes it the fallback); a check of the inherited environment only (the issue asks for molecule's).The guard anchors on the checkout the script lives in, which in CI is
$AC_ROOT/ansible_collections/mortis/kamino. It uses a throwawayANSIBLE_HOME: ifANSIBLE_COLLECTIONS_PATHwere ever unset, it finds no copy and fails rather than passing.The selector runs from
origin/main's copy, so this pull request still runs every scenario; the change applies from the next one.Verified
role_pathofmortis.kamino.sshdwas$AC_ROOT/ansible_collections/mortis/kamino/roles/sshd;COLLECTIONS_PATHSwas[$AC_ROOT, /opt/collections]; molecule's install at$ANSIBLE_HOME/collections/...exists but is not on the path.python3 -m unittest discover -s tests/scripts: 244 tests OK (12 skipped without molecule), and with the repository venv's python (molecule 26.11.0, ansible-core 2.22.0): 244 OK, none skipped. The guard's tests cover the checkout first (pass), another copy first, a scenarioenvputting another copy first, a copy in the scenario'scollections/, no copy at all, and naming only the failing scenario.pre-commit run --all-files: passed.ansible-test sanityran in the pre-push hook.Not verified
galaxy.yml-only pull request selecting nothing: covered by the selector test, not by a CI run, because the selector runs frommain.NOTICEandREUSE.toml, or there is none.Assisted-by: Claude Code