diff mbox series

[yocto-autobuilder-helper] send_qa_email: add git-describe output if possible

Message ID 20260126085252.178615-2-yoann.congal@smile.fr
State New
Headers show
Series [yocto-autobuilder-helper] send_qa_email: add git-describe output if possible | expand

Commit Message

Yoann Congal Jan. 26, 2026, 8:52 a.m. UTC
From: Yoann Congal <yoann.congal@smile.fr>

This would allow to quickly identify commits that are not on the right
branch.

Partial example of output on my whinlatter-nut branch:
  bitbake: 74f8a927ca6a20342072e5579182aea917b6dc30 (yocto-5.3-3-g74f8a927c)
  meta-yocto: 6973ca663aaa9c3ab517ee960ab7985a5bf54c07 (yocto-5.3-1-g6973ca6)
  openembedded-core: b4e7819b99d9c1a8995eba87e6f466fd8c77e14a (yocto-5.3-73-gb4e7819b99)
(It shows that every commits are correctly after yocto-5.3)

Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
---
 scripts/send_qa_email.py | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Mikko Rapeli Jan. 26, 2026, 9:24 a.m. UTC | #1
Hi,

On Mon, Jan 26, 2026 at 09:52:53AM +0100, Yoann Congal via lists.yoctoproject.org wrote:
> From: Yoann Congal <yoann.congal@smile.fr>
> 
> This would allow to quickly identify commits that are not on the right
> branch.
> 
> Partial example of output on my whinlatter-nut branch:
>   bitbake: 74f8a927ca6a20342072e5579182aea917b6dc30 (yocto-5.3-3-g74f8a927c)
>   meta-yocto: 6973ca663aaa9c3ab517ee960ab7985a5bf54c07 (yocto-5.3-1-g6973ca6)
>   openembedded-core: b4e7819b99d9c1a8995eba87e6f466fd8c77e14a (yocto-5.3-73-gb4e7819b99)
> (It shows that every commits are correctly after yocto-5.3)

The output may or may not work, and may actually confuse users:

bitbake$ git describe --match yocto-* origin/master
yocto-5.3-52-gcdd79c1768ac
core$ git describe --match yocto-* origin/master
yocto-5.1-4541-g6c31c2a73185
meta-yocto$ git describe --match yocto-* origin/master
yocto-5.0.10-40-gc23c19e0b300

and I don't seem to be able to find out in a few minutes which branch
of bitbake is used with core and meta-yocto whinlatter branches
since the branch is not called "whinlatter" but bitbake version.
Oh bitbake default-registry/configurations/oe-nodistro-whinlatter.conf.json
has it as "2.16" but openembedded-core doesn't seem to know which bitbake
version is correct for whinlatter.

I hope this works for "whinlatter" and other releases in the future
but the tags are a bit messy stil.

Cheers,

-Mikko

> Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
> ---
>  scripts/send_qa_email.py | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/scripts/send_qa_email.py b/scripts/send_qa_email.py
> index e3de4b5..8d24af5 100755
> --- a/scripts/send_qa_email.py
> +++ b/scripts/send_qa_email.py
> @@ -265,6 +265,15 @@ def send_qa_email():
>          # Need the finalised revisions (not 'HEAD')
>          targetrepodir = "%s/%s" % (repodir, repo)
>          revision = subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=targetrepodir).decode('utf-8').strip()
> +
> +        # Add git describe output if possible
> +        try:
> +            description = subprocess.check_output(["git", "describe", "--match", "yocto-*", "HEAD"],
> +                                                  cwd=targetrepodir, stderr=subprocess.DEVNULL).decode('utf-8').strip()
> +            revision += " (%s)" % description
> +        except subprocess.CalledProcessError:
> +            pass # ignore any error
> +
>          buildhashes += "%s: %s\n" % (repo, revision)
>  
>      web_root = utils.getconfig('WEBPUBLISH_DIR', ourconfig)
> 
> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#3077): https://lists.yoctoproject.org/g/yocto-patches/message/3077
> Mute This Topic: https://lists.yoctoproject.org/mt/117465359/7159507
> Group Owner: yocto-patches+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/yocto-patches/leave/13178654/7159507/914336139/xyzzy [mikko.rapeli@linaro.org]
> -=-=-=-=-=-=-=-=-=-=-=-
> 
>
diff mbox series

Patch

diff --git a/scripts/send_qa_email.py b/scripts/send_qa_email.py
index e3de4b5..8d24af5 100755
--- a/scripts/send_qa_email.py
+++ b/scripts/send_qa_email.py
@@ -265,6 +265,15 @@  def send_qa_email():
         # Need the finalised revisions (not 'HEAD')
         targetrepodir = "%s/%s" % (repodir, repo)
         revision = subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=targetrepodir).decode('utf-8').strip()
+
+        # Add git describe output if possible
+        try:
+            description = subprocess.check_output(["git", "describe", "--match", "yocto-*", "HEAD"],
+                                                  cwd=targetrepodir, stderr=subprocess.DEVNULL).decode('utf-8').strip()
+            revision += " (%s)" % description
+        except subprocess.CalledProcessError:
+            pass # ignore any error
+
         buildhashes += "%s: %s\n" % (repo, revision)
 
     web_root = utils.getconfig('WEBPUBLISH_DIR', ourconfig)