diff mbox series

[auh,v2,2/2] upgrade-helper: deduplicate identical versions in email subject

Message ID 20260923085528.88881-2-daniel.turull@ericsson.com
State New
Headers show
Series [auh,v2,1/2] steps: skip duplicate changelog for shared-source recipes | expand

Commit Message

Daniel Turull Sept. 23, 2026, 8:55 a.m. UTC
From: Daniel Turull <daniel.turull@ericsson.com>

Recipe groups where every recipe upgrades to the same version (e.g.
systemd, systemd-tools-native, systemd-boot, systemd-boot-native all
to 262) produced a repeated version list in the notification email
subject and body, e.g. 'upgrading to 262,262,262,262'. Deduplicate
identical versions, same as _make_commit_msg() already does for the
commit message subject.

Assisted-by: kiro:claude-sonnet-5
Signed-off-by: Daniel Turull <daniel.turull@ericsson.com>
---
 upgrade-helper.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Alexander Kanavin Sept. 23, 2026, 2:47 p.m. UTC | #1
Thanks, both patches applied and pushed.

Alex

On Wed, 23 Sept 2026 at 10:55, <daniel.turull@ericsson.com> wrote:

> From: Daniel Turull <daniel.turull@ericsson.com>
>
> Recipe groups where every recipe upgrades to the same version (e.g.
> systemd, systemd-tools-native, systemd-boot, systemd-boot-native all
> to 262) produced a repeated version list in the notification email
> subject and body, e.g. 'upgrading to 262,262,262,262'. Deduplicate
> identical versions, same as _make_commit_msg() already does for the
> commit message subject.
>
> Assisted-by: kiro:claude-sonnet-5
> Signed-off-by: Daniel Turull <daniel.turull@ericsson.com>
> ---
>  upgrade-helper.py | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/upgrade-helper.py b/upgrade-helper.py
> index 86e1a93..56b1f02 100755
> --- a/upgrade-helper.py
> +++ b/upgrade-helper.py
> @@ -353,7 +353,9 @@ class Updater(object):
>              else:
>                  cc_addr = settings["cc_recipients"].split()
>
> -        newversions = ",".join([pkg_ctx['NPV'] if not
> pkg_ctx['NPV'].endswith("new-commits-available") else pkg_ctx['NSRCREV']
> for pkg_ctx in g['pkgs']])
> +        newversions = ",".join(dict.fromkeys(
> +                pkg_ctx['NPV'] if not
> pkg_ctx['NPV'].endswith("new-commits-available") else pkg_ctx['NSRCREV']
> +                for pkg_ctx in g['pkgs']))
>          pns = ",".join([pkg_ctx['PN'] for pkg_ctx in g['pkgs']])
>          subject = "[AUH] " + pns + ": upgrading to " + newversions
>          if not g['error']:
>
diff mbox series

Patch

diff --git a/upgrade-helper.py b/upgrade-helper.py
index 86e1a93..56b1f02 100755
--- a/upgrade-helper.py
+++ b/upgrade-helper.py
@@ -353,7 +353,9 @@  class Updater(object):
             else:
                 cc_addr = settings["cc_recipients"].split()
 
-        newversions = ",".join([pkg_ctx['NPV'] if not pkg_ctx['NPV'].endswith("new-commits-available") else pkg_ctx['NSRCREV'] for pkg_ctx in g['pkgs']])
+        newversions = ",".join(dict.fromkeys(
+                pkg_ctx['NPV'] if not pkg_ctx['NPV'].endswith("new-commits-available") else pkg_ctx['NSRCREV']
+                for pkg_ctx in g['pkgs']))
         pns = ",".join([pkg_ctx['PN'] for pkg_ctx in g['pkgs']])
         subject = "[AUH] " + pns + ": upgrading to " + newversions
         if not g['error']: