[1/3] docs: set_versions.py: mark as obsolete only branches or not-latest tags which are from an obsolete release

Message ID 20220420112402.151968-1-foss+yocto@0leil.net
State New
Headers show
Series [1/3] docs: set_versions.py: mark as obsolete only branches or not-latest tags which are from an obsolete release | expand

Commit Message

Quentin Schulz April 20, 2022, 11:24 a.m. UTC
From: Quentin Schulz <quentin.schulz@theobroma-systems.com>

Branches are identified by their .999 version suffix which means they
will never be matched in the forloop above this git context. Therefore,
branches will match the condition. However, branches are not necessarily
obsolete (e.g. dunfell, honister and kirkstone today), so let's mark as
obsolete the branches which are from obsolete releases.

The same applies to not-latest tags of supported releases. The obsolete
and outdate warning messages are handled separately and only obsolete is
handled here, and not-latest tags of supported releases are technically
not obsolete, so let's not mark them as so.

Cc: Quentin Schulz <foss+yocto@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
---
 documentation/set_versions.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Richard Purdie April 20, 2022, 11:46 a.m. UTC | #1
On Wed, 2022-04-20 at 13:24 +0200, Quentin Schulz wrote:
> From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> 
> Branches are identified by their .999 version suffix which means they
> will never be matched in the forloop above this git context. Therefore,
> branches will match the condition. However, branches are not necessarily
> obsolete (e.g. dunfell, honister and kirkstone today), so let's mark as
> obsolete the branches which are from obsolete releases.
> 
> The same applies to not-latest tags of supported releases. The obsolete
> and outdate warning messages are handled separately and only obsolete is
> handled here, and not-latest tags of supported releases are technically
> not obsolete, so let's not mark them as so.

I'm struggling to parse that last sentence. I think it needs a small tweak to
break it up into two pieces:

The obsolete and outdate warning messages are handled separately and only
obsolete is handled here. The not-latest tags of supported releases are
technically not obsolete, so let's not mark them as so.

Cheers,

Richard

Patch

diff --git a/documentation/set_versions.py b/documentation/set_versions.py
index 8ae02b11f..dfa2dc269 100755
--- a/documentation/set_versions.py
+++ b/documentation/set_versions.py
@@ -218,7 +218,7 @@  with open("sphinx-static/switchers.js.in", "r") as r, open("sphinx-static/switch
                 versions.append(version)
                 w.write("    '%s': {'title': '%s', 'obsolete': %s,},\n" % (version, version, str(branch not in activereleases).lower()))
             if ourversion not in versions and ourseries != devbranch:
-                w.write("    '%s': {'title': '%s', 'obsolete': true,},\n" % (ourversion, ourversion))
+                w.write("    '%s': {'title': '%s', 'obsolete': %s,},\n" % (ourversion, ourversion, str(ourseries not in activereleases).lower()))
         else:
             w.write(line)