diff mbox series

[yocto-autobuilder-helper,1/2] scripts/release-parser: derive codename from branch instead of branch tags

Message ID CADfgfob4zA_PEyt2L5BrLfNeB-CGBGtfA_-kER2RHRiHE0nzeA@mail.gmail.com
State New
Headers show
Series base branch names on branches instead of tags | expand

Commit Message

Michael Halstead March 27, 2026, 9:01 a.m. UTC
scripts/release-parser: derive codename from branch instead of branch tags

Branch tags (e.g. kirkstone-4.0.34) that duplicate yocto-* tags are
being removed from all repositories. Derive the release codename from
the remote branch that contains the tagged commit instead of relying
on sibling branch tags.

Signed-off-by: Michael Halstead <mhalstead@linuxfoundation.org>
---
 scripts/release-parser.py | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/scripts/release-parser.py b/scripts/release-parser.py
index a38824f..9e5bc6a 100755
--- a/scripts/release-parser.py
+++ b/scripts/release-parser.py
@@ -59,15 +59,16 @@  def get_bitbake_mapping(yocto_tag: str) -> str:
     return branches[0].strip().replace("origin/", "")

 def get_git_tags():
-    tagmap = {}
-    for t in repo.tags:
-        tagmap.setdefault(repo.commit(t), []).append(t)
-
     def convert_name(tag):
-        tags = tagmap[tag.commit]
-        for t in tags:
-            if "yocto" not in t.name and ".rc" not in t.name:
-                return "".join(filter(str.isalpha, t.name)).capitalize()
+        branches = repo.git.branch(
+            "--remotes",
+            "--sort=creatordate",
+            "--contains", tag.commit.hexsha,
+        ).splitlines()
+        for b in branches:
+            b = b.strip().replace("origin/", "").replace("* ", "")
+            if b.isalpha() and b not in ("master", "main"):
+                return b.capitalize()
         return "BranchMissing"

     tags = list(filter(lambda e: "yocto" in e.name, repo.tags))