Skip to content

Validate and update links (STF-557)#232

Merged
horgh merged 3 commits into
mainfrom
greg/stf-557
Jun 5, 2026
Merged

Validate and update links (STF-557)#232
horgh merged 3 commits into
mainfrom
greg/stf-557

Conversation

@oschwald

@oschwald oschwald commented Jun 4, 2026

Copy link
Copy Markdown
Member

Adds a lychee link checker config and a CI workflow, and fixes stale/redirecting links across the docs and source.

Tooling

  • lychee.toml: shared config mirroring the dev-site/blog-site settings (max_redirects = 0, 500..=599 accepted, segment-anchored exclude_path).
  • .github/workflows/links.yml: runs lychee via mise (install: false + MISE_AUTO_INSTALL: false so only lychee is installed, not the full Ruby toolchain), on push/PR, weekly cron, and manual dispatch.
  • mise.toml: pins lychee = "0.23.0" and adds a check-links task scanning './**/*.md' './lib/**/*.rb' './*.gemspec'. mise.lock updated with all-platform lychee entries.
  • .gitignore: ignores .lycheecache.

Link fixes (old -> new)

  • https://dev.maxmind.com/minfraud?lang=en -> https://dev.maxmind.com/minfraud/?lang=en (and bare /minfraud -> /minfraud/)
  • https://dev.maxmind.com/minfraud/api-documentation/requests?lang=en#... -> .../requests/?lang=en#...
  • https://dev.maxmind.com/minfraud/report-a-transaction?lang=en -> .../report-a-transaction/?lang=en (and bare variant -> trailing slash)
  • https://dev.maxmind.com/minfraud/track-devices?lang=en -> .../track-devices/?lang=en
  • https://dev.maxmind.com/minfraud/api-documentation/responses/schema--response--risk-score-reason--multiplier-reason -> .../responses/#schema--response--risk-score-reason--multiplier-reason (canonical fragment form, matching the other minFraud client libraries)
  • https://tools.ietf.org/html/rfc3339 -> https://datatracker.ietf.org/doc/html/rfc3339
  • https://contributor-covenant.org -> https://www.contributor-covenant.org/
  • https://opensource.org/licenses/MIT -> https://opensource.org/license/MIT
  • https://www.maxmind.com/en/support -> https://support.maxmind.com/knowledge-base

The responses-page schema anchor is rendered client-side, so its fragment is absent from the static HTML lychee fetches (the page itself is a 200). That single fragment is excluded in lychee.toml.

Final lychee run: 52 Total, 48 OK, 0 Errors, 4 Excluded. RuboCop passes on all edited files.

Part of STF-557.

🤖 Generated with Claude Code

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

Copy link
Copy Markdown

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 integrates the Lychee link checker into the repository. It adds a lychee.toml configuration file, registers the lychee tool and a check-links task in mise.toml (and updates mise.lock), and adds .lycheecache to .gitignore. Additionally, numerous documentation links across markdown files and Ruby source files are updated to their canonical forms (e.g., adding trailing slashes or updating domains) to ensure they pass validation. Feedback on the changes suggests making the GitHub blob URL exclusion regex in lychee.toml more robust to support branch/tag refs and line ranges.

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 lychee.toml
# Exclude URL patterns from checking (treated as regular expressions)
exclude = [
# GitHub blob URLs with line-number fragments (not parseable as page anchors)
'^https://github\.com/[^/]+/[^/]+/blob/[0-9a-fA-F]+/.+#L\d+$',

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

The current regular expression for excluding GitHub blob URLs has two limitations:

  1. It only matches hex commit SHAs ([0-9a-fA-F]+) and will fail to match URLs that use branch names (like main or master) or tags as the ref.
  2. It only matches single line numbers (#L\d+$) and will fail to match line ranges (like #L10-L15).

We can make this regex more robust by:

  • Replacing [0-9a-fA-F]+ with [^/]+ to support any ref (branch, tag, or SHA).
  • Updating the anchor pattern to #L\d+(?:-L\d+)?$ to support both single lines and line ranges.
Suggested change
'^https://github\.com/[^/]+/[^/]+/blob/[0-9a-fA-F]+/.+#L\d+$',
'^https://github\.com/[^/]+/[^/]+/blob/[^/]+/.+#L\d+(?:-L\d+)?$',

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.

This GitHub-blob exclude is taken verbatim from the dev-site lychee config and is intentionally narrow — it only skips unverifiable blob/<sha>#L.. line-fragment links. Branch-ref blob links are checked normally and resolve fine in these repos, so we kept the shared pattern.

— Claude (posted on Greg's behalf)

oschwald and others added 3 commits June 4, 2026 22:01
Part of STF-557.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- https://dev.maxmind.com/minfraud?lang=en -> https://dev.maxmind.com/minfraud/?lang=en (and the bare /minfraud variant -> /minfraud/)
- https://dev.maxmind.com/minfraud/api-documentation/requests?lang=en#... -> .../requests/?lang=en#... (trailing slash)
- https://dev.maxmind.com/minfraud/report-a-transaction?lang=en -> .../report-a-transaction/?lang=en (and bare variant -> trailing slash)
- https://dev.maxmind.com/minfraud/track-devices?lang=en -> .../track-devices/?lang=en
- https://dev.maxmind.com/minfraud/api-documentation/responses/schema--response--risk-score-reason--multiplier-reason -> .../responses/#schema--response--risk-score-reason--multiplier-reason (canonical fragment form)
- https://tools.ietf.org/html/rfc3339 -> https://datatracker.ietf.org/doc/html/rfc3339
- https://contributor-covenant.org -> https://www.contributor-covenant.org/
- https://opensource.org/licenses/MIT -> https://opensource.org/license/MIT
- https://www.maxmind.com/en/support -> https://support.maxmind.com/knowledge-base

Also excludes the JS-rendered responses-page fragment from lychee, since the
schema anchor is injected client-side and absent from the static HTML.

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>
@horgh horgh merged commit 38e0e9f into main Jun 5, 2026
38 checks passed
@horgh horgh deleted the greg/stf-557 branch June 5, 2026 21:27
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.

2 participants