From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Quentin Schulz <quentin.schulz@theobroma-systems.com>,
michael.opdenacker@bootlin.com,
Quentin Schulz <foss+yocto@0leil.net>,
docs@lists.yoctoproject.org,
Michael Halstead <mhalstead@linuxfoundation.org>
Subject: Re: [docs] Version bump before release
Date: Fri, 18 Mar 2022 11:32:49 +0000 [thread overview]
Message-ID: <b2460d816ec5543f094fdf183dcbd889d8861502.camel@linuxfoundation.org> (raw)
In-Reply-To: <a94451a0-8a13-930b-655a-8e3b34324cd4@theobroma-systems.com>
I know I've been a bit against having magic versions as the tag information may
not always be present in a git checkout of the docs. That said, I was curious to
see how close we could get the information with and without tag information.
I've included a script below which tries to use any branch/tag information
available to guess the correct release series and version to use.
We can make sure the tag information is there for docs builds on our
infrastructure so that bit is easy. The question is therefore whether this does
generate good enough information for people with local checkouts?
The objective here would be to automate generation of the version information in
the docs so we don't have to manually update it other than adding new release
series mappings to master.
See what you think of the script/idea.
I've just realised we could detect the missing tags and tell the user to fetch
them before building too. That would solve most of my worries I think?
Cheers,
Richard
#!/usr/bin/env python3
import subprocess
import collections
import sys
devbranch = "langdale"
release_series = collections.OrderedDict()
release_series["langdale"] = "4.1"
release_series["kirkstone"] = "4.0"
release_series["honister"] = "3.4"
release_series["hardknott"] = "3.3"
release_series["gatesgarth"] = "3.2"
release_series["dunfell"] = "3.1"
ourversion = None
ourseries = None
ourbranch = None
# Try and figure out what we are
tags = subprocess.run(["git", "tag", "--points-at", "HEAD"], capture_output=True, text=True).stdout
for t in tags.split():
if t.startswith("yocto-"):
ourversion = t[6:]
if ourversion:
components = ourversion.split(".")
baseversion = components[0] + "." + components[1]
for i in release_series:
if release_series[i] == baseversion:
ourseries = i
ourbranch = i
else:
branch = subprocess.run(["git", "branch", "--show-current"], capture_output=True, text=True).stdout.strip()
ourbranch = branch
if branch == "master":
ourseries = devbranch
elif branch in release_series:
ourseries = branch
else:
sys.exit("Unknown series for branch %s" % branch)
previoustags = subprocess.run(["git", "tag", "--merged", "HEAD"], capture_output=True, text=True).stdout
previoustags = [t[6:] for t in previoustags.split() if t.startswith("yocto-" + release_series[ourseries])]
futuretags = subprocess.run(["git", "tag", "--merged", ourbranch], capture_output=True, text=True).stdout
futuretags = [t[6:] for t in futuretags.split() if t.startswith("yocto-" + release_series[ourseries])]
if len(previoustags) != len(futuretags):
ourversion = previoustags[-1] + ".999"
else:
ourversion = release_series[ourseries] + ".999"
print("Version calculated to be %s" % ourversion)
print("Release series calculated to be %s" % ourseries)
prev parent reply other threads:[~2022-03-18 11:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-18 0:04 Version bump before release Michael Halstead
2022-03-18 0:32 ` [docs] " Steve Sakoman
2022-03-18 5:01 ` Lee, Chee Yang
2022-03-18 6:47 ` Quentin Schulz
2022-03-18 10:05 ` Michael Opdenacker
2022-03-18 11:16 ` Quentin Schulz
2022-03-18 11:32 ` Richard Purdie [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b2460d816ec5543f094fdf183dcbd889d8861502.camel@linuxfoundation.org \
--to=richard.purdie@linuxfoundation.org \
--cc=docs@lists.yoctoproject.org \
--cc=foss+yocto@0leil.net \
--cc=mhalstead@linuxfoundation.org \
--cc=michael.opdenacker@bootlin.com \
--cc=quentin.schulz@theobroma-systems.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox