fix(ci): harden links job against linkinator exit-13 crash#59
Merged
Conversation
linkinator@6's CLI runs `await main()` at the top level; on newer Node the
event loop can empty while that await is pending, aborting the crawl with
exit 13 ("unsettled top-level await") after fetching only /. That's a tooling
crash, not a broken link, producing false-red Internal links runs that block
PRs.
Pin the exact version (6.3.0) so an upstream 6.x patch can't silently shift
the behaviour, and wrap the invocation in a retry that fires *only* on exit
13 — real broken-link findings exit 1 and still fail the job immediately.
Applied to both the internal (blocking) and external (daily) jobs.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Deploying specification-website with
|
| Latest commit: |
f28d39c
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://97e5510b.specification-website.pages.dev |
| Branch Preview URL: | https://fix-linkinator-exit-13-flake.specification-website.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #58.
Problem
The Internal links check flakes with exit code 13 ("unsettled top-level await"). linkinator@6's CLI runs
await main()at the top level; on newer Node the event loop can empty while that await is still pending, aborting the crawl right after fetching/— before it recurses into any other page. The result is a false-red run that blocks PR merges (seen on #56), even though the content scans clean.Both local and CI currently resolve
linkinator@6to the same 6.3.0, so this is a genuine timing race, not a version-specific bug — pinning alone wouldn't stop the current flake.Fix
Two layers, applied to both jobs in
links.yml:linkinator@6.3.0) so an upstream 6.x patch can't silently shift the behaviour underneath us.Verified the loop logic locally: an exit-13-then-0 sequence recovers and passes; an exit-1 broken-link finding fails on the first attempt without retrying.
🤖 Generated with Claude Code