* [PATCH 0/2] set_versions.py fixes
@ 2026-04-02 8:13 Antonin Godard
2026-04-02 8:13 ` [PATCH 1/2] set_versions.py: skip laverne branch for closest branch Antonin Godard
2026-04-02 8:13 ` [PATCH 2/2] set_versions.py: fix get_latest_tag and milestone tags Antonin Godard
0 siblings, 2 replies; 5+ messages in thread
From: Antonin Godard @ 2026-04-02 8:13 UTC (permalink / raw)
To: docs; +Cc: Thomas Petazzoni, Antonin Godard
Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
---
Antonin Godard (2):
set_versions.py: skip laverne branch for closest branch
set_versions.py: fix get_latest_tag and milestone tags
documentation/set_versions.py | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
---
base-commit: dc1574b9f71532c469f355af2ff5ff5664083e48
change-id: 20260402-set-versions-fixes-a74b25ed253c
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH 1/2] set_versions.py: skip laverne branch for closest branch 2026-04-02 8:13 [PATCH 0/2] set_versions.py fixes Antonin Godard @ 2026-04-02 8:13 ` Antonin Godard 2026-04-02 8:22 ` [docs] " Quentin Schulz 2026-04-02 8:13 ` [PATCH 2/2] set_versions.py: fix get_latest_tag and milestone tags Antonin Godard 1 sibling, 1 reply; 5+ messages in thread From: Antonin Godard @ 2026-04-02 8:13 UTC (permalink / raw) To: docs; +Cc: Thomas Petazzoni, Antonin Godard The laverne branch was created but never branched off, which breaks the algorithm trying to determine the closest branch as it always gets count 0. Skip this branch as it is old and we'll never branch off of it now. This fixes the following issue: Branch laverne has count 0 Nearest release branch estimated to be laverne Traceback (most recent call last): File "/data/yoctoproject/ws/repos/yocto-docs/documentation/./set_versions.py", line 167, in <module> bitbakeversion = bitbake_mapping[ourseries] ~~~~~~~~~~~~~~~^^^^^^^^^^^ KeyError: 'laverne' Signed-off-by: Antonin Godard <antonin.godard@bootlin.com> --- documentation/set_versions.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/documentation/set_versions.py b/documentation/set_versions.py index 29638b324..465204998 100755 --- a/documentation/set_versions.py +++ b/documentation/set_versions.py @@ -142,6 +142,11 @@ if ourversion is None: result = subprocess.run(["git", "log", "--format=oneline", "HEAD..origin/" + b], stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) + # The laverne branch was created but never branched off, which + # breaks this algorithm as this always gets count 0. Skip this + # branch as it is old and we'll never branch off of it now. + if b == "laverne": + continue if result.returncode == 0: count = result.stdout.count('\n') if not possible_branch or count < branch_count: -- 2.53.0 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [docs] [PATCH 1/2] set_versions.py: skip laverne branch for closest branch 2026-04-02 8:13 ` [PATCH 1/2] set_versions.py: skip laverne branch for closest branch Antonin Godard @ 2026-04-02 8:22 ` Quentin Schulz 2026-04-02 8:28 ` Antonin Godard 0 siblings, 1 reply; 5+ messages in thread From: Quentin Schulz @ 2026-04-02 8:22 UTC (permalink / raw) To: antonin.godard, docs; +Cc: Thomas Petazzoni Hi Antonin, On 4/2/26 10:13 AM, Antonin Godard via lists.yoctoproject.org wrote: > The laverne branch was created but never branched off, which breaks the > algorithm trying to determine the closest branch as it always gets count > 0. Skip this branch as it is old and we'll never branch off of it now. > > This fixes the following issue: > > Branch laverne has count 0 > Nearest release branch estimated to be laverne > Traceback (most recent call last): > File "/data/yoctoproject/ws/repos/yocto-docs/documentation/./set_versions.py", line 167, in <module> > bitbakeversion = bitbake_mapping[ourseries] > ~~~~~~~~~~~~~~~^^^^^^^^^^^ > KeyError: 'laverne' > > Signed-off-by: Antonin Godard <antonin.godard@bootlin.com> > --- > documentation/set_versions.py | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/documentation/set_versions.py b/documentation/set_versions.py > index 29638b324..465204998 100755 > --- a/documentation/set_versions.py > +++ b/documentation/set_versions.py > @@ -142,6 +142,11 @@ if ourversion is None: > result = subprocess.run(["git", "log", "--format=oneline", "HEAD..origin/" + b], > stdout=subprocess.PIPE, stderr=subprocess.PIPE, > universal_newlines=True) > + # The laverne branch was created but never branched off, which > + # breaks this algorithm as this always gets count 0. Skip this > + # branch as it is old and we'll never branch off of it now. > + if b == "laverne": > + continue Why run the command if we're gonna skip the loop regardless of the result of the command? Just do the continue before the subprocess.run? Cheers, Quentin ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [docs] [PATCH 1/2] set_versions.py: skip laverne branch for closest branch 2026-04-02 8:22 ` [docs] " Quentin Schulz @ 2026-04-02 8:28 ` Antonin Godard 0 siblings, 0 replies; 5+ messages in thread From: Antonin Godard @ 2026-04-02 8:28 UTC (permalink / raw) To: quentin.schulz, docs; +Cc: Thomas Petazzoni Hi, On Thu Apr 2, 2026 at 10:22 AM CEST, Quentin Schulz via lists.yoctoproject.org wrote: > Hi Antonin, > > On 4/2/26 10:13 AM, Antonin Godard via lists.yoctoproject.org wrote: >> The laverne branch was created but never branched off, which breaks the >> algorithm trying to determine the closest branch as it always gets count >> 0. Skip this branch as it is old and we'll never branch off of it now. >> >> This fixes the following issue: >> >> Branch laverne has count 0 >> Nearest release branch estimated to be laverne >> Traceback (most recent call last): >> File "/data/yoctoproject/ws/repos/yocto-docs/documentation/./set_versions.py", line 167, in <module> >> bitbakeversion = bitbake_mapping[ourseries] >> ~~~~~~~~~~~~~~~^^^^^^^^^^^ >> KeyError: 'laverne' >> >> Signed-off-by: Antonin Godard <antonin.godard@bootlin.com> >> --- >> documentation/set_versions.py | 5 +++++ >> 1 file changed, 5 insertions(+) >> >> diff --git a/documentation/set_versions.py b/documentation/set_versions.py >> index 29638b324..465204998 100755 >> --- a/documentation/set_versions.py >> +++ b/documentation/set_versions.py >> @@ -142,6 +142,11 @@ if ourversion is None: >> result = subprocess.run(["git", "log", "--format=oneline", "HEAD..origin/" + b], >> stdout=subprocess.PIPE, stderr=subprocess.PIPE, >> universal_newlines=True) >> + # The laverne branch was created but never branched off, which >> + # breaks this algorithm as this always gets count 0. Skip this >> + # branch as it is old and we'll never branch off of it now. >> + if b == "laverne": >> + continue > > Why run the command if we're gonna skip the loop regardless of the > result of the command? Just do the continue before the subprocess.run? An oversight, I'll move it above, thanks Antonin ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/2] set_versions.py: fix get_latest_tag and milestone tags 2026-04-02 8:13 [PATCH 0/2] set_versions.py fixes Antonin Godard 2026-04-02 8:13 ` [PATCH 1/2] set_versions.py: skip laverne branch for closest branch Antonin Godard @ 2026-04-02 8:13 ` Antonin Godard 1 sibling, 0 replies; 5+ messages in thread From: Antonin Godard @ 2026-04-02 8:13 UTC (permalink / raw) To: docs; +Cc: Thomas Petazzoni, Antonin Godard Milestone tags have a different format, e.g. 6.0_M1. This was breaking this algorithm with: File ".../yocto-docs/documentation/./set_versions.py", line 277, in get_latest_tag branch_versions = sorted( [v.replace("yocto-" + release_series[branch] + ".", "") .replace("yocto-" + release_series[branch], "0") for v in branch_versions], key=int) ValueError: invalid literal for int() with base 10: '0_M1' Signed-off-by: Antonin Godard <antonin.godard@bootlin.com> --- documentation/set_versions.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/documentation/set_versions.py b/documentation/set_versions.py index 465204998..375f96d99 100755 --- a/documentation/set_versions.py +++ b/documentation/set_versions.py @@ -274,9 +274,13 @@ def get_latest_tag(branch: str) -> str: branch_versions = subprocess.run(["git", "tag", "--list", f'yocto-{release_series[branch]}*'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True).stdout.split() + # Sort the branches as integers + # On milestone tags (e.g. 6.0_M2), remove everything after "_" (including + # "_") branch_versions = sorted( [v.replace("yocto-" + release_series[branch] + ".", "") - .replace("yocto-" + release_series[branch], "0") for v in branch_versions], + .replace("yocto-" + release_series[branch], "0") + .split("_")[0] for v in branch_versions], key=int) if not branch_versions: return "" -- 2.53.0 ^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-04-02 8:28 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-04-02 8:13 [PATCH 0/2] set_versions.py fixes Antonin Godard 2026-04-02 8:13 ` [PATCH 1/2] set_versions.py: skip laverne branch for closest branch Antonin Godard 2026-04-02 8:22 ` [docs] " Quentin Schulz 2026-04-02 8:28 ` Antonin Godard 2026-04-02 8:13 ` [PATCH 2/2] set_versions.py: fix get_latest_tag and milestone tags Antonin Godard
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox