Validate and update links (STF-557)#375
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces the Lychee link checker to the repository, adding configuration files (lychee.toml and mise.toml), updating .gitignore to ignore the cache, and correcting several URLs in README.rst and pyproject.toml. The review feedback highlights three main issues: the specified lychee version in mise.toml does not exist and will cause installation failures, setting max_redirects = 0 in lychee.toml may make the CI overly fragile to external redirects, and accepting 500..=599 status codes prevents actual server errors from being flagged.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| @@ -0,0 +1,6 @@ | |||
| [tools] | |||
| lychee = "0.23.0" | |||
There was a problem hiding this comment.
There was a problem hiding this comment.
lychee 0.23.0 does exist (released 2026-02-13) and is the version dev-site pins; mise install resolves it and the Links workflow runs green here. This looks like an outdated assumption about the latest version.
— Claude (posted on Greg's behalf)
|
|
||
| # Don't allow any redirects, so links that have moved are surfaced and can be | ||
| # updated to their canonical destination. | ||
| max_redirects = 0 |
There was a problem hiding this comment.
Setting max_redirects = 0 will cause the link checker to fail on any HTTP redirect (such as 301 Moved Permanently or 302 Found). While this is useful for ensuring all links are canonical, in practice, external websites frequently use redirects for path normalization, HTTPS enforcement, or localization. Failing the CI for these external redirects can make the build highly fragile and prone to failing due to changes outside of your control.\n\nConsider allowing a small number of redirects (e.g., 3) to make the CI more robust, or run redirect checks as a non-blocking warning-only workflow.
| max_redirects = 0 | |
| max_redirects = 3 |
There was a problem hiding this comment.
Intentionally keeping max_redirects = 0. Surfacing moved/redirecting links is the goal of this change (STF-557), and it matches the dev-site and blog-site lychee configs; redirects are resolved by updating the link to its canonical target.
— Claude (posted on Greg's behalf)
| # 429: Too Many Requests | ||
| # 500-599: Server errors (temporary issues shouldn't fail CI) | ||
| # 999: LinkedIn's custom status code | ||
| accept = ["100..=103", "200..=299", "403", "429", "500..=599", "999"] |
There was a problem hiding this comment.
Including "500..=599" in the accept list means that any link returning a server error (such as 500 Internal Server Error, 502 Bad Gateway, or 504 Gateway Timeout) will be treated as successful and ignored. This defeats the purpose of the link checker, as dead or misconfigured external links returning these status codes will not be flagged.\n\nConsider removing "500..=599" from the accepted status codes so that actual server errors are surfaced.
| accept = ["100..=103", "200..=299", "403", "429", "500..=599", "999"] | |
| accept = ["100..=103", "200..=299", "403", "429", "999"] |
There was a problem hiding this comment.
Keeping 500..=599 in accept, matching the dev-site and blog-site configs — transient upstream 5xx shouldn't fail link-checking CI.
— Claude (posted on Greg's behalf)
Part of STF-557. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- README.rst: https://dev.maxmind.com/geoip/geolocate-an-ip/databases?lang=en -> https://dev.maxmind.com/geoip/geolocate-an-ip/databases/?lang=en - README.rst: https://www.maxmind.com/en/support -> https://support.maxmind.com/knowledge-base - pyproject.toml: https://www.maxmind.com/ -> https://www.maxmind.com/en/home - pyproject.toml: https://maxminddb.readthedocs.org/ -> https://maxminddb.readthedocs.io/en/latest/ Part of STF-557. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Resolves zizmor ref-version-mismatch warnings on hash-pinned actions whose version comments omitted the leading v (the pinned commits already match the corresponding vX.Y.Z tags). Comment-only change. Part of STF-557. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adds a lychee-based link checker (config + CI workflow run via mise) and fixes stale/redirecting links across the repo's docs and metadata.
Tooling
lychee.toml: shared config (max_redirects = 0, server errors500..=599accepted, segment-anchoredexclude_path). Excludes vendored submodules (extension/libmaxminddb/,tests/data/) and theHISTORY.rstchangelog.mise.toml: pinslychee = "0.23.0"and defines acheck-linkstask..github/workflows/links.yml: runs on push/PR, weekly schedule, and manual dispatch; installs only lychee via mise (install: false+MISE_AUTO_INSTALL: false)..lycheecacheadded to.gitignore.Globs checked:
./**/*.md ./**/*.rst ./maxminddb/**/*.py ./pyproject.toml. The C extension sources contain no doc URLs, so*.c/*.hare not scanned.Link fixes (old -> new)
https://dev.maxmind.com/geoip/geolocate-an-ip/databases?lang=en->https://dev.maxmind.com/geoip/geolocate-an-ip/databases/?lang=enhttps://www.maxmind.com/en/support->https://support.maxmind.com/knowledge-basehttps://www.maxmind.com/->https://www.maxmind.com/en/homehttps://maxminddb.readthedocs.org/->https://maxminddb.readthedocs.io/en/latest/Final lychee run:
8 OK, 0 Errors, 1 Excluded.ruff checkandruff format --checkpass.Part of STF-557.
🤖 Generated with Claude Code