Skip to content
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

Fix version selection logic: Prioritize lexicographically larger release name for same release date #19183

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/current/_includes/version-switcher.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% assign DEBUG=false %}

{% comment %}Get the version of the page we are currently viewing{% endcomment %}
{% assign version = site.data.versions | where_exp: "v", "v.major_version == page.version.version" | sort: "release_date" | first %}
{% assign version = site.data.versions | where_exp: "v", "v.major_version == page.version.version" | sort: "release_date, release_name" | reverse | first %}
{% unless version %}Error: Could not get version details for version {{ page.version.version }}. Giving up.{% break %}{% endunless %}

{% comment %}Check whether the current page's version is released and if so, is LTS{% endcomment %}
Expand Down Expand Up @@ -35,7 +35,7 @@
{% for v in page.versions %}
{% assign v_is_lts = false %}
{% comment %}Get major-version details for this version{% endcomment %}
{% assign major_version_details = site.data.versions | where_exp: "pv", "pv.major_version == v.version.version" | sort: "release_date" | first %}
{% assign major_version_details = site.data.versions | where_exp: "pv", "pv.major_version == v.version.version" | sort: "release_date, release_name" | reverse | first %}
{% unless major_version_details %}Error: Could not get version details for version {{ v.version }}. Giving up.{% break %}{% endunless %}

{% comment %}Check whether this version is released and if so, and is LTS{% endcomment %}
Expand Down
Loading