Skip to content

Add 502 to accepted status codes in .lychee.toml#1236

Merged
sbryngelson merged 1 commit intofix-docs-bugfrom
sbryngelson-patch-1
Feb 22, 2026
Merged

Add 502 to accepted status codes in .lychee.toml#1236
sbryngelson merged 1 commit intofix-docs-bugfrom
sbryngelson-patch-1

Conversation

@sbryngelson
Copy link
Copy Markdown
Member

@sbryngelson sbryngelson commented Feb 22, 2026

User description

Docs were occasionally spuriously failing before this...

Type of change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other: describe

Checklist

  • I added or updated tests for new behavior

CodeAnt-AI Description

Accept 502 responses as valid link status

What Changed

  • The link checker configuration now treats HTTP 502 responses as accepted, so links that return 502 are no longer flagged as broken.
  • This prevents transient or upstream 502 errors from causing documentation checks or link scans to fail.

Impact

✅ Fewer false broken-link reports
✅ Fewer CI documentation failures due to transient upstream errors
✅ More stable link validation results

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

Copilot AI review requested due to automatic review settings February 22, 2026 15:09
@codeant-ai
Copy link
Copy Markdown
Contributor

codeant-ai bot commented Feb 22, 2026

CodeAnt AI is reviewing your PR.


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 22, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sbryngelson-patch-1

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@sbryngelson sbryngelson merged commit feec9c6 into fix-docs-bug Feb 22, 2026
27 checks passed
@sbryngelson sbryngelson deleted the sbryngelson-patch-1 branch February 22, 2026 15:09
@codeant-ai codeant-ai bot added the size:XS This PR changes 0-9 lines, ignoring generated files label Feb 22, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Lychee link-checker configuration to reduce CI flakiness when external sites intermittently fail.

Changes:

  • Adds HTTP 502 to the global list of accepted status codes in .lychee.toml.

# Comma-separated list of accepted status codes for valid links.
# accept = ["200", "206", "403", "429"]
accept = ["200", "429"]
accept = ["200", "429", "502"]
Copy link

Copilot AI Feb 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding HTTP 502 to the global accept list will cause Lychee to treat upstream gateway/server errors as valid links, which can mask genuinely broken or consistently failing documentation URLs. Consider keeping accept to success/expected throttling codes (e.g., 200/429) and instead mitigate transient 502s by increasing retries/backoff or excluding the specific host(s) that intermittently return 502 (via exclude) so real link regressions are still caught.

Suggested change
accept = ["200", "429", "502"]
accept = ["200", "429"]

Copilot uses AI. Check for mistakes.
@codeant-ai
Copy link
Copy Markdown
Contributor

codeant-ai bot commented Feb 22, 2026

Sequence Diagram

The PR updates the link-checker config to accept HTTP 502 responses. The diagram shows the main success path where the link checker treats a 502 response as valid, preventing CI from marking the link as broken.

sequenceDiagram
    participant CI
    participant LinkChecker
    participant RemoteHost

    CI->>LinkChecker: Run link validation for docs
    LinkChecker->>RemoteHost: HTTP request for URL
    RemoteHost-->>LinkChecker: 502 Bad Gateway
    Note right of LinkChecker: .lychee.toml accepts 502 as valid
    LinkChecker-->>CI: Report URL as accepted (no failure)
Loading

Generated by CodeAnt AI

@codeant-ai
Copy link
Copy Markdown
Contributor

codeant-ai bot commented Feb 22, 2026

CodeAnt AI finished reviewing your PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files

Development

Successfully merging this pull request may close these issues.

2 participants