Skip to content

DOC-7104: Fix diff_rendered_hrefs.py to catch unquoted href attributes - #4087

Merged
andy-stark-redis merged 1 commit into
mainfrom
DOC-7104-diff-hrefs-fix
Sep 23, 2026
Merged

andy-stark-redis merged 1 commit into
mainfrom
DOC-7104-diff-hrefs-fix

Conversation

@andy-stark-redis

@andy-stark-redis andy-stark-redis commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • HREF_RX in build/diff_rendered_hrefs.py only matched double-quoted href="..." attributes. hugo --minify drops quotes on any attribute value with no whitespace/quote characters, which is true for nearly every href — on a sampled release-notes page this left 5 of 240 hrefs visible to the tool, so it fingerprinted almost nothing and could report "0 diffs" regardless of what actually changed.
  • This was caught by the DOC-7104 unit-2 (release-notes/) subagent, who simulated the effect and flagged it for a follow-up. I independently reproduced it against the real build outputs from DOC-7104 units 1 and 2 (open PRs #4083, #4086) before fixing.
  • Verified the fix: re-running the corrected tool against both units' before/after builds now surfaces exactly the documented intentional diffs in each PR (a couple of missing-paren relref fixes rendering a previously-dead link, plus a cosmetic trailing-slash normalization on relref-resolved targets) — and nothing else. No spurious diffs, no missed ones.
  • This likely means every prior href-diff verification in this migration series (DOC-6909/7047/7055/7059/7074/7079/7080/7086/7089) was checking a similarly tiny quoted-only subset. Given how narrow the actual diffs turned out to be here, I don't think this warrants re-opening merged work, but flagging it in case a retroactive spot-check is wanted.

Test plan

  • Reproduced the bug empirically against real minified build output (5/240 hrefs quoted on a sampled page)
  • Re-ran the corrected tool against DOC-7104 units 1 and 2's before/after builds; diffs match exactly what each unit's PR already documents

🤖 Generated with Claude Code


Note

Low Risk
Build-only verification script change; no runtime docs or production behavior.

Overview
Fixes href fingerprinting in build/diff_rendered_hrefs.py so migration verification works on minified Hugo HTML.

HREF_RX previously matched only double-quoted href="...". hugo --minify emits mostly unquoted href= values, so the tool fingerprinted a tiny subset of links and could falsely report no diffs when links changed. The regex now also matches single-quoted and unquoted hrefs, with a short comment documenting the minify behavior.

Reviewed by Cursor Bugbot for commit 928dd56. Bugbot is set up for automated code reviews on this repo. Configure here.

hugo --minify drops attribute quotes wherever the value has no whitespace
or quote characters, which is true for nearly every href. HREF_RX only
matched href="..." (double-quoted), so on a sampled page it fingerprinted
5 of 240 hrefs and reported "0 diffs" regardless of what actually changed.
Verified against the DOC-7104 databases/ and release-notes/ unit builds:
the corrected regex surfaces exactly the documented intentional fixes in
each (missing-paren relref fixes rendering a previously-dead link, and a
cosmetic trailing-slash normalization on relref-resolved targets) and
nothing else.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

DOC-7104

@github-actions

Copy link
Copy Markdown
Contributor

🧠 Redis Memory

Found 5 related items from repository history (5 new this commit):

Memory updated at 928dd56

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants