fix(deploy): forward the guide host into the container Ansible runs in

e17d182d0a gave web-app-docs a switch that turns the language assertion
off on a row where docs only rides along, and read it from the
guide_host environment variable. The deploy workflow sets that variable
on the runner, but a compose deploy runs Ansible inside the infinito
container, where only _FORWARDED_ENV_KEYS arrives. guide_host was not in
it, so the lookup resolved empty, the comparison against the row's own
id was true everywhere, and the switch never fired.

Run 39137606155 shows both halves: the passenger rows 117711219652 and
117711220306 carry guide_host: web-app-docs and each spent about 7000 s
of a 20400 s budget in that one assertion, while the docs row itself,
117711219660, carries an empty guide_host and therefore keeps running
it. Forwarding the variable preserves that split rather than silencing
the assertion everywhere.

APP_ID is in the tuple for the same reason and feeds the guide_role
lookup from the same workflow step.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
kevinveenbirkenbachandClaude Opus 5 committed 2026-10-19 01:10:57 +02:00
1 parent 7bfbf20791
commit 67dd278d0c
2 files changed
+15

No files matched your search

@@ -4,6 +4,12 @@ Ansible runs inside that container, so a variable the host exports reaches a
lookup only when ``_run_deploy`` forwards it explicitly. ``APP_ID`` is the
deploy workflow's name for the row's app, and
:mod:`plugins.lookup.guide_role` reads it to pin the documentation replay.
``guide_host`` names the app a documentation row rides along with, and
``web-app-docs``'s playwright environment reads it to decide whether this row
owns the language assertion. Unforwarded, the lookup is empty, the comparison
against the row's own id is true everywhere, and every passenger row pays the
two Sphinx builds the gate exists to skip.
"""
from __future__ import annotations
@@ -51,6 +57,14 @@ class TestForwardedEnv(unittest.TestCase):
def test_an_empty_app_id_is_not_forwarded(self):
self.assertNotIn("APP_ID", _deploy())
@patch.dict(os.environ, {"guide_host": "web-app-moodle"}, clear=True)
def test_the_guide_host_reaches_the_container(self):
self.assertEqual(_deploy().get("guide_host"), "web-app-moodle")
@patch.dict(os.environ, {}, clear=True)
def test_an_unset_guide_host_is_not_invented(self):
self.assertNotIn("guide_host", _deploy())
if __name__ == "__main__":
unittest.main()