mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-28 13:57:43 +00:00
feat(variants): pin a partner by a switched-off service and carry static addons in one variant
A '# variant-pin: <role>#without-<key>' target resolves to the partner's one variant that pins services.<key>.enabled to literal false, with no reciprocity needed. Nextcloud v15 pins web-svc-mirror#without-prometheus above its tor entry, which cuts the tor -> mirror -> prometheus -> keycloak chain: the include of web-app-nextcloud#15 drops from 21 to 7 roles and v15 costs 9196 s instead of 17039 s over the job list (+12308 -> +4465 s over the head), coverage kept with 96/96 edges. test_addons_variant_pinning gains the carrier rule: one variant per role may keep the static addons on with '# nocheck: addons-variant-pinning <reason>' on its own addons: line. The marker fails on variant 0 or 1, on a second marked variant, with a reason under MIN_REASON_CHARS, while variant 0 still installs the static addons, and on a carrier that leaves none of them on. test_variant_pin_required counts only index and reciprocal pins as the pin a mutual pair must declare. Accepted MEDUSA-FTSCAN-231 (variant_pins.py:66) as a reviewed false positive: yaml.compose builds nodes only, git-tracked input, no sink. 🎯 Fix: 90 % 💥 Break: 5 % 💸 Tokens: – ⏱️ Velocity: – 🛡️ Security: 100 % 🏆 Score: 86 🚦 Gate: ✅ 90/5, tokens and velocity <= 100, security 100 % Created-with: https://s.veen.world/skills Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
78fedb6eb7
commit
1e04f98da8
12 files changed
+492
-47
No files matched your search
@@ -137,6 +137,19 @@ class TestVerdict(unittest.TestCase):
|
||||
)
|
||||
self.assertEqual(result["pins"]["unreciprocated"], [])
|
||||
|
||||
def test_a_resolving_without_pin_passes(self) -> None:
|
||||
pin = {
|
||||
"carrier": "app#3",
|
||||
"partner": "pa",
|
||||
"target": "without-a",
|
||||
"key": "a",
|
||||
"reciprocal": 0,
|
||||
}
|
||||
result = compare.verdict(
|
||||
_before(), _after(pin=pin), old=["app#0"], split=["app#0", "app#3"]
|
||||
)
|
||||
self.assertEqual(result["pins"]["unreciprocated"], [])
|
||||
|
||||
def test_the_render_names_the_verdict(self) -> None:
|
||||
text = compare.render(
|
||||
compare.verdict(
|
||||
|
||||
@@ -76,6 +76,15 @@ class TestPins(unittest.TestCase):
|
||||
)
|
||||
self.assertTrue(str(finding["reciprocal"]).startswith("error:"))
|
||||
|
||||
def test_a_without_pin_names_the_variant_switching_the_key_off(self) -> None:
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
[finding] = rounds.pin_findings(
|
||||
"web-app-a",
|
||||
roles_dir=_tree(tmp, "without-a", gate=False),
|
||||
variants_per_app=VARIANTS,
|
||||
)
|
||||
self.assertEqual((finding["target"], finding["reciprocal"]), ("without-a", 0))
|
||||
|
||||
|
||||
class TestToken(unittest.TestCase):
|
||||
def test_a_whole_role_row_is_variant_0(self) -> None:
|
||||
|
||||
Reference in new issue
Block a user