Skip to content

fix(ci): retry flaky documentation link checks - #12746

Merged
nv-anants merged 3 commits into
ai-dynamo:mainfrom
xianlubird:bug/lychee-connect-retry
Aug 7, 2026
Merged

fix(ci): retry flaky documentation link checks#12746
nv-anants merged 3 commits into
ai-dynamo:mainfrom
xianlubird:bug/lychee-connect-retry

Conversation

@xianlubird

@xianlubird xianlubird commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Run the full lychee documentation link check one additional time after a failed first attempt.
  • Remove failed entries from .lycheecache before retrying so the second attempt performs real network requests instead of replaying cached errors.
  • Reuse one anchored argument block for both lychee attempts.
  • Keep the retry strict: a second failure is propagated normally and still fails the workflow.

Background

PR #12741 exposed two independent transient failures in the repository-wide documentation link check. The first run reported HTTP 500/502 responses for existing GitHub pull request links. A new commit retriggered the workflow, but the next run failed on a different existing URL—the Kubernetes Ingress documentation—with a connection error. That URL returned HTTP 200 immediately when checked again.

The workflow already configures lychee with four request retries and a 30-second request timeout. However, lychee v0.24.2 does not classify ordinary connection errors as retryable, so --max-retries does not protect this case. Request-level retries can also be exhausted when an external host remains temporarily unhealthy.

Implementation

The first lychee action records its real exit code without ending the job immediately. When that code is nonzero, the workflow parses the cache status field, keeps only statuses accepted by this workflow (2xx, 403, and 429), and runs the same complete lychee command again. Both attempts reference the same YAML-anchored argument block. The retry uses the action's normal fail: true behavior, so persistent broken links remain blocking.

This does not add any URL to .lycheeignore, accept connection errors, or use continue-on-error to make the job green.

Validation

  • pre-commit run check-yaml --files .github/workflows/docs-link-check.yml
  • actionlint v1.7.12 .github/workflows/docs-link-check.yml
  • cache status filtering with representative 2xx, 403, 429, 404, and comma-containing URL records
  • git diff --check

Summary by CodeRabbit

  • Bug Fixes
    • Improved documentation link checks by retrying after clearing unsuccessful cached results.
    • Workflows now fail only when link issues persist after the retry.

Signed-off-by: xianlubird <xianlubird@gmail.com>
@copy-pr-bot

copy-pr-bot Bot commented Aug 6, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@xianlubird
xianlubird temporarily deployed to external_collaborator August 6, 2026 07:23 — with GitHub Actions Inactive
@xianlubird
xianlubird temporarily deployed to external_collaborator August 6, 2026 07:23 — with GitHub Actions Inactive
@dynamo-ops

Copy link
Copy Markdown
Contributor

/ok to test ee60c9d

@github-actions github-actions Bot added fix actions external-contribution Pull request is from an external contributor trusted-contributor Org-External user who is trusted to run CI without Org-member approval labels Aug 6, 2026
@xianlubird
xianlubird marked this pull request as ready for review August 6, 2026 07:24
@xianlubird
xianlubird requested a review from a team as a code owner August 6, 2026 07:24

@devin-ai-integration devin-ai-integration Bot left a comment

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.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The documentation workflow now captures the first lychee check result without failing immediately. If the check fails, it removes unsuccessful cache entries and runs a second check that can fail the job.

Changes

Documentation link validation

Layer / File(s) Summary
Retry failed link checks
.github/workflows/docs-link-check.yml
The workflow records the initial lychee exit code, cleans unsuccessful cache entries after failure, and runs a conditional retry with failure enabled.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the implementation and validation, but it omits the required Related Issues section and the reviewer-start section. Add the required Related Issues section and confirm either the linked issue number or that no related issue exists; identify where reviewers should start.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the main change: retrying flaky documentation link checks in CI.

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

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.

🧹 Nitpick comments (1)
.github/workflows/docs-link-check.yml (1)

59-60: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Make cache cleanup status-aware.

Line 59 matches any ,2xx, substring in the full cache line. A URL containing ,200, can preserve an entry whose actual status is an error, so the retry can reuse stale data. Lychee stores URL/status/timestamp records and does not normally persist CacheStatus::Error entries. (lychee.cli.rs)

Remove this shell rewrite, or parse the status field directly. Preserve the statuses that --accept treats as valid.

Suggested fix
-            grep -E ',2[0-9]{2},' .lycheecache > .lycheecache.tmp || true
+            awk -F',' '$(NF-1) ~ /^(2[0-9][0-9]|403|429)$/ { print }' \
+              .lycheecache > .lycheecache.tmp
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/docs-link-check.yml around lines 59 - 60, Remove the
grep/mv cache rewrite in the docs link-check workflow, or replace it with
parsing that validates the cache record’s actual status field rather than
matching any URL substring. Preserve only entries whose status is accepted by
the workflow’s --accept configuration, ensuring error-status records cannot be
reused.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In @.github/workflows/docs-link-check.yml:
- Around line 59-60: Remove the grep/mv cache rewrite in the docs link-check
workflow, or replace it with parsing that validates the cache record’s actual
status field rather than matching any URL substring. Preserve only entries whose
status is accepted by the workflow’s --accept configuration, ensuring
error-status records cannot be reused.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: a4baf2ec-52b3-496c-8bd5-36b4cbf31f71

📥 Commits

Reviewing files that changed from the base of the PR and between 80865c9 and ee60c9d.

📒 Files selected for processing (1)
  • .github/workflows/docs-link-check.yml

@datadog-official

This comment has been minimized.

@xianlubird

Copy link
Copy Markdown
Contributor Author

Looks like the SGLang failure is unrelated to this PR—the tests all passed, but the self-hosted runner hit a container error afterward.

The new lychee retry worked as expected: the first check timed out on an external link, then the retry passed.
A rerun of the failed SGLang job should be enough.

Comment thread .github/workflows/docs-link-check.yml Outdated
Signed-off-by: xianlubird <xianlubird@gmail.com>
@xianlubird
xianlubird temporarily deployed to external_collaborator August 7, 2026 00:46 — with GitHub Actions Inactive
@dynamo-ops

Copy link
Copy Markdown
Contributor

/ok to test cb319b0

@xianlubird

Copy link
Copy Markdown
Contributor Author

The sglang-runtime / Test cuda13.0, amd64 (push) failed and the failure is unrelated to the content of this PR.

@rmccorm4
rmccorm4 temporarily deployed to external_collaborator August 7, 2026 06:35 — with GitHub Actions Inactive
@dynamo-ops

Copy link
Copy Markdown
Contributor

/ok to test 7dc91f4

@nv-anants
nv-anants merged commit 17c8f26 into ai-dynamo:main Aug 7, 2026
109 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

actions external-contribution Pull request is from an external contributor fix size/M trusted-contributor Org-External user who is trusted to run CI without Org-member approval

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants