Menu

Should a broken link fail your CI build? Block internal links, warn on external ones
📰

Should a broken link fail your CI build? Block internal links, warn on external ones

DEV Community: github·linkbruno.com·13 days ago
#L9zmh661
#devtogithub#technology#devto#dev#section
Reading 0:00
15s threshold

A pull request fixing a typo in the README failed CI. The reason: a blog post linked from the docs, on a site owned by someone else, started returning 503 that morning. The contributor couldn't fix it, the maintainer was asleep, and the PR sat red for two days.

The week before, the same repo merged a renamed docs page that broke 14 internal links, because link checking had been turned off after the last false alarm.

TL;DR

Treat internal links (your own site, your own docs) as code: broken means failing build.

Treat external links as data: check them on a schedule, report them, but don't block merges.

Use caching, retries and an allowlist to keep the PR check fast and deterministic.

My opinion: a CI check that can fail because of someone else's server is a flaky test, and flaky tests get disabled.

Why "fail on everything" doesn't last

External links fail for reasons that have nothing to do with the change in the PR: rate limiting, bot protection, outages, geo-blocking.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.