generated from coulomb/repo-seed
Add reuse-surface report gaps resolver
This commit is contained in:
@@ -88,6 +88,43 @@ def test_for_each_binds_each_list_item_before_condition_and_action_rendering() -
|
||||
]
|
||||
|
||||
|
||||
def test_for_each_can_gate_registry_hygiene_gaps_on_signal() -> None:
|
||||
rules = [
|
||||
{
|
||||
"id": "flag-registry-hygiene-gap",
|
||||
"for_each": "context.gaps",
|
||||
"bind_as": "g",
|
||||
"condition": 'context.g.hygiene_signal != ""',
|
||||
"action": {
|
||||
"task_template": "Close registry hygiene gap for {context.g.repo}",
|
||||
"target_repo": "context.g.repo",
|
||||
"priority": "medium",
|
||||
"labels": ["registry-hygiene", "{context.g.hygiene_signal}"],
|
||||
},
|
||||
}
|
||||
]
|
||||
context = {
|
||||
"gaps": [
|
||||
{
|
||||
"repo": "reuse-surface",
|
||||
"hygiene_signal": "empty_capability_scaffold",
|
||||
},
|
||||
{
|
||||
"repo": "activity-core",
|
||||
"hygiene_signal": "",
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
specs = expand_rule_actions(rules, _Event(), context)
|
||||
|
||||
assert [spec["target_repo"] for spec in specs] == ["reuse-surface"]
|
||||
assert specs[0]["labels"] == [
|
||||
"registry-hygiene",
|
||||
"empty_capability_scaffold",
|
||||
]
|
||||
|
||||
|
||||
def test_for_each_rejects_non_path_expression() -> None:
|
||||
rules = [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user