fix(addons): gate the playwright addon flag on enabled alone, not on required

required is the install-failure switch, not an enablement switch:
docs/requirements/026-unified-addon-syntax.md:33 and :111 define it that way,
it is implemented only as failed_when guards in web-app-wordpress and
web-app-mattermost, and no variant and no inventory pins it anywhere. ANDing
it into the gate therefore held the flag of every 'required: false' addon at
false in every variant and every mode since 70786aa126 created the suite, so
those Playwright specs reported as skipped with the plausible reason 'addon
disabled or not deployed' while asserting nothing.

Measured against this commit's parent: 32 addon specs declare
'required: false', 24 of them in the 11 roles that call the lookup, out of the
89 addon specs those roles ship. Those 24 move from always-skipped to
executing. The flag reaches no deploy configuration, so the worst case is a red
Playwright job rather than an open surface - the old behaviour was the silent
one.

Both test files stated the old contract and are corrected with it.

Residual: the repairs for several of the specs this wakes - discourse's akismet
assertions and its missing sso gates, moodle's two addons that no install path
covers - are not in this commit. A round over those roles is red until they
land.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
kevinveenbirkenbachandClaude Opus 5 committed 2026-10-02 17:10:26 +02:00
1 parent e9d5d49056
commit d45ed509eb
3 files changed
+13 -13

No files matched your search

@@ -74,16 +74,16 @@ class TestAddonEnvFlagsLookup(unittest.TestCase):
self.assertEqual(f["COLLECTIVES_ADDON_ENABLED"], "true")
self.assertEqual(f["CONTACTS_ADDON_ENABLED"], "true")
def test_required_false_skipped_even_if_enabled(self):
self.assertEqual(self._flags()["OPTIONAL_ON_ADDON_ENABLED"], "false")
def test_required_false_still_gates_on_enabled(self):
self.assertEqual(self._flags()["OPTIONAL_ON_ADDON_ENABLED"], "true")
def test_disabled_is_false(self):
f = self._flags()
self.assertEqual(f["REQUIRED_OFF_ADDON_ENABLED"], "false")
self.assertEqual(f["OFF_OPTIONAL_ADDON_ENABLED"], "false")
def test_missing_required_defaults_false(self):
self.assertEqual(self._flags()["NO_REQUIRED_ADDON_ENABLED"], "false")
def test_missing_required_does_not_gate(self):
self.assertEqual(self._flags()["NO_REQUIRED_ADDON_ENABLED"], "true")
def test_string_flags_coerced(self):
self.assertEqual(self._flags()["STR_FLAGS_ADDON_ENABLED"], "true")
@@ -124,7 +124,7 @@ class TestNoAddons(unittest.TestCase):
class TestBridgeDeploymentGating(unittest.TestCase):
"""A bridged addon's flag is true only when one of its partner roles is in the
round's deployed closure (the inventory groups). When the set cannot be
resolved the gating is skipped (flag falls back to enabled AND required)."""
resolved the gating is skipped (flag falls back to enabled)."""
def setUp(self):
self.lookup = LookupModule()