Skip to content

Don't linkcheck external web links in PR CI #2296

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 19, 2025

Conversation

jieyouxu
Copy link
Member

@jieyouxu jieyouxu commented Mar 19, 2025

This can block PR CI yet remain unactionable for the contributor, since this is subject to network conditions and availability of the servers hosting the external web links.

I don't see a way for PR CI to override the linkcheck config to skip external web links yet let the cron job CI to perform external web link checks, so this PR does the sledgehammer approach of disabling external web link checks for both. EDIT: apparently MDBOOK_OUTPUT__LINKCHECK__FOLLOW_WEB_LINKS is a thing.

book.toml Outdated
Comment on lines 31 to 54
exclude = [
"crates\\.io",
"gcc\\.godbolt\\.org",
"youtube\\.com",
"youtu\\.be",
"dl\\.acm\\.org",
"cs\\.bgu\\.ac\\.il",
"www\\.amazon\\.com",
"www\\.rustaceans\\.org",
"play\\.rust-lang\\.org",
"tomlee\\.co",
"marketplace\\.visualstudio\\.com",
"objects\\.githubusercontent\\.com",
# The bug listing URL works only if an user is logged in, otherwise one gets 404.
"github\\.com/issues\\?q=.*",
# Similarly 500 is sometimes returned here.
"github\\.com/rust-lang/rust/pulls\\?q=.*",
# 401 is returned here for unknown reason
"github\\.com/wesleywiser/rustc-bootstrap-wpa-analysis",
# Handle: connection closed before message completed
"microsoft\\.com/en-us/research/publication/",
# 500 is returned for HEAD request
"code\\.visualstudio\\.com/docs/editor/tasks",
]
Copy link
Member Author

Choose a reason for hiding this comment

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

This long list of excludes to me suggests that it's not good in terms of signal-to-noise ratio, because we're already skipping the (arguably most import) github links (issues, PRs, commits, etc.).

@jieyouxu jieyouxu added S-waiting-on-review Status: this PR is waiting for a reviewer to verify its content A-linkcheck Area: linkcheck WG-rustc-dev-guide Working group: rustc-dev-guide labels Mar 19, 2025
@Kobzol
Copy link
Contributor

Kobzol commented Mar 19, 2025

We can set MDBOOK_OUTPUT__LINKCHECK__FOLLOW_WEB_LINKS=false in the non-cron job to disable external web link checks.

(But I'm also fine with disabling it altogether, tbh. Up to you).

@jieyouxu jieyouxu force-pushed the no-external-linkcheck branch from 98d7c48 to 5d91437 Compare March 19, 2025 07:35
@jieyouxu jieyouxu changed the title Don't linkcheck external web links Don't linkcheck external web links in PR CI / locally Mar 19, 2025
@jieyouxu
Copy link
Member Author

Actually, I'll skip for PR CI only for now.

@jieyouxu jieyouxu force-pushed the no-external-linkcheck branch from 5d91437 to c9210de Compare March 19, 2025 07:39
@jieyouxu jieyouxu changed the title Don't linkcheck external web links in PR CI / locally Don't linkcheck external web links in PR CI Mar 19, 2025
@jieyouxu jieyouxu force-pushed the no-external-linkcheck branch from c9210de to 637ad77 Compare March 19, 2025 07:45
@Kobzol
Copy link
Contributor

Kobzol commented Mar 19, 2025

Can you try to commit a change to some random MD that contains a non-existent third-party URL? It has to start with http/https.

@jieyouxu
Copy link
Member Author

💀

@jieyouxu
Copy link
Member Author

Oh is it because this shell script is a wrapper around the linkchecker not mdbook... IDK

@jieyouxu jieyouxu force-pushed the no-external-linkcheck branch from 8301c7e to aa73732 Compare March 19, 2025 09:24
@jieyouxu jieyouxu force-pushed the no-external-linkcheck branch from aa73732 to 531e5f9 Compare March 19, 2025 09:25
@jieyouxu
Copy link
Member Author

(Looks like that works)

@jieyouxu jieyouxu merged commit eabec32 into rust-lang:master Mar 19, 2025
1 check passed
@jieyouxu jieyouxu deleted the no-external-linkcheck branch March 19, 2025 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linkcheck Area: linkcheck S-waiting-on-review Status: this PR is waiting for a reviewer to verify its content WG-rustc-dev-guide Working group: rustc-dev-guide
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants