Skip to contentSkip to conversation

doc/setversions.py: add --get-latest-branch argument

PATCH Superseded Antonin Godard 2 participants 2 messages Apr 29

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 doc/setversions.py: add --get-latest-branch argument

Add a --get-latest-branch argument that can be used to show the latest branch from the parsed releases.json file. This will be used by the Autobuilder to know what the version of the default bitbake docs page should be.

---
Note: Companion patch on the yocto-autobuilder-helper repo will be sent after this one.

---
 doc/setversions.py | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
doc/setversions.py +14 -0
index f1aea0a4225..c4127bb43fd 100755
@@ -13,6 +13,7 @@
 # SPDX-License-Identifier: MIT
 #
 
+import argparse
 import itertools
 import json
 import os
@@ -23,6 +24,15 @@ import textwrap
 
 from urllib.request import urlopen, URLError
 
+parser = argparse.ArgumentParser(
+    description="Parse https://dashboard.yoctoproject.org/releases.json to get current releases information"
+)
+parser.add_argument("--get-latest-branch",
+                    help="Get current latest branch",
+                    action="store_true",
+                    default=False)
+args = parser.parse_args()
+
 # NOTE: the following variables contain default values in case we are not able to fetch
 # the releases.json file from https://dashboard.yoctoproject.org/releases.json
 DEVBRANCH = "2.18"
@@ -85,6 +95,10 @@ if RELEASES_FROM_JSON:
     # current releases is also an LTS
     ACTIVERELEASES = list(dict.fromkeys([current_branch] + LTSSERIES))
 
+if args.get_latest_branch:
+    print(ACTIVERELEASES[0])
+    sys.exit(0)
+
 print(f"ACTIVERELEASES calculated to be {ACTIVERELEASES}", file=sys.stderr)
 print(f"DEVBRANCH calculated to be {DEVBRANCH}", file=sys.stderr)
 print(f"LTSSERIES calculated to be {LTSSERIES}", file=sys.stderr)

---
base-commit: b79667b6599494a0ed209d48bf8bbb7e8921d926
change-id: 20260428-doc-get-latest-branch-d17e0de248a3

#1 lore raw

Hi Antonin,

Quoted 26 lines · Antonin Godard via lists.yoctoproject.org

Add a --get-latest-branch argument that can be used to show the latest branch from the parsed releases.json file. This will be used by the Autobuilder to know what the version of the default bitbake docs page should be.

---
Note: Companion patch on the yocto-autobuilder-helper repo will be sent after this one.

---
  doc/setversions.py | 14 ++++++++++++++
  1 file changed, 14 insertions(+)
doc/setversions.py +1 -0
index f1aea0a4225..c4127bb43fd 100755
@@ -13,6 +13,7 @@
  # SPDX-License-Identifier: MIT
  #
 
+import argparse
  import itertools
  import json
  import os

doc/setversions.py import textwrap · line 31

Quoted 8 lines
doc/setversions.py +5 -0
@@ -23,6 +24,15 @@ import textwrap
 
  from urllib.request import urlopen, URLError
 
+parser = argparse.ArgumentParser(
+    description="Parse https://dashboard.yoctoproject.org/releases.json to get current releases information"
+)
+parser.add_argument("--get-latest-branch",
+                    help="Get current latest branch",

s/Get/Print/

+and exit.

Cheers,
Quentin