Repository navigation
MAINT: Stop busy servers from failing the docs link check - #4772
Merged
Roman Lutz (romanlutz) merged 8 commits intoDec 2, 2026
Merged
Roman Lutz (romanlutz) merged 8 commits into
Roman Lutz (romanlutz) merged 8 commits into
Conversation
The build-book link check failed about 15% of pull request runs because github.com answered link fetches with 503 in bursts that outlast the single retry. - docs.yml: after the retry, pass with a warning when every remaining error is a link that answered 429 or 5xx. A 404, a link with no response, or a broken local reference still fails. - validate_docs: check links to this repository's main branch against the checkout, so a change that moves or deletes a linked file fails before it merges. myst.yml exempts those links from the network check. - docs_links.yml: nightly run with no tolerance that retries over 45 minutes and files an issue listing the links still unresolved. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The retry, the 429/5xx classification and the nightly issue filing were inline shell in docs.yml and docs_links.yml. They now live in build_scripts/check_docs_links.py, which both workflows call in one line: - docs.yml: --tolerate-busy - docs_links.yml: --attempts 4 --delay 900 --file-issue Unit tests cover the classifier, the retry loop and the choice between creating the tracking issue and commenting on it. The workflow tests now only pin how each workflow invokes the script. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Skipping .ipynb content leaves notebook-only and saved-output links unchecked, allowing missing repository targets to pass both validation workflows.
1 open issue
What changed in this PR
This PR reduces documentation build failures caused by busy external servers while keeping broken-link checks blocking and reporting persistent failures nightly.
Changes:
- Centralizes link checking and retries, tolerating only HTTP 429 or 5xx failures after retry.
- Adds checkout-based validation for repository-main links and exempts them from network checks.
- Adds a strict nightly workflow with issue reporting, unit tests, and contributor guidance.
| File | Description |
|---|---|
tests/unit/build_scripts/test_validate_docs.py |
Tests checkout-based repository link validation. |
tests/unit/build_scripts/test_docs_workflow.py |
Checks workflow commands and nightly permissions. |
tests/unit/build_scripts/test_docs_build_contract.py |
Checks repository-link network exemptions. |
tests/unit/build_scripts/test_check_docs_links.py |
Tests classification, retries, output capture, and issue reporting. |
doc/myst.yml |
Exempts repository-main links from network validation. |
doc/contributing/7_notebooks.md |
Explains link-check tolerance and nightly reporting. |
build_scripts/validate_docs.py |
Checks repository-main link targets against the checkout. |
build_scripts/check_docs_links.py |
Implements retries, busy-response handling, and issue reporting. |
.github/workflows/docs.yml |
Uses the shared checker with busy-response tolerance. |
.github/workflows/docs_links.yml |
Adds strict nightly checks and issue reporting. |
Review effort: Balanced
…lures-followup-fe3bdb
YouTube gave the CI link check no response for this video on both attempts, and answered 429 on a main run. The video is live: its oEmbed lookup returns 200 with the matching title. Exempt only this URL, as is already done for the other YouTube link in the docs. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The docs site is built from the .ipynb files, which can differ from their paired .py and carry links in saved outputs. Those links are exempt from the network check, so validate_docs now reads notebooks too. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Richard Lundeen (richlundeen)
approved these changes
Dec 1, 2026
Richard Lundeen (richlundeen)
left a comment
Contributor
There was a problem hiding this comment.
Automated review completed. No blocking concerns remain. This review records source coverage; merging is handled separately.
- Stream the build output line by line instead of printing it after the build exits, so a hung or slow attempt still leaves a log. - Leave gh's stderr uncaptured, so a failed issue call shows its reason. - Look up the tracking issue only among issues filed by github-actions. - Pin the MyST theme in the nightly workflow, as docs.yml does. pin_docs_theme takes --slug to read the template from docs-versions.yml. - Make the parser test fixture include the line MyST prints when it finds an error, so loosening the summary anchor fails the tests. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The child's deadline only guards against a hang. A fixed 30 seconds could fail the test on a busy worker even though the output was streamed. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Richard Lundeen (richlundeen)
approved these changes
Dec 1, 2026
genai.owasp.org answered 403 on five links for a few minutes, which failed this PR's run and a main run at the same time, then recovered. A 403 says the server refused the checker, not that the page is gone; every 403 exemption already in doc/myst.yml is bot protection. The PR check now passes with a warning when every remaining error is a link that answered 403, 429 or 5xx. The option is renamed from --tolerate-busy to --tolerate-unverified to match. A 401, a 404, a link with no response and a broken local reference still fail, and the nightly run still reports links that stay forbidden. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Roman Lutz (romanlutz)
deleted the
claude/build-book-failures-followup-fe3bdb
branch
December 2, 2026 07:47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Description
The
build-booklink check failed about 15% of pull request runs between 24 and 30 Nov (68 of 444), and it also blocked docs deploys onmain. Every failure I opened was github.com answering link fetches with503 Service Unavailable, in bursts that outlast the single 30-second retry from #4478. This PR stops a busy server from failing the check while keeping real broken links fatal.genai.owasp.organswered 403 on five links for a few minutes and failed this PR's run and amainrun together.build_scripts/validate_docs.pynow resolves everymicrosoft/PyRIT/blob|tree/main/...link indocand inpyritdocstrings against the working tree, anddoc/myst.ymlexempts those links from the network check. Fetching them testedmain, not the change: a PR that moved a linked file passed and brokemainafterwards. The validator runs in the requiredpre-commitcheck, including in the merge queue.docs-linksworkflow runs the same check with no tolerance, retries four times over 45 minutes, and creates or comments on one issue listing the links that are still unresolved.build_scripts/check_docs_links.py; both workflows call it in one line.mainrun. The video is live (its oEmbed lookup returns 200), sodoc/myst.ymlexempts that one URL, as it already does for the other YouTube link.Replaying the final attempt of two failed runs from 30 Nov: each had 9 errors, all 503s, so both would now pass with a warning. Four and five of those nine were links into this repository, which are no longer fetched at all.
Two things to know when reviewing:
main, so itsghcalls are covered only by unit tests withghmocked.🤖 Generated with Claude Code