fix: remap dead hg.python.org release-notes URLs to GitHub equivalents#2965
Open
nagasrisai wants to merge 3 commits intopython:mainfrom
Open
fix: remap dead hg.python.org release-notes URLs to GitHub equivalents#2965nagasrisai wants to merge 3 commits intopython:mainfrom
nagasrisai wants to merge 3 commits intopython:mainfrom
Conversation
Adds a corrected_release_notes_url property to the Release model that converts old Mercurial-hosted URLs (hg.python.org, now unreachable) to their equivalent paths on GitHub, so legacy release pages still have working changelog links. Closes python#2865
Use the new corrected_release_notes_url property so that legacy hg.python.org links are converted to GitHub URLs before rendering. Also guard the anchor so it degrades gracefully when the URL is empty.
Covers hg URL conversion, https variant, modern URLs left unchanged, and empty URL passthrough.
Author
|
@JacobCoffee @ewdurbin @sethmlarson — could one of you take a look when you get a chance? This fixes the broken release notes links on the downloads page for older Python releases. No migration needed. Thanks! |
Author
|
Looks like the Actions workflows need maintainer approval to run since this is coming from a fork — it's the first contribution from this account. Could @JacobCoffee or @ewdurbin approve the three workflow runs (CI, Lint, Check collectstatic) when you get a chance? The links are in the Checks tab on this PR. Thanks! |
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
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.
The "Release notes" links on the downloads page for Python 3.3.6 and earlier are broken — they point to hg.python.org which was retired and now returns 404.
Added a
corrected_release_notes_urlproperty to theReleasemodel that checks whether a stored URL points to hg.python.org and, if so, remaps it to the equivalent path on GitHub. For example,http://hg.python.org/cpython/file/v3.3.6/Misc/NEWSbecomeshttps://github.com/python/cpython/blob/v3.3.6/Misc/NEWS. The database field itself is left untouched so no migration is needed.Also updated the downloads index template to use the corrected URL, and added a guard so releases with no URL at all render as plain text rather than an empty anchor.
Four tests added to
ReleaseNotesURLTestscovering the http and https hg variants, a modern URL that should pass through unchanged, and an empty URL.Closes #2865