Skip to content

Fix diagram anchor check false positives (EDUENG-677)#23185

Merged
ebembi-crdb merged 1 commit intomainfrom
edueng-677-fix-diagram-anchor-false-positives
Apr 20, 2026
Merged

Fix diagram anchor check false positives (EDUENG-677)#23185
ebembi-crdb merged 1 commit intomainfrom
edueng-677-fix-diagram-anchor-false-positives

Conversation

@ebembi-crdb
Copy link
Copy Markdown
Contributor

Summary

  • Collect <a name="..."> anchors in _IDCollector, not just id= attributes. stmt_block.html defines all ~800 anchors via <a name="...">, so the check was finding 0 anchors and reporting every cross-page reference as broken.
  • Check stub anchors in sql-grammar.md alongside stmt_block.html. The grammar pages define stub anchors (e.g. col_label, column_constraints) for nonterminals that diagrams reference but that don't exist in stmt_block.html.
  • Update error message to mention both stmt_block.html and sql-grammar.md.

Fixes false failures on PRs like #23181 (RESTORE docs), which reported 6 "broken" anchors that actually resolve correctly on the rendered site.

Test plan

  • python3 .github/scripts/validate_diagram_anchors.py src/current/v26.2/restore.md — passes (0 broken anchors, was 6 false positives before)
  • Full scan in CI with GITHUB_TOKEN set

@ebembi-crdb ebembi-crdb requested a review from a team as a code owner April 16, 2026 16:00
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 16, 2026

Deploy Preview for cockroachdb-interactivetutorials-docs canceled.

Name Link
🔨 Latest commit 6ec9e1b
🔍 Latest deploy log https://app.netlify.com/projects/cockroachdb-interactivetutorials-docs/deploys/69e62006de023d00092d2a2b

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 16, 2026

Deploy Preview for cockroachdb-api-docs canceled.

Name Link
🔨 Latest commit 6ec9e1b
🔍 Latest deploy log https://app.netlify.com/projects/cockroachdb-api-docs/deploys/69e62006f259520008952036

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 16, 2026

Files changed:

  • .github/scripts/validate_diagram_anchors.py
  • .github/workflows/validate-diagram-anchors.yml

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 16, 2026

Deploy Preview for cockroachdb-docs canceled.

Name Link
🔨 Latest commit 6ec9e1b
🔍 Latest deploy log https://app.netlify.com/projects/cockroachdb-docs/deploys/69e62006cd34480008dd4a3b

The validate-diagram-anchors check produces false positives on PRs
that touch SQL pages. Remove the workflow and script entirely rather
than attempting to fix the check.
@ebembi-crdb ebembi-crdb force-pushed the edueng-677-fix-diagram-anchor-false-positives branch from e43b5b2 to 6ec9e1b Compare April 20, 2026 12:45
@ebembi-crdb ebembi-crdb merged commit f0fcddb into main Apr 20, 2026
5 checks passed
@ebembi-crdb ebembi-crdb deleted the edueng-677-fix-diagram-anchor-false-positives branch April 20, 2026 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant