Skip to content

Fix: don't fail link check on transient connection failures - #57

Merged
Aetf merged 1 commit into
developfrom
fix/linkcheck-connection-failures
Aug 6, 2026
Merged

Aetf merged 1 commit into
developfrom
fix/linkcheck-connection-failures

Conversation

@Aetf

@Aetf Aetf commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Why this matters more than it looks

The link check is why CI on develop has been red, and that had a real consequence: it blocked Renovate's automerge, so hexo-theme-next never advanced past 8.24.0 — the exact release that blanked the site.

Renovate opened a PR with the fix (#44) on 2025-09-06. It sat unmerged for eleven months and was autoclosed today, only because #54 landed the bump by hand. The develop run history tells the same story:

success  2026-08-06  Fix: update hexo-theme-next to v8.29.0 ...   <- manual
failure  2025-12-29  Update actions/cache action to v5
failure  2025-12-29  Update actions/checkout action to v6
failure  2025-12-29  Migrate config renovate.json
success  2025-08-09  Update dependency hexo-theme-next to v8.24.0  <- the deploy that broke the site

The failure mode

A crawl of ~5900 links hits a couple of hundred external hosts within a few seconds. From GitHub Actions runners some of them intermittently refuse the connection:

210 https://hexo.io/ (connection failed)
 12 https://letsencrypt.org/ (connection failed)
  2 https://www.mosharaf.com (connection failed)

hexo.io dominates because the theme footer links it from every page, so a single refusal becomes 210 reported failures. All three resolve fine from anywhere else — I checked each by hand. The existing retry loop can't absorb it either: its 5 attempts all land inside the same ~45 second window.

The fix

Use linkcheck's own --connection-failures-as-warnings, and treat a warnings-only run as a pass. That second half is necessary — linkcheck exits 2 on errors, 1 on warnings-only, 0 when clean, so the flag alone still leaves a nonzero exit. The wrapper now maps 1 to success.

This does not weaken the check

Real HTTP errors stay fatal. Verified both directions against a local fixture:

fixture result
good link + refused connection 1 warning, 0 errors, exit 0
the same plus one genuine 404 1 warning, 1 error, exit 2

The Deep Blue 403 dealt with in 820f4c1 is an HTTP status, not a connection failure, so it would still fail today — which is why that skip entry stays.

Note

#55 and #56 are currently blocked on exactly this flake and should go green once this lands and they're rebased.

🤖 Generated with Claude Code

The link check has been the reason CI on develop was red, and that had
real consequences: it blocked Renovate's automerge, so
`hexo-theme-next` never advanced past 8.24.0 — the exact release that
blanked the site — even though Renovate opened a PR with the fix
(#44) on 2025-09-06. That PR sat unmerged for eleven months and was
autoclosed today only because #54 landed the bump by hand.

The failure mode: a crawl of ~5900 links hits a couple of hundred
external hosts within a few seconds, and from GitHub Actions runners
some of them intermittently refuse the connection. hexo.io is the usual
victim because the theme footer links it from every page, so one refusal
becomes 210 reported failures; letsencrypt.org and mosharaf.com also
turn up. All of them resolve fine from anywhere else. The existing retry
loop can't help, because its 5 attempts all land inside the same ~45
second window.

So use linkcheck's own `--connection-failures-as-warnings`, and treat a
warnings-only run as a pass. linkcheck exits 2 on errors, 1 on
warnings-only, 0 when clean, and the wrapper now maps 1 to success.

Real HTTP errors stay fatal, verified both ways against a local fixture:

  good link + refused connection    -> 1 warning, 0 errors, exit 0
  the same plus one genuine 404     -> 1 warning, 1 error,  exit 2

So this does not weaken the check — the Deep Blue 403 handled in 820f4c1
would still fail today, which is why that skip entry stays.

Co-Authored-By: Claude <noreply@anthropic.com>
@Aetf
Aetf merged commit 24b2588 into develop Aug 6, 2026
2 checks passed
@Aetf
Aetf deleted the fix/linkcheck-connection-failures branch August 6, 2026 18:47
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