Fix: don't fail link check on transient connection failures - #57
Merged
Merged
Conversation
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>
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.
Why this matters more than it looks
The link check is why CI on
develophas been red, and that had a real consequence: it blocked Renovate's automerge, sohexo-theme-nextnever 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
developrun history tells the same story: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:
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 exits2on errors,1on warnings-only,0when clean, so the flag alone still leaves a nonzero exit. The wrapper now maps1to success.This does not weaken the check
Real HTTP errors stay fatal. Verified both directions against a local fixture:
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