Skip to content

Validate links against the built site; retire starlight-links-validator#359

Draft
atovpeko wants to merge 1 commit into
atovpeko/changelog-single-sourcefrom
atovpeko/built-site-link-checker
Draft

Validate links against the built site; retire starlight-links-validator#359
atovpeko wants to merge 1 commit into
atovpeko/changelog-single-sourcefrom
atovpeko/built-site-link-checker

Conversation

@atovpeko

@atovpeko atovpeko commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

Describe your changes

Replaces starlight-links-validator (which checks the markdown AST) with a checker that validates the built HTML (scripts/check-built-links.mjs), and wires it into CI.

Why: the AST validator had structural blind spots — it flagged ~63 false positives (relative links in shared AWS/Azure partials, and anchors whose heading comes from an imported partial) while missing real broken links (e.g. links inside custom components, and broken changelog permalinks). Checking rendered HTML fixes both: relative links are already absolute, partial-sourced anchors are real IDs, and it resolves Astro + Vercel redirects so legitimately-redirected links don't false-positive.

  • scripts/check-built-links.mjs: walks dist/, validates every internal <a href> resolves to a real page (or an Astro/Vercel redirect source) and that anchors exist. Base-path aware; skips the auto-generated REST reference (absent without Stainless); clear "run a build first" guard.
  • package.json: lint:links now builds then runs the checker; adds lint:links:local (no Stainless key) and check:links (check an existing dist/). Drops the starlight-links-validator dependency.
  • astro.config.ts: removes the validator plugin.
  • .github/workflows/links.yml: runs pnpm lint:links:local on relevant PRs — key-free, so it works on forks.
  • AGENTS.md: documents the new commands and behavior.

Stacked on #358 (the changelog single-source refactor). The new CI gate only passes once the changelog permalinks are fixed there, so please merge #358 first; this PR's base is that branch and will retarget to main after it lands.

Affected pages

No content pages affected by this PR. Open the preview to confirm the build deployed successfully.

Related Issues

If there is a related issue, please add it below (just put the number after the # below, and GitHub will automatically create a link):

Issue: #number

Checklist before requesting a review

  • - This is ready for review. If not, raise as a draft PR
  • - I have reviewed my changes.
  • - I have confirmed the content is technically accurate.
  • - I have tested any code that is added or updated on the latest available version.
  • - I have confirmed the content is free of typos or grammar errors.
  • - I have verified all images and videos are clear and match production (or dev for unreleased features).
  • - This references a feature that is public. If not, add a note and we can schedule the merge for after the feature release.

Replaces the markdown-AST link validator with scripts/check-built-links.mjs, which checks rendered HTML in dist/: it resolves relative links and partial-sourced anchors correctly and resolves Astro + Vercel redirects, eliminating ~63 false positives while catching real breaks the AST checker missed. Rewires pnpm lint:links to build + check, adds lint:links:local and check:links, removes the starlight-links-validator plugin and dependency, and adds a key-free CI workflow.
@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tiger-data-docs Ready Ready Preview, Comment Jun 26, 2026 3:46pm

@github-actions

Copy link
Copy Markdown

✅ Checklist Complete

Thank you for taking the time to properly review your PR! All checklist items are complete.

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