Skip to content
This repository was archived by the owner on Aug 4, 2026. It is now read-only.

Commit 6e891ff

Browse files
committed
fix: make the redirect gate actually gate, and stop fighting the canonical
Both from CodeRabbit's review, both real. The coverage check called pytest.skip when the mkdocs build failed. A skip exits pytest 0, so the workflow would have read it as a pass and deployed redirects that had never been compared against the site they replace — on the one deploy that cannot be redone afterwards. The skip bought a quieter local run without mkdocs installed and paid for it with the entire point of the check. It fails now; verified by moving mkdocs.yml aside, which turns both tests red instead of green. The stubs also carried robots: noindex, which contradicts the rel=canonical sitting two lines above it — one asks a crawler to consolidate the page onto the new URL, the other asks it to drop the page, and the second can stop the first from being acted on or carry across to the target. The comment in this file claimed the canonical was what moved search ranking while the markup was undermining it. Removed, with a note on why it is not an oversight. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U9zFxq8V4qxG4aMzJhGBFn
1 parent 5157c71 commit 6e891ff

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

scripts/build_redirects.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
only mechanism available. The canonical link is what transfers search ranking
1111
to the new URL; the meta refresh and the script are what move a reader.
1212
13+
Deliberately no ``robots: noindex`` on these stubs. It reads like the tidy thing
14+
to do, but it contradicts the canonical: one says "consolidate this page onto
15+
that URL", the other says "drop this page from the index", and a crawler that
16+
honours the second may never act on the first — or carry the noindex across to
17+
the target. A migration wants the canonical to be believed.
18+
1319
Why this runs instead of ``mkdocs build``: once this repository is archived,
1420
Actions stop running and the last deployed artifact is what Pages serves
1521
forever. That artifact needs to be the redirects, so the redirects have to be
@@ -62,7 +68,6 @@
6268
<meta name="viewport" content="width=device-width, initial-scale=1">
6369
<title>Moved to commit-check.com</title>
6470
<link rel="canonical" href="{target}">
65-
<meta name="robots" content="noindex, follow">
6671
<meta http-equiv="refresh" content="0; url={target}">
6772
<script>location.replace("{target}" + location.hash);</script>
6873
<style>

tests/redirects_test.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ def _urls_the_old_site_served() -> set[str]:
3636
text=True,
3737
)
3838
if result.returncode != 0:
39-
pytest.skip(f"mkdocs build unavailable: {result.stderr.strip()[:200]}")
39+
# Not a skip. A skip exits pytest 0, the workflow reads that as a
40+
# pass and deploys redirects that were never checked against the
41+
# site they replace — on the one deploy that cannot be redone.
42+
pytest.fail(f"mkdocs build failed: {result.stderr.strip()[:200]}")
4043
site = Path(tmp)
4144
urls = set()
4245
for page in site.rglob("index.html"):

0 commit comments

Comments
 (0)