Prepares wave 2. Until now the roles were independent and a test enforced it. traefik will include mortis.kamino.ufw and the internal mortis.kamino._binary_update, so a pull request that changes a called role must also run the scenarios of the roles that call it. This lands first because the Molecule workflow runs the picker from the base branch's copy.
What changed
scripts/select_molecule_scenarios.py:
A role uses another when a file under its directory names it as mortis.kamino.<role>. users() builds that map from the tree under test, and with_users() follows it transitively.
A role that 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 error for a selected role without a scenario now says it may be a user of a changed role.
tests/scripts/test_select_molecule_scenarios.py:
test_no_role_refers_to_another_role is replaced by test_roles_call_each_other_by_full_name_only. It fails when a role reaches another in a way the text search cannot see:
a bare or templated role name in include_role/import_role (also the k=v form) or in a play's roles: list;
a meta dependency;
include_tasks/import_tasks through ...
It walks .yml and .yaml files, and each form has its own test case.
UsersTest covers:
the transitive selection;
a user change not selecting what it uses;
self-references and unknown names;
a user role without a scenario;
a deleted role;
cycles;
a role name with a leading underscore.
CLAUDE.md: the Molecule bullet describes the new rule.
No changelog fragment: CI tooling only, nothing a consumer sees.
Verified
All 202 tests in tests/scripts pass, and the pre-commit hooks passed on the commit.
A probe with a temporary bare include_role: name: ufw in a role made the new test fail.
An independent subagent review ran twice. Its findings (the deleted-role case, the forms the test missed, wording) are fixed.
Not verified
A Molecule run with the new rule. This pull request is selected by main's copy (a change to the picker runs every scenario), so the first real use is the traefik extraction PR.
Known gaps the test does not catch, none used in the repository today:
the old args: {name: ...} include form;
other path keys that read another role's files (template/copysrc, include_vars, vars_files);
a templated name containing spaces in the k=v form.
Prepares wave 2. Until now the roles were independent and a test enforced it. `traefik` will include `mortis.kamino.ufw` and the internal `mortis.kamino._binary_update`, so a pull request that changes a called role must also run the scenarios of the roles that call it. This lands first because the Molecule workflow runs the picker from the base branch's copy.
## What changed
- `scripts/select_molecule_scenarios.py`:
- A role uses another when a file under its directory names it as `mortis.kamino.<role>`. `users()` builds that map from the tree under test, and `with_users()` follows it transitively.
- A role that 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 error for a selected role without a scenario now says it may be a user of a changed role.
- `tests/scripts/test_select_molecule_scenarios.py`:
- `test_no_role_refers_to_another_role` is replaced by `test_roles_call_each_other_by_full_name_only`. It fails when a role reaches another in a way the text search cannot see:
- a bare or templated role name in `include_role`/`import_role` (also the `k=v` form) or in a play's `roles:` list;
- a meta dependency;
- `include_tasks`/`import_tasks` through `..`.
- It walks `.yml` and `.yaml` files, and each form has its own test case.
- `UsersTest` covers:
- the transitive selection;
- a user change not selecting what it uses;
- self-references and unknown names;
- a user role without a scenario;
- a deleted role;
- cycles;
- a role name with a leading underscore.
- `CLAUDE.md`: the Molecule bullet describes the new rule.
No changelog fragment: CI tooling only, nothing a consumer sees.
## Verified
- All 202 tests in `tests/scripts` pass, and the pre-commit hooks passed on the commit.
- A probe with a temporary bare `include_role: name: ufw` in a role made the new test fail.
- An independent subagent review ran twice. Its findings (the deleted-role case, the forms the test missed, wording) are fixed.
## Not verified
- A Molecule run with the new rule. This pull request is selected by `main`'s copy (a change to the picker runs every scenario), so the first real use is the `traefik` extraction PR.
- Known gaps the test does not catch, none used in the repository today:
- the old `args: {name: ...}` include form;
- other path keys that read another role's files (`template`/`copy` `src`, `include_vars`, `vars_files`);
- a templated name containing spaces in the `k=v` form.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
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
Defame1297
scheduled this pull request to auto merge when all checks succeed 2026-11-20 18:37:28 +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.
Prepares wave 2. Until now the roles were independent and a test enforced it.
traefikwill includemortis.kamino.ufwand the internalmortis.kamino._binary_update, so a pull request that changes a called role must also run the scenarios of the roles that call it. This lands first because the Molecule workflow runs the picker from the base branch's copy.What changed
scripts/select_molecule_scenarios.py:mortis.kamino.<role>.users()builds that map from the tree under test, andwith_users()follows it transitively.tests/scripts/test_select_molecule_scenarios.py:test_no_role_refers_to_another_roleis replaced bytest_roles_call_each_other_by_full_name_only. It fails when a role reaches another in a way the text search cannot see:include_role/import_role(also thek=vform) or in a play'sroles:list;include_tasks/import_tasksthrough....ymland.yamlfiles, and each form has its own test case.UsersTestcovers:CLAUDE.md: the Molecule bullet describes the new rule.No changelog fragment: CI tooling only, nothing a consumer sees.
Verified
tests/scriptspass, and the pre-commit hooks passed on the commit.include_role: name: ufwin a role made the new test fail.Not verified
main's copy (a change to the picker runs every scenario), so the first real use is thetraefikextraction PR.args: {name: ...}include form;template/copysrc,include_vars,vars_files);k=vform.🤖 Generated with Claude Code