Skip to content

Validate and update links (STF-557)#444

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

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

Conversation

@oschwald
Copy link
Copy Markdown
Member

@oschwald oschwald commented Jun 4, 2026

Validated every link in the repository with lychee (max_redirects = 0, so any redirect surfaces as an error) and updated those that were out of date or redirecting.

CI setup

  • Added lychee.toml tuned for this C library (Markdown docs + C sources/headers; excludes vendored submodules, the t/ test harness, build/generated dirs, the Hugo site output, and the Changes.md changelog).
  • Added a Links GitHub Actions workflow (.github/workflows/links.yml) that runs on push, pull request, weekly schedule, and manual dispatch; opens an issue on scheduled failures.
  • Added .lycheecache to .gitignore.

Link fixes

README.dev.md

  • https://help.launchpad.net/Packaging/PPA -> https://documentation.ubuntu.com/launchpad/user/Packaging/PPA/
  • https://github.com/Homebrew/homebrew-core/edit/master/Formula/libmaxminddb.rb -> https://github.com/Homebrew/homebrew-core/blob/main/Formula/lib/libmaxminddb.rb (formula relocated under Formula/lib/, default branch renamed master -> main; the original /edit/ URL also forced a login redirect, so the blob page is used and the surrounding "Edit the file" instruction still applies)

README.md

  • https://ports.macports.org/port/libmaxminddb -> https://ports.macports.org/port/libmaxminddb/ (trailing slash)

No changelog entries were modified.

Final lychee result

26 Total, 22 OK, 0 Errors, 4 Excluded

Part of STF-557.

🤖 Generated with Claude Code

Comment thread .github/workflows/links.yml Fixed
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 configures the Lychee link checker by adding a lychee.toml configuration file, ignoring .lycheecache in .gitignore, and updating several outdated URLs in the documentation. The review feedback suggests anchoring the regular expressions in exclude_path to prevent over-broad exclusions (such as 't/' matching any path containing t/) and removing HTTP 5xx status codes from the accept list to avoid silently ignoring permanently broken links.

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
Comment on lines +39 to +54
exclude_path = [
'\.git',
# Build / generated directories
'build',
'\.libs',
'autom4te\.cache',
'generated',
# Generated Hugo site output
'docs/public',
# Vendored submodules and test harness/fixtures
'maxmind-db',
't/libtap',
't/',
# Changelog: historical entries are preserved as-is, not rewritten
'Changes\.md',
]
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 regular expressions in exclude_path are unanchored, which can lead to accidental exclusions of valid files.

Specifically, 't/' matches any path containing the substring t/. This will exclude any directory or file path that ends with t followed by a slash, such as docs/content/, docs/layouts/, src/test/, or any path containing words like client/, asset/, project/, net/, etc. This silently disables link checking for a large portion of the repository.

Similarly, 'build' will match any path containing the word build (e.g., dev-bin/build-release.sh or any other file with build in its name).

To prevent these over-broad matches, anchor the regular expressions to the start of the path (^) and ensure directory boundaries are respected.

exclude_path = [
    '^\.git/',
    # Build / generated directories
    '^build/',
    '^\.libs/',
    '^autom4te\.cache/',
    '^generated/',
    # Generated Hugo site output
    '^docs/public/',
    # Vendored submodules and test harness/fixtures
    '^maxmind-db/',
    '^t/',
    # Changelog: historical entries are preserved as-is, not rewritten
    '^Changes\.md$',
]

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.

Fixed — the exclude_path patterns are now segment-anchored as (^|/)dir/, so short names like t no longer match unintended paths.

— 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 HTTP 5xx server errors (such as 500 Internal Server Error, 502 Bad Gateway, or 503 Service Unavailable) will be treated as successful checks.

While this prevents temporary server issues from failing the CI build, it also silently ignores permanently broken links where the hosting server is misconfigured or down.

Instead of accepting 5xx status codes globally, it is recommended to rely on Lychee's retry mechanism or exclude specific flaky domains if necessary.

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 oschwald force-pushed the greg/stf-557 branch 3 times, most recently from c936d5c to 75939a2 Compare June 4, 2026 20:36
oschwald and others added 2 commits June 4, 2026 22:01
Adds a lychee configuration and a Links GitHub Actions workflow so that
stale or redirecting links are caught automatically going forward. The
checker runs on push, pull request, and weekly to catch external link
rot. max_redirects is 0 so links that have moved are surfaced and can be
updated to their canonical destination.

The configured globs cover Markdown docs plus C sources and headers,
which is where links appear in this repository. Vendored submodules
(maxmind-db, t/libtap), the test harness under t/, build/generated
directories, the Hugo site output, and the Changes.md changelog are
excluded.

Part of STF-557.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Validated all links with lychee and updated those that redirected
elsewhere to their canonical destinations:

- help.launchpad.net/Packaging/PPA -> documentation.ubuntu.com
  /launchpad/user/Packaging/PPA/
- github.com/Homebrew/homebrew-core/edit/master/Formula/libmaxminddb.rb
  -> .../blob/main/Formula/lib/libmaxminddb.rb (formula relocated under
  Formula/lib/ and default branch is now main; "Edit the file" step still
  applies from the blob page)
- ports.macports.org/port/libmaxminddb -> .../libmaxminddb/ (trailing
  slash)

Part of STF-557.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Comment thread README.dev.md Outdated
register a GPG key with that account. You also need to be added to the MaxMind
team. Ask in the dev channel for someone to add you. See
https://help.launchpad.net/Packaging/PPA for more details.
https://documentation.ubuntu.com/launchpad/user/Packaging/PPA/ for more details.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[minor] Launchpad link points at a client-side redirect stub, not the canonical page Line 23: new URL https://documentation.ubuntu.com/launchpad/user/Packaging/PPA/ returns HTTP 200 with no Location header (so lychee max_redirects=0 passes), but the page body is a Read-the-Docs redirect stub: meta-refresh + window.location.href to a relative target that ultimately 302->200 at https://documentation.ubuntu.com/launchpad/user/reference/packaging/ppas/ppa/ ('Personal Package Archive - Launchpad manual', real PPA content). It works for a JS-enabled browser, but it's a hidden client-side redirect — exactly what this PR's max_redirects=0 policy is meant to surface and replace with a canonical URL. Recommend linking the canonical page directly: https://documentation.ubuntu.com/launchpad/user/reference/packaging/ppas/ppa/ (verified curl: 200, no redirect).

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.

Good catch — fixed in 29c3d32. Linked the canonical page directly (…/launchpad/user/reference/packaging/ppas/ppa/, verified 200 with no HTTP or client-side redirect). You're right that max_redirects = 0 only catches HTTP redirects, not the JS/meta-refresh stub.

— Claude (posted on Greg's behalf)

The previous URL (.../user/Packaging/PPA/) returns HTTP 200 but is a
client-side (JS/meta-refresh) redirect stub, so lychee's max_redirects=0 can't
see it. Point directly at the canonical page instead.

Part of STF-557.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@horgh horgh merged commit 5be7ab1 into main Jun 5, 2026
35 checks passed
@horgh horgh deleted the greg/stf-557 branch June 5, 2026 23:37
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.

3 participants