-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
linkcheck: replace 'linkcheck_allowed_redirects' default sentinel with boolean false value #13483
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
Open
jayaddison
wants to merge
13
commits into
sphinx-doc:master
Choose a base branch
from
jayaddison:issue-13462/fix-linkcheck-theme-regression-when-allow-redirects-is-none
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
…-when-allow-redirects-is-none
…-allow-redirects value
…-closely-resemble existing defaults
FWIW this PR turns our downstream job from red to green: astropy/sphinx-astropy#82 Thanks! |
Thank you @pllim for testing it :) |
…-when-allow-redirects-is-none
Can we merge this please, so I don't keep getting the failing cron notifications 😄 ? |
@AA-Turner ping for possible code review? |
jayaddison
commented
Jun 2, 2025
jayaddison
commented
Jun 2, 2025
This comment was marked as resolved.
This comment was marked as resolved.
…-when-allow-redirects-is-none
…ts, per code self-review Partially reverts commit 5afe46d.
This comment was marked as resolved.
This comment was marked as resolved.
…-when-allow-redirects-is-none
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.
Purpose
Patches the
linkcheck
module so thatlinkcheck_allowed_redirects
is never assigned a value ofNone
-- this was failing to typecheck against the allowed values for the config value when HTML themes were enabled (ref: #13462).Specifically: this pull request updates the default value of
linkcheck_allowed_redirects
from the previous sentinel value to a new value ofFalse
.Linkchecking and allowed redirections behaviour
When the linkcheck builder follows a hyperlink that redirects, the link is considering
working
when either of the following occur:linkcheck_allowed_redirects
.All other redirects are reported with the
redirected
status code.When
linkcheck_allowed_redirects
is configured -- e.g. set to any other value than the default ofFalse
-- hyperlinks that encounter redirects with no matching matching {origin, destination} pattern pair in the configuration value also emit a warning-level log message.References
linkcheck_allowed_redirects
is non-empty #13439.Edit: possible-values in this description requires redrafting; add a todo placeholder.
Edit: update proposed config value behaviours.
Edit: invert default value (was: true; now: false).
Edit: attempt to clarify this description.
Edit: describe the change-in-behaviour nearer the start of this description, reformat a few elements, and attempt to communicate the logic more clearly.
Edit: a correction about the existing default config value (sentinel), and a clarification about the described conditions under which redirected hyperlinks are considered working.