ci(docs): add test to check urls are valid #102
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds automated link checking for documentation using
linkchecker
to ensure all URLs are valid and not broken.Implementation
linkchecker
dependency topyproject.toml
dev dependenciestests/test_docs_links.py
with comprehensive link validation teststest_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
uv run --group docs mkdocs build
site/
directoryCI Integration
The link checking test integrates seamlessly with the existing CI pipeline:
uv run pytest
in CI--no-warnings
,--timeout 10
,--recursion-level 2
)Benefits
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
curl -LsSf REDACTED
(dns block)discord.gg
/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
/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
/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
/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
/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
/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
/home/REDACTED/work/timecopilot/timecopilot/.venv/bin/python /home/REDACTED/work/timecopilot/timecopilot/.venv/bin/pytest --collect-only
(dns block)img.shields.io
/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
/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
/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.