Skip to content

Fix link checker accepted status codes and base URL#736

Open
Zhengyizhe0209-arch wants to merge 2 commits into
QuantEcon:mainfrom
Zhengyizhe0209-arch:patch-1
Open

Fix link checker accepted status codes and base URL#736
Zhengyizhe0209-arch wants to merge 2 commits into
QuantEcon:mainfrom
Zhengyizhe0209-arch:patch-1

Conversation

@Zhengyizhe0209-arch
Copy link
Copy Markdown

Summary

This pull request updates the link checker configuration used by the scheduled workflow.

In issue #734, many successful 200 OK responses are reported as rejected status codes. This appears to be related to the current --accept 403,503 setting, which is too restrictive for normal successful HTTP responses.

The report also includes errors for root-relative links such as /_notebooks/... and /_pdf/..., which cannot be converted into URLs when checking local HTML files. This PR adds a base URL so that these links can be resolved against the deployed site.

Changes

  • Accept normal successful HTTP responses with 200..=299.
  • Keep the existing accepted 403 and 503 status codes.
  • Add --base-url https://intro.quantecon.org to resolve root-relative links.

Addresses #734.

Accept normal 2xx responses and resolve root-relative links against the deployed site.
@netlify
Copy link
Copy Markdown

netlify Bot commented May 14, 2026

Deploy Preview for taupe-gaufre-c4e660 ready!

Name Link
🔨 Latest commit 227ea0c
🔍 Latest deploy log https://app.netlify.com/projects/taupe-gaufre-c4e660/deploys/6a0c3dedf21ddc00082f0554
😎 Deploy Preview https://deploy-preview-736--taupe-gaufre-c4e660.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@mmcky mmcky requested a review from Copilot May 14, 2026 23:05
Copy link
Copy Markdown

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

This PR updates the scheduled link-checking workflow configuration to (1) treat normal successful HTTP responses as acceptable and (2) correctly resolve root-relative links found in locally checked HTML files by providing a deployment base URL.

Changes:

  • Expand accepted HTTP status codes to include 200..=299 (while keeping 403 and 503).
  • Add --base-url https://intro.quantecon.org so root-relative links (e.g., /_pdf/...) can be resolved during checks.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mmcky
Copy link
Copy Markdown
Contributor

mmcky commented May 19, 2026

Thanks for the contribution, @Zhengyizhe0209-arch! 👋

I had a look and this is a real fix, not a workaround:

  • --accept 200..=299,403,503: lychee's --accept replaces the default accepted set rather than adding to it, so the previous --accept 403,503 was inadvertently rejecting every 200 OK. The report in Link Checker Report #734 confirms this verbatim (Rejected status code: 200 OK (configurable with "accept" option)). Restoring 2xx is the correct fix.
  • --base-url https://intro.quantecon.org: the /_notebooks/... and /_pdf/... entries weren't broken — lychee couldn't construct a URL to check them at all. The base URL lets it resolve and actually verify them against the deployed site, which is strictly more checking than before.

LGTM 👍 — happy to merge. The next scheduled run (or a manual workflow_dispatch) should produce a much smaller, more honest report, and we can triage any genuine breakage from there.

@mmcky mmcky self-requested a review May 19, 2026 10:39
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.

3 participants