Skip to content

Check the documentation links instead of reporting success on nothing - #2421

Open
woksin wants to merge 2 commits into
mainfrom
fix/verify-markdown-zero-links
Open

Check the documentation links instead of reporting success on nothing#2421
woksin wants to merge 2 commits into
mainfrom
fix/verify-markdown-zero-links

Conversation

@woksin

@woksin woksin commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Fixed

woksin and others added 2 commits July 29, 2026 14:36
The skip pattern excluded every URL on localhost, which is where linkinator
serves the files it scans. It matched the crawl root itself, so the whole
scan was skipped and each run reported success having checked zero links —
locally and in CI alike.

- Skip only what falls outside /Documentation/, which is exactly the
  site-absolute paths a single repository cannot resolve.
- Fail when a run scans zero links or reports no summary at all, so the
  check cannot quietly become a no-op again.
- Scan .mdx pages as well, and let CI run the same script contributors run,
  so the two configurations cannot drift apart.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VRa2Z1cA6D3Fuw9TAo6m2p
Five links kept the .md extension after the page they name became .mdx, so
they resolved nowhere at all. Nine more left the extension off; the rest of
the documentation links to a page by its file name, and now these do too.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VRa2Z1cA6D3Fuw9TAo6m2p
@woksin woksin added the patch label Jul 29, 2026
@woksin

woksin commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

Reviewer context — deliberately kept out of the description.

This is agent-authored and no human has read it yet. Green CI is not sign-off.

The cause was not the glob

The issue guessed a glob or working-directory mismatch. It is neither. linkinator serves the files it scans from a local web server on 127.0.0.1, so every internal link resolves to http://127.0.0.1:<port>/…. The skip pattern ^(https?:\/\/)?(localhost|127\.0\.0\.1)(:\d+)?(\/|$) therefore matched the crawl root itself, the whole scan was skipped, and the run reported success:

✓ Successfully scanned 0 links in 0.011 seconds.   (exit 0)

The same pattern is passed to linkinator-action in the workflow, so CI was equally blind — run 30450036709 logs Scanned total of 0 links!.

What is verified here and what is not

A single repository can only resolve relative links and external URLs. Links written as site-absolute paths (/arc/…, /chronicle/…) address the aggregated site, where each product's Documentation folder is mounted under its own prefix; they are verified when that site is built. The skip is now expressed as a rule — "served by our own scan server and outside /Documentation/" — so a new product prefix needs no change here.

Verification

Before After
links scanned 0 317
broken links reported 0 0 (14 found and fixed)
  • Pre-fix configuration passes with a broken link present — a scratch page with a dead link, old flags: Successfully scanned 0 links, exit 0.
  • New script fails on the same pageDetected 1 broken links. Scanned 319 links, exit 1.
  • Zero-scan guard — restoring the old skip pattern in a copy of the script now exits 1 with Link verification scanned zero links, rather than passing.
  • No-summary guard — globs matching nothing exits 1 rather than passing.
  • Documentation/verify-markdown.sh passes end to end (lint 259 files + links 317), from the repository root and from Documentation/.

The fourteen links

Five kept .md after the page became .mdx (add-event-sourcing, your-first-command, frontend/index, storybook) — those resolve nowhere, on the site or off it. Nine were extensionless chapter links in the tutorial, which the site resolves but a file-level check cannot; they now carry the file name like the rest of the documentation does (generating-a-screenplay.md already links .mdx this way).

Worth knowing

  • Every folder under Documentation/ currently has an index page, so --directory-listing is equivalent to a strict check today. If a folder ever loses its index page, a link to that folder would pass here — the aggregated site build is what catches that.
  • linkinator is pinned to 8.0.2 so a new major cannot silently change what is scanned.
  • .mdx pages are now scanned for links (13 files, +18 links). They are still not linted — markdownlint runs on *.md only, unchanged by this PR.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant