Skip to content

Check links fix - #1171

Merged
jesusmpc merged 7 commits into
mainfrom
diag/GH-1170-check-links-status-logging
Sep 9, 2026
Merged

Check links fix#1171
jesusmpc merged 7 commits into
mainfrom
diag/GH-1170-check-links-status-logging

Conversation

@jesusmpc

@jesusmpc jesusmpc commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

No description provided.

process.exit() kills the process immediately; when stdout is a pipe
(true in CI) Node's writes to it are async, so the console.log burst
listing broken external links right before it can get truncated
before the OS drains the write queue. Seen on a real run: the log
showed "6 broken external link(s) found." but not one of the six
URLs.

Use process.exitCode instead — same non-zero exit, but the module
finishes and the event loop flushes pending stdout first.

Upstream issue filed: InditexTech/docouture#231
check-links.mjs reports which link is broken but not why. Following up
on cac0758 (docouture#231): the first live re-run after that fix
surfaced 3 URLs, only 1 of which (azure.microsoft.com/es-es/products/web-pubsub)
failed consistently across 2 separate runs — the other 2 passed clean
on run 2. That's the signature of CI-side rate limiting/timeouts, not
dead links, but there was no way to confirm without the actual status
code linkinator recorded.

link.status is 0 when the request itself never got a response
(timeout, DNS, connection reset) vs a real HTTP status when the
server did answer — logging it distinguishes "this link is actually
gone" from "this crawl's burst of concurrent requests got
rate-limited", which decides whether the fix is content (dead link)
or script (concurrency/timeout tuning).
Following up on cac0758 / 8e9c99e (docouture#231): live CI runs show
the same 3 external links flip between broken and fine run to run (3
broken, then 1, then 0) with no client anywhere else ever seeing
anything but 200 — a transient failure (rate limit, timeout, reset),
not a dead link, mis-happening to fail the whole build on a bad roll
of the dice.

linkinator already has a mechanism for exactly this that the script
wasn't using: `retry` (honour a 429's retry-after header) and
`retryErrors` (retry a 5xx or status-0/no-response result a few
times with jitter) instead of accepting the crawl's first failure as
final. Wires both up with linkinator's own documented defaults for
count/jitter.
@jesusmpc jesusmpc self-assigned this Sep 9, 2026
@jesusmpc
jesusmpc requested a review from a team as a code owner September 9, 2026 12:48
@jesusmpc jesusmpc added the skip-release Skips the release creation label Sep 9, 2026
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

❗ This Pull Request will not trigger a docs release

A Pull Request with no docs/release label will not trigger a docs site release — label it docs/release if you want this merge to release the docs site.

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

❗ This Pull Request will not trigger a docs release

A Pull Request with no docs/release label will not trigger a docs site release — label it docs/release if you want this merge to release the docs site.

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

❗ This Pull Request will not trigger a docs release

A Pull Request with no docs/release label will not trigger a docs site release — label it docs/release if you want this merge to release the docs site.

@jesusmpc
jesusmpc merged commit 8fffd3d into main Sep 9, 2026
16 checks passed
@jesusmpc
jesusmpc deleted the diag/GH-1170-check-links-status-logging branch September 9, 2026 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-release Skips the release creation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant