From e17d182d0a99d12ef04924e2038520d3229f2995 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Sun, 18 Oct 2026 23:54:40 +0200 Subject: [PATCH] fix(web-app-docs): skip the language assertion when docs only rides along call-test-deploy appends web-app-docs to every matrix row that carries instructions, purely as the guide host that replays the host app's README. test-e2e-playwright then runs the passenger's whole spec suite, and the language assertion in it waits out two full Sphinx builds: 7086s measured in run 39137606155, 35 percent of that job's wall-clock budget, spent proving the docs i18n publish path inside a Moodle job. Moodle and Discourse were both killed by the budget governor because of it. DOCS_I18N_ASSERT_LANGUAGES is false exactly when guide_host names this role, and the assertion is skipped then. Coverage is deduplicated rather than lost: docs' own matrix rows still run it, and they fit the budget at 8907s. The cheap negative control, that a language without a translated site answers 404, stays unconditional. The flag defaults to asserting, so a render that never sets it behaves as it does today instead of failing the spec file at module load. Unproven until CI sees it: that lookup('env', 'guide_host') reaches Ansible inside the deploy container. If it does not, the flag renders true everywhere and nothing changes. Check the rendered .env of a passenger row for DOCS_I18N_ASSERT_LANGUAGES=false. Co-Authored-By: Claude Opus 5 (1M context) --- roles/web-app-docs/files/playwright/test-languages.js | 4 +++- roles/web-app-docs/templates/playwright.env.j2 | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/roles/web-app-docs/files/playwright/test-languages.js b/roles/web-app-docs/files/playwright/test-languages.js index f2f987c5c7..6a07d9ccc7 100644 --- a/roles/web-app-docs/files/playwright/test-languages.js +++ b/roles/web-app-docs/files/playwright/test-languages.js @@ -7,7 +7,9 @@ const preload = decodeDotenvJsonList( "DOCS_I18N_PRELOAD_LANGUAGES_JSON", ); const samples = JSON.parse(decodeDotenvQuotedValue(process.env.DOCS_I18N_SAMPLES_JSON || "") || "{}"); -const translated = preload.filter((code) => code in samples); +const assertLanguages = + decodeDotenvQuotedValue(process.env.DOCS_I18N_ASSERT_LANGUAGES || "true") !== "false"; +const translated = assertLanguages ? preload.filter((code) => code in samples) : []; const VERSION_BUILD = 5_300_000; const VERSION_THEN_TRANSLATION = 2 * VERSION_BUILD; diff --git a/roles/web-app-docs/templates/playwright.env.j2 b/roles/web-app-docs/templates/playwright.env.j2 index f66b36f0da..a64fba2ea0 100644 --- a/roles/web-app-docs/templates/playwright.env.j2 +++ b/roles/web-app-docs/templates/playwright.env.j2 @@ -12,6 +12,9 @@ DESIGN_SERVICE_ENABLED={{ lookup('config', application_id, 'services.design.enab DESIGN_TITLE={{ (lookup('design', application_id).title if lookup('design', application_id).title is string else '') | dotenv_quote }} +# Exception: on a guide-host row the language assertion waits out two full Sphinx builds (7086s measured) and SIGKILLs the host app's wall-clock budget. +DOCS_I18N_ASSERT_LANGUAGES={{ (lookup('env', 'guide_host') | trim != application_id) | string | lower }} + {% set docs_samples = {} %} {% for docs_code in DOCS_I18N_PRELOAD_LANGUAGES if docs_code != HOST_LL %} {% set _ = docs_samples.update({docs_code: lookup('i18n_sample', 'docs', docs_code, 'README.md', 5)}) %}