feat(ci): run the molecule scenarios of the roles that use a changed role
The scenario picker assumed the roles were independent and a test enforced it. Wave 2 roles call other Collection roles (traefik includes ufw and the internal _binary_update), so a change to the called role must also run the callers' scenarios. A role uses another when a file under its directory names it as mortis.kamino.<role>; the relation is followed transitively and read from the tree under test. A role the pull request deletes or renames still counts as used by the roles that name it, so their scenarios run and show the break. The independence test becomes a test that fails a bare or templated role name in an include, import (also in the k=v form), play roles: entry or meta dependency, and task includes that reach outside the role through '..'. It walks .yml and .yaml files and has its own cases for each form. This lands before the first such role because the workflow runs the picker from the base branch's copy. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
This commit is contained in:
1 parent
30ce518f00
commit
fcb51da065
3 files changed
+271
-25
No files matched your search
@@ -73,7 +73,8 @@ Single-context: `GLOSSARY.md` and `docs/adr/` at the root, both created lazily.
|
||||
- Molecule runs on every same-repo pull request, Renovate's included (a new image is tested by its own pin
|
||||
pull request), with no workflow path filter, so that it can be a required check. Fork pull requests are skipped.
|
||||
What a pull request runs is chosen by `scripts/select_molecule_scenarios.py`, run from the base branch's copy
|
||||
(a pull request cannot edit its own rules): only the scenarios of the roles it changes, none for a diff of
|
||||
(a pull request cannot edit its own rules): only the scenarios of the roles it changes and of the roles
|
||||
that use them (any file naming `mortis.kamino.<role>`, transitively; a test fails a bare or templated role name in an include, import, play `roles:` entry or meta dependency), none for a diff of
|
||||
only its IGNORED paths, a failure for a changed role with no scenario, and every scenario for any other file,
|
||||
for every push to `main`, for manual dispatch and for the nightly run (04:43 UTC, after Renovate's). A new file outside `roles/<role>/` runs everything until it
|
||||
is added to IGNORED, which is right only when no scenario reads it. A new commit cancels the pull request's
|
||||
|
||||
Reference in new issue
Block a user