Releases pages link and (optionally) forward to latest versions#446
Open
stockholmux wants to merge 5 commits intovalkey-io:mainfrom
Open
Releases pages link and (optionally) forward to latest versions#446stockholmux wants to merge 5 commits intovalkey-io:mainfrom
stockholmux wants to merge 5 commits intovalkey-io:mainfrom
Conversation
Signed-off-by: Kyle J. Davis <kyledvs@amazon.com>
Signed-off-by: Kyle J. Davis <kyledvs@amazon.com>
Signed-off-by: Kyle J. Davis <kyledvs@amazon.com>
Signed-off-by: Kyle J. Davis <kyledvs@amazon.com>
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.
Description
Release pages provide a stable URL to point to a version of the software. For example,
/download/releases/v7-2-5/will always have things like the GitHub tag, release date, and artifact links.In the past, there has been situations where we've made a major release, found a bug, and did a fast-followed with a patch release to fix it. However, the blog post for that release still points to the release page for the original release, obscuring a bug fix. This has two issues:
This PR adds a few things around this problem:
Release pages have an
Available updatessection.On each release page, there is section that advises about updates/upgrades, linking to the release pages for each.
The script only shows the relevant updates for each version. As an example, 7.2.11 doesn't show 8.x releases, only the latest major:
On pages which don't have any updates, the section isn't present.
URL hash and forwards
To directly fix #428, this PR adds an optional hash tag to the URL. If you add
#latest_patch,#latest_minoror#latest_majorto any release page (e.g./download/releases/v7-2-5/) it will do a javascript forward to the respective latest version. For example:/download/releases/v7-2-5/#latest_patch->/download/releases/v7-2-11//download/releases/v8-0-0/#latest_minor->/download/releases/v8-1-5//download/releases/v8-1-5/#latest_major->/download/releases/v9-0-1/If there isn't new latest for the different hash tags, it's a noop:
/download/releases/v9-0-1/#latest_patchdoes nothing. So, for release blogs, we can safely use URLs likedownload/releases/v9-0-0/#latest_patchand users will automatically get the latest patch version. No more obscured releases!Release candidates are excluded from this logic.
Bug fixes
In writing this feature, I noticed a bug where the multiple releases fragments on the same page (such as on the homepage or
/downloads/) misreported the release date for all releases as the first listed. 🤦♂️ This is a subtle bug because this often but not always the case.I additionally tested what 10.0.0 would look like and discovered that, in some context 10.0.0 appeared in the wrong order. Now it's explicitly uses date sorting - the most recent & version numbers are used and 10.0.0 will come out on top.
Refactoring
I moved the release fragment from being a zola include to being a macro. This isolates the scope better to prevent the release date bug as above and actually makes the code a little cleaner.
Issues Resolved
#428
Check List
--signoffBy submitting this pull request, I confirm that my contribution is made under the terms of the BSD-3-Clause License.