Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jul 14, 2025

Adds automated link checking for documentation using linkchecker to ensure all URLs are valid and not broken.

Implementation

  • Added linkchecker dependency to pyproject.toml dev dependencies
  • Created tests/test_docs_links.py with comprehensive link validation tests
  • Two test functions:
    • test_docs_links_are_valid() - Validates internal links only (CI-friendly)
    • test_docs_external_links_are_valid() - Validates both internal and external links (may skip in CI due to network restrictions)

How it works

  1. Builds documentation using uv run --group docs mkdocs build
  2. Runs linkchecker on the generated site/ directory
  3. Validates results and fails test if broken links are found
  4. Focuses on internal links for CI stability while providing comprehensive external link checking

CI Integration

The link checking test integrates seamlessly with the existing CI pipeline:

  • Runs automatically as part of uv run pytest in CI
  • Uses appropriate flags for CI stability (--no-warnings, --timeout 10, --recursion-level 2)
  • Internal link test passes reliably, external link test handles network restrictions gracefully

Benefits

  • Early detection of broken links before deployment
  • Automated validation as part of test suite
  • CI-friendly with separate internal/external link checking
  • Comprehensive coverage of documentation quality

Fixes #95.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • astral.sh
    • Triggering command: curl -LsSf REDACTED (dns block)
  • discord.gg
    • Triggering command: /usr/bin/python /home/REDACTED/.local/bin/linkchecker --check-extern --no-warnings --output text --file-output text//tmp/tmpwduftb5b.txt --recursion-level 2 --timeout 10 /home/REDACTED/work/timecopilot/timecopilot/site/index.html (dns block)
  • docs.astral.sh
    • Triggering command: /usr/bin/python /home/REDACTED/.local/bin/linkchecker --check-extern --no-warnings --output text --file-output text//tmp/tmpwduftb5b.txt --recursion-level 2 --timeout 10 /home/REDACTED/work/timecopilot/timecopilot/site/index.html (dns block)
  • docs.google.com
    • Triggering command: /usr/bin/python /home/REDACTED/.local/bin/linkchecker --check-extern --no-warnings --output text --file-output text//tmp/tmpwduftb5b.txt --recursion-level 2 --timeout 10 /home/REDACTED/work/timecopilot/timecopilot/site/index.html (dns block)
  • fonts.googleapis.com
    • Triggering command: /usr/bin/python /home/REDACTED/.local/bin/linkchecker --check-extern --no-warnings --output text --file-output text//tmp/tmpwduftb5b.txt --recursion-level 2 --timeout 10 /home/REDACTED/work/timecopilot/timecopilot/site/index.html (dns block)
  • fonts.gstatic.com
    • Triggering command: /usr/bin/python /home/REDACTED/.local/bin/linkchecker --check-extern --no-warnings --output text --file-output text//tmp/tmpwduftb5b.txt --recursion-level 2 --timeout 10 /home/REDACTED/work/timecopilot/timecopilot/site/index.html (dns block)
  • github-production-user-asset-6210df.s3.amazonaws.com
    • Triggering command: /usr/bin/python /home/REDACTED/.local/bin/linkchecker --check-extern --no-warnings --output text --file-output text//tmp/tmpwduftb5b.txt --recursion-level 2 --timeout 10 /home/REDACTED/work/timecopilot/timecopilot/site/index.html (dns block)
  • huggingface.co
    • Triggering command: /home/REDACTED/work/timecopilot/timecopilot/.venv/bin/python /home/REDACTED/work/timecopilot/timecopilot/.venv/bin/pytest --collect-only (dns block)
  • img.shields.io
    • Triggering command: /usr/bin/python /home/REDACTED/.local/bin/linkchecker --check-extern --no-warnings --output text --file-output text//tmp/tmpwduftb5b.txt --recursion-level 2 --timeout 10 /home/REDACTED/work/timecopilot/timecopilot/site/index.html (dns block)
  • squidfunk.github.io
    • Triggering command: /usr/bin/python /home/REDACTED/.local/bin/linkchecker --check-extern --no-warnings --output text --file-output text//tmp/tmpwduftb5b.txt --recursion-level 2 --timeout 10 /home/REDACTED/work/timecopilot/timecopilot/site/index.html (dns block)
  • timecopilot.dev
    • Triggering command: /usr/bin/python /home/REDACTED/.local/bin/linkchecker --check-extern --no-warnings --output text --file-output text//tmp/tmpwduftb5b.txt --recursion-level 2 --timeout 10 /home/REDACTED/work/timecopilot/timecopilot/site/index.html (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI and others added 2 commits July 14, 2025 21:18
Co-authored-by: AzulGarza <10517170+AzulGarza@users.noreply.github.com>
Co-authored-by: AzulGarza <10517170+AzulGarza@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] ci(docs): add test to check urls are valid ci(docs): add test to check urls are valid Jul 14, 2025
@Copilot Copilot AI requested a review from AzulGarza July 14, 2025 21:22
Copilot finished work on behalf of AzulGarza July 14, 2025 21:22
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.

ci(docs): add test to check urls are valid

2 participants