-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
linkcheck: Fix 'linkcheck_allowed_redirects' sentinel #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
linkcheck: Fix 'linkcheck_allowed_redirects' sentinel #13483
Conversation
…-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? |
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
Can we get this merged please? the |
…-when-allow-redirects-is-none
@jayaddison sorry for the delay. I kept the sentinel but fixed the underlying problem. @bsipocz please could you see if this fixes the problems for astropy? A |
@AA-Turner - Actually, this fixed both of the issues we saw in the most recent runs. Thank you! |
Thank you @AA-Turner @bsipocz! From a brief glance earlier, I have a feeling that one of those failures may be an intermittent intersphinx problem unrelated to these changes - it's good if it appears to have gone away, but I'd (personally) stay on the lookout for it reoccurring. I hadn't gotten to the stage of trying to figure out how/why it occurs, though. |
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).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.
Edit: in the final merged result, a sentinel value is retained; update the description accordingly.