Skip to content

Run the link check against the local build, not a Vercel preview - #1865

Merged
pmckinney-codat merged 2 commits into
mainfrom
fix/link-check-without-vercel
Jul 30, 2026
Merged

Run the link check against the local build, not a Vercel preview#1865
pmckinney-codat merged 2 commits into
mainfrom
fix/link-check-without-vercel

Conversation

@pmckinney-codat

Copy link
Copy Markdown
Collaborator

Why

The broken-links workflow asked the Vercel API for a PR preview URL and crawled that. With Vercel deprecated in favour of GitHub Pages there is no preview deployment, so the job was pointing linkinator at a hostname that no longer resolves.

What

Check the local build instead of a preview deployment. check-links.yml is gone; the check now runs at the end of the existing pr.yml build job. Linkinator serves ./build on an ephemeral localhost port, so it needs no deployed environment and reuses the build we already do rather than paying for a second one. The codatbot skip, the previous-comment cleanup and the fail-on-broken-links behaviour all carry over. workflow_dispatch is kept, though a manual run now checks a fresh build rather than the live site.

Fix links:check, which could never have worked locally. It skipped .*localhost.*, and serving ./build locally makes every internal link a localhost URL — so the whole check was a no-op. Dropping that skip is what surfaced the links below.

Stop external hosts making the check flaky. Linkinator probes with HEAD and falls back to GET, but keeps the HEAD status if that GET exceeds --timeout. At the default concurrency of 100 that reported healthy links as 400/404 (api.codat.io/swagger/... and accounts.zoho.com/signin both do GET 200 / HEAD 400). Lowered concurrency, raised the timeout, and 5xx now joins 403 and 0 as noise so the check doesn't go red on someone else's outage.

Fixed the six real broken links it found — dead Intuit and QuickBooks FR URLs, a 404ing Data Coverage Explorer link (and the changelog post that existed only to link to it), an inaccessible Figma prototype, and a codat-docs.vercel.app self-link now made relative.

Verification

Ran a full build plus link check locally. Internal links are clean, and broken entries dropped from 1,648 to 109 — all of which are the filtered 403/0/5xx noise, with no genuine failures left.

Follow-ups, deliberately not in here

  • Docusaurus reports 7 pages with broken links and 172 with broken anchors, all currently only warnings (onBrokenLinks / onBrokenAnchors are both "warn" in docusaurus.config.js). Linkinator won't catch the anchors either, as --check-fragments is off.
  • VERCEL_TOKEN, VERCEL_TEAM_ID and VERCEL_PROJECT_ID are now unused repo secrets and can be removed.
  • If external link rot proves noisy in practice, the next step is making the PR gate internal-only and moving external checks to a scheduled report-only run.

🤖 Generated with Claude Code

pmckinney-codat and others added 2 commits July 29, 2026 17:07
The broken-links workflow asked the Vercel API for a PR preview URL and
crawled that. With Vercel deprecated in favour of GitHub Pages there is
no preview deployment, so the job pointed linkinator at a hostname that
no longer resolves.

Fold the check into the existing PR build job instead: linkinator serves
./build on an ephemeral localhost port, so it needs no deployed
environment and reuses the build we already do rather than paying for a
second one.

Also fix the links:check script, which could never have worked against a
local build - it skipped ".*localhost.*", and serving ./build locally
makes every internal link a localhost URL, so the whole check was a
no-op. Dropping that skip surfaces internal links properly.

Externally, linkinator probes with HEAD and falls back to GET, but keeps
the HEAD status if that GET exceeds --timeout; at the default
concurrency of 100 this reported healthy links as 400/404. Lower the
concurrency, raise the timeout, and treat 5xx as noise alongside 403 and
0 so the check does not go red on someone else's outage.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The first working run of the link check against a real build found six
broken links that had accumulated while the Vercel-based job was
pointing at a dead hostname.

- Intuit developer portal and QuickBooks FR notice: dead URLs, replaced
  or unlinked
- Data Coverage Explorer: knowledge.codat.io 404s, so drop the changelog
  entry and the post that existed only to link to it
- Consent journey Figma prototype: no longer accessible
- codat-docs.vercel.app self-link in a changelog post: now relative
- Zoho: point at the current sign-in URL

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@pmckinney-codat
pmckinney-codat marked this pull request as ready for review July 29, 2026 16:10
@github-actions

Copy link
Copy Markdown

Link check results:

[]

@pj-simpson
pj-simpson self-requested a review July 30, 2026 08:10
@pmckinney-codat
pmckinney-codat merged commit cfcb55c into main Jul 30, 2026
5 of 6 checks passed
@pmckinney-codat
pmckinney-codat deleted the fix/link-check-without-vercel branch July 30, 2026 08:11
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