Skip to contentSkip to conversation

set_versions.py fixes (continued)

PATCH Applied Antonin Godard 1 participant 4 messages Apr 13 – Apr 16

lore
Share & tools
lore
#0 lore raw

cover set_versions.py fixes (continued)

---
Antonin Godard (2):
set_versions.py: change strategy for the default page set_versions.py: make active releases unique

 documentation/set_versions.py | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

---
base-commit: 560bc33c0c2ecd60d68ba06a2edff8c25b9a3f90
change-id: 20260410-set-versions-no-current-release-da004588c772

#1 lore raw

PATCH 1/2 set_versions.py: change strategy for the default page

A problem can happen with the current code: if the current stable release is made EOL before the development branch is made the current stable, then we only have LTS releases displayed.

Change the logic to _always_ display the latest non-dev branch as the default page, even if EOL.

---
 documentation/set_versions.py | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
documentation/set_versions.py +12 -3
index e9aeb553e..bd4b91082 100755
@@ -70,14 +70,23 @@ if releases_from_json:
         release_series[codename] = release["series_version"]
         if release["status"] == "Active Development":
             devbranch = codename
-        if release["series"] == "current":
-            activereleases.append(codename)
         if "LTS until" in release["status"]:
             ltsseries.append(codename)
         if release["bitbake_version"]:
             bitbake_mapping[codename] = release["bitbake_version"]
 
-    activereleases.remove(devbranch)
+    # Find the first non-dev release, which should be displayed as the default
+    # page on the docs website.
+    current_branch = ""
+    for release in releases_from_json:
+        if release["status"] != "Active Development":
+            current_branch = release["release_codename"].lower()
+            break
+
+    if not current_branch:
+        sys.exit("Unable to find a current release! Exiting...")
+
+    activereleases = [current_branch] + ltsseries
 
 # used by run-docs-builds to get the default page
 if len(sys.argv) > 1 and sys.argv[1] == "getlatest":
Signature · 1 line
2.53.0
#2 lore raw

PATCH 2/2 set_versions.py: make active releases unique

In reply to Antonin Godard

In case the new current release is an LTS release, the previous code would have this release twice in the list of active releases. De-duplicate items in this list.

---
 documentation/set_versions.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
documentation/set_versions.py +3 -1
index bd4b91082..c9a6012b9 100755
@@ -86,7 +86,9 @@ if releases_from_json:
     if not current_branch:
         sys.exit("Unable to find a current release! Exiting...")
 
-    activereleases = [current_branch] + ltsseries
+    # make the list of releases unique, there can be duplication when the
+    # current releases is also an LTS
+    activereleases = list(dict.fromkeys([current_branch] + ltsseries))
 
 # used by run-docs-builds to get the default page
 if len(sys.argv) > 1 and sys.argv[1] == "getlatest":
Signature · 1 line
2.53.0
author Applied
#3 lore raw
In reply to Antonin Godard

Applied, thanks!

[1/2] set_versions.py: change strategy for the default page

      commit: 601b191dd41806bad2a2aae563445344c803681c
[2/2] set_versions.py: make active releases unique
      commit: 1500f2b6b7c1263781f16627091f8f3b1df86d80