Skip to content

Validate and update links (STF-557)#375

Open
oschwald wants to merge 3 commits into
mainfrom
greg/stf-557
Open

Validate and update links (STF-557)#375
oschwald wants to merge 3 commits into
mainfrom
greg/stf-557

Conversation

@oschwald
Copy link
Copy Markdown
Member

@oschwald oschwald commented Jun 4, 2026

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 errors 500..=599 accepted, segment-anchored exclude_path). Excludes vendored submodules (extension/libmaxminddb/, tests/data/) and the HISTORY.rst changelog.
  • mise.toml: pins lychee = "0.23.0" and defines a check-links task.
  • .github/workflows/links.yml: runs on push/PR, weekly schedule, and manual dispatch; installs only lychee via mise (install: false + MISE_AUTO_INSTALL: false).
  • .lycheecache added to .gitignore.

Globs checked: ./**/*.md ./**/*.rst ./maxminddb/**/*.py ./pyproject.toml. The C extension sources contain no doc URLs, so *.c/*.h are not scanned.

Link fixes (old -> new)

  • 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/

Final lychee run: 8 OK, 0 Errors, 1 Excluded. ruff check and ruff format --check pass.

Part of STF-557.

🤖 Generated with Claude Code

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread mise.toml Outdated
@@ -0,0 +1,6 @@
[tools]
lychee = "0.23.0"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The specified version of lychee (0.23.0) does not exist. The latest stable version of lychee is currently 0.16.0 (or 0.15.1). Using a non-existent version will cause mise to fail when attempting to install the tool.

Suggested change
lychee = "0.23.0"
lychee = "0.16.0"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Comment thread lychee.toml

# Don't allow any redirects, so links that have moved are surfaced and can be
# updated to their canonical destination.
max_redirects = 0
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
max_redirects = 0
max_redirects = 3

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Comment thread lychee.toml
# 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"]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
accept = ["100..=103", "200..=299", "403", "429", "500..=599", "999"]
accept = ["100..=103", "200..=299", "403", "429", "999"]

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

oschwald and others added 3 commits June 4, 2026 22:00
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant