Skip to content

docs-2978: separate link-check skip lists and warn on broken anchors#2839

Open
ctauchen wants to merge 3 commits into
tigera:mainfrom
ctauchen:docs-2978-link-check-config
Open

docs-2978: separate link-check skip lists and warn on broken anchors#2839
ctauchen wants to merge 3 commits into
tigera:mainfrom
ctauchen:docs-2978-link-check-config

Conversation

@ctauchen

@ctauchen ctauchen commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Part of DOCS-2978.

What this does

Two changes to the link checker:

  1. Move the skip and allow lists into one file, src/utils/link-check-config.js. The lists used to live in two places: __tests__/crawler.test.js and src/utils/linkChecker.js. Now both files import from the new config. The lists are easier to find, edit, and review.
  2. Set onBrokenAnchors to 'warn' in docusaurus.config.js. Broken anchors now show as build warnings instead of being ignored.

Why 'warn' and not 'throw'

A build found 329 broken anchors on 219 pages. Setting 'throw' would break the build on the first one. 'warn' surfaces them all without blocking. Fixing the anchors and switching to 'throw' is tracked in DOCS-2979.

Behavior

The list move does not change behavior. Entry counts match main:

  • crawler skip list: 152
  • default skip list: 34
  • default ignore list: 3
  • skip-origins list: 6

The build still succeeds. It now prints anchor warnings.

How to validate

  • Run make build && make test on this branch and on main. The LINK-CHECK REPORT counts should match.
  • Run make build and confirm it succeeds and prints [WARNING] Docusaurus found broken anchors! with the list.

Move the crawler skip list and skip-origins list out of __tests__/crawler.test.js,
and the default skip and ignore lists out of src/utils/linkChecker.js, into a new
shared module src/utils/link-check-config.js. Both files import from it.

Pure move, no behavior change: entry counts are unchanged (crawler skip 152,
default skip 34, default ignore 3, skip-origins 6).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ctauchen ctauchen requested a review from a team as a code owner July 8, 2026 09:50
Copilot AI review requested due to automatic review settings July 8, 2026 09:50
@netlify

netlify Bot commented Jul 8, 2026

Copy link
Copy Markdown

Deploy Preview for calico-docs-preview-next ready!

Name Link
🔨 Latest commit 7ea4d41
🔍 Latest deploy log https://app.netlify.com/projects/calico-docs-preview-next/deploys/6a4e3068fc6ef50008825f52
😎 Deploy Preview https://deploy-preview-2839--calico-docs-preview-next.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Jul 8, 2026

Copy link
Copy Markdown

Deploy Preview succeeded!

Built without sensitive environment variables

Name Link
🔨 Latest commit 7ea4d41
🔍 Latest deploy log https://app.netlify.com/projects/tigera/deploys/6a4e3068b7e8c80008915c97
😎 Deploy Preview https://deploy-preview-2839--tigera.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 71 (🟢 up 5 from production)
Accessibility: 98 (no change from production)
Best Practices: 92 (no change from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR centralizes link-checker skip/ignore configuration into a single shared module and tightens Docusaurus build validation by failing on broken anchors, improving maintainability and catching more link quality issues during builds.

Changes:

  • Added src/utils/link-check-config.js as the single source of truth for link-check skip/ignore lists (engine + crawler).
  • Updated src/utils/linkChecker.js and __tests__/crawler.test.js to import lists from the new config module.
  • Switched Docusaurus onBrokenAnchors from ignore to throw to fail builds on broken #anchor references.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/utils/linkChecker.js Uses centralized default skip/ignore lists from the new config module.
src/utils/link-check-config.js New shared module containing engine + crawler skip/ignore/origin lists.
tests/crawler.test.js Imports crawler skip/origin lists from the new shared config instead of inline arrays.
docusaurus.config.js Enforces broken-anchor failures by setting onBrokenAnchors: 'throw'.

Comment thread src/utils/link-check-config.js Outdated
Comment on lines +4 to +6
* This file holds the skip and allow lists that the link checker uses. They used to live inside
* `src/utils/linkChecker.js` and `__tests__/crawler.test.js`. Keeping them here means one place to
* edit, review, and comment.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch — fixed in 7ea4d41. Reworded the header to "skip and ignore lists"; the per-list descriptions below already name each list correctly.

Set onBrokenAnchors to 'warn' in docusaurus.config.js. A build found 329 broken
anchors, so 'throw' would break the build. This surfaces them as build warnings
without blocking. Fixing them and switching to 'throw' is tracked in DOCS-2979.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ctauchen ctauchen force-pushed the docs-2978-link-check-config branch from 2fa6c94 to cc7e1c0 Compare July 8, 2026 10:13
@ctauchen ctauchen changed the title docs-2978: separate link-check skip lists and enable anchor checks docs-2978: separate link-check skip lists and warn on broken anchors Jul 8, 2026
Address Copilot review: the module holds skip and ignore lists, not allow lists.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

2 participants