summaryrefslogtreecommitdiff
path: root/scripts/docs_gates/test_gates.py
diff options
context:
space:
mode:
authorYuriy Andamasov <yuriy@vyos.io>2026-08-21 23:43:26 +0300
committerYuriy Andamasov <yuriy@vyos.io>2026-08-21 23:43:26 +0300
commitbeec730d3743687482c6516dec8c15cc2bcea63b (patch)
treed0f2ab96c5b547b493fc517e42b95f37801ce48f /scripts/docs_gates/test_gates.py
parent0f69d0846fef313f23c84d7dff8b5ae8e24ec04c (diff)
downloadvyos-documentation-claude/cf-port-circinus.tar.gz
vyos-documentation-claude/cf-port-circinus.zip
ci: IS-572: re-sync ported Cloudflare Workers pipeline files with rollingclaude/cf-port-circinus
The category-1 files in this port are byte-identical copies from `rolling`. `rolling` has since moved: [vyos-documentation#2209](https://github.com/vyos/vyos-documentation/pull/2209) merged as `3a1c6c30`, thirteen rounds of hardening on exactly these files. Re-take all 14 category-1 paths from `origin/rolling` via `git checkout origin/rolling -- <paths>`, so byte-identity holds by construction rather than by hand-editing: .github/workflows/docs-build.yml scripts/docs_gates/{gates,parity,smoke,test_gates,test_parity,test_smoke}.py workers/.gitignore workers/apex/src/{index,special,uagate}.ts workers/apex/test/{router,uagate}.test.ts workers/apex/ua-policy.json Thirteen of the fourteen carry [vyos-documentation#2209](https://github.com/vyos/vyos-documentation/pull/2209) exactly — the pre-change tree was byte-identical to `3a1c6c30^` for those paths. `workers/.gitignore` additionally picks up the one-line `test-results/` entry from [vyos-documentation#2212](https://github.com/vyos/vyos-documentation/pull/2212); inert on circinus, since only the deliberately-unported `apex-deploy.yml` writes that directory. Deliberate exclusions are unchanged: `docs-canary-qa.yml` (cron runs on the default branch only, so it is not ported even though [vyos-documentation#2209](https://github.com/vyos/vyos-documentation/pull/2209) touched it on `rolling`), `apex-deploy.yml`, and the `docs-preview-*` workflows. `docs/conf.py` stays hand-merged and circinus-specific, with its ReadTheDocs fallback intact. 🤖 Generated by [robots](https://vyos.io)
Diffstat (limited to 'scripts/docs_gates/test_gates.py')
-rw-r--r--scripts/docs_gates/test_gates.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/scripts/docs_gates/test_gates.py b/scripts/docs_gates/test_gates.py
index a30837ea..e65be3af 100644
--- a/scripts/docs_gates/test_gates.py
+++ b/scripts/docs_gates/test_gates.py
@@ -1,5 +1,7 @@
import json
+import sys
from pathlib import Path
+
import pytest
from scripts.docs_gates import gates
@@ -102,3 +104,19 @@ def test_fail_when_declared_pdf_missing(artifact: Path, versions: Path):
rc = gates.run(artifact=artifact, slug="rolling", versions=versions,
previous_meta=None, critical=["index.html"])
assert rc == 1
+
+
+def test_critical_list_strips_before_testing_for_comments(monkeypatch, tmp_path, artifact):
+ # An INDENTED comment used to survive the `line.startswith("#")` test (applied to the
+ # UNSTRIPPED line) and become a live critical-page entry. A comment can never exist as a
+ # file, so it would block every deploy with "critical page missing: en/rolling/ # ...".
+ crit = tmp_path / "critical.txt"
+ crit.write_text("# leading comment\n # indented comment\n\n index.html \n")
+ seen: list[str] = []
+ monkeypatch.setattr(gates, "run",
+ lambda art, slug, versions, prev, critical: seen.extend(critical) or 0)
+ monkeypatch.setattr(sys, "argv", [
+ "gates", "--artifact", str(artifact), "--slug", "rolling",
+ "--versions", str(versions_arg(tmp_path)), "--critical-list", str(crit)])
+ assert gates.main() == 0
+ assert seen == ["index.html"]