Skip to content

feat: migrate from markdown-link-check to lychee#5519

Merged
max-sixty merged 2 commits intoPRQL:mainfrom
max-sixty:migrate-to-lychee
Oct 20, 2025
Merged

feat: migrate from markdown-link-check to lychee#5519
max-sixty merged 2 commits intoPRQL:mainfrom
max-sixty:migrate-to-lychee

Conversation

@max-sixty
Copy link
Copy Markdown
Member

Summary

Migrates all link checking from markdown-link-check to lychee to solve transient network failures in CI.

Fixes #5511 - The nightly CI failure where gohugo.io was unreachable due to network errors. markdown-link-check only retries HTTP 429 (rate-limiting) errors, while lychee retries all network errors (timeouts, DNS failures, connection errors).

Changes

CI Workflow (.github/workflows/tests.yaml)

  • Replaced markdown-link-check GitHub Action with lychee via pre-commit
  • Uses baptiste0928/cargo-install@v3 for installation (existing CI pattern)
  • Added cache for .lycheecache to speed up runs
  • Two-tier approach maintained:
    • PRs: Check modified files only with whitelist filter
    • Nightly: Check all files with comprehensive external link checking

Pre-commit Hooks (.pre-commit-config.yaml)

  • Two hooks: lychee (PR/local) and lychee-all (nightly/manual)
  • Uses language: rust with additional_dependencies: ["cli:lychee:0.20.1"] for auto-installation
  • Whitelist approach: --include pattern checks only PRQL domains + local files for PRs
    • github.com/PRQL/* and github.com/prql/*
    • prql-lang.org/*
    • raw.githubusercontent.com/PRQL/* and raw.githubusercontent.com/prql/*
    • file:// (local/relative links)

Configuration (.config/lychee.toml)

  • Single config file with retry settings (5 retries, 30s delay)
  • Excludes problematic sites (Twitter, Stack Overflow, repology.org, etc.)
  • Enables caching (1 day TTL)

Cleanup

  • Deleted old .config/.markdown-link-check-all.json
  • Deleted old .config/.markdown-link-check-local.json
  • Added .lycheecache to .gitignore

Benefits

  1. Solves the original problem: Retries network errors, not just rate-limiting
  2. Faster: Rust-based vs Node.js
  3. Caching: Reduces load on external sites, speeds up repeated checks
  4. Cleaner config: Whitelist pattern is more explicit than exclude lists
  5. Active maintenance: lychee is actively developed and well-maintained

Test Plan

  • Pre-commit hooks tested locally
  • Whitelist pattern verified (checks 18 PRQL links, skips external)
  • Full config tested with lychee-all hook
  • CI validation on this PR
  • Monitor nightly runs for stability

🤖 Generated with Claude Code

max-sixty and others added 2 commits October 20, 2025 16:19
Migrates all link checking from markdown-link-check to lychee to solve
transient network failures in CI. markdown-link-check only retries HTTP
429 (rate-limiting) errors, while lychee retries all network errors
(timeouts, DNS failures, connection errors).

Fixes PRQL#5511 - gohugo.io link check failures due to network errors

Changes:
- Replace markdown-link-check GitHub Action with lychee via pre-commit
- Use whitelist approach (--include) for PR checks: only PRQL domains + local files
- Single config file (.config/lychee.toml) for nightly/comprehensive checks
- Auto-install lychee via pre-commit's language: rust feature
- Add lychee cache in CI for faster runs
- Delete old markdown-link-check config files

Benefits:
- Solves transient network failures with comprehensive retry logic
- Faster link checking (Rust-based vs Node.js)
- Built-in caching reduces external site load
- Cleaner configuration with whitelist pattern

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
pre-commit.ci doesn't support network access and lacks OpenSSL dev
headers needed to compile lychee. Skip both lychee hooks in CI config.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@max-sixty max-sixty merged commit ddd9b79 into PRQL:main Oct 20, 2025
41 checks passed
@max-sixty max-sixty deleted the migrate-to-lychee branch October 20, 2025 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nightly tests failed

1 participant