diff mbox series

[auh,v2,1/2] steps: skip duplicate changelog for shared-source recipes

Message ID 20260923085528.88881-1-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>

- Groups can mix recipes from different sources (e.g. gstreamer
  plugins), so fetch each recipe's changelog, not just the first.
- Recipes sharing a source (e.g. mesa, mesa-native) produce identical
  changelogs; only append proven duplicates once to the commit message.

Assisted-by: kiro:claude-sonnet-5
Signed-off-by: Daniel Turull <daniel.turull@ericsson.com>

---
v2: change logic to find duplicates and only add if the changelog is
not seen before
---
 modules/steps.py | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Daniel Turull Sept. 23, 2026, 9:06 a.m. UTC | #1
On Wed, 2026-09-23 at 10:55 +0200, daniel.turull@ericsson.com wrote:
> From: Daniel Turull <daniel.turull@ericsson.com>
> 
> - Groups can mix recipes from different sources (e.g. gstreamer
>   plugins), so fetch each recipe's changelog, not just the first.
> - Recipes sharing a source (e.g. mesa, mesa-native) produce identical
>   changelogs; only append proven duplicates once to the commit message.
> 
> Assisted-by: kiro:claude-sonnet-5
> Signed-off-by: Daniel Turull <daniel.turull@ericsson.com>
> 
> ---
> v2: change logic to find duplicates and only add if the changelog is
> not seen before
> ---
>  modules/steps.py | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/modules/steps.py b/modules/steps.py
> index 835cb60..e678a4b 100644
> --- a/modules/steps.py
> +++ b/modules/steps.py
> @@ -98,10 +98,16 @@ def _get_changelog(pn, workdir):
>  
>  def _append_changelog_to_commit_msg(group, opts):
>      max_len = int(opts['changelog_max_len'])
> +    seen = set()
>      for p in group['pkgs']:
>          if 'changelog_text' not in p:
>              continue
>          text = p['changelog_text'].strip()
> +        # Group recipes may share a source and produce identical changelogs
> +        # (e.g. mesa, mesa-native); skip proven duplicates, keep the rest.
> +        if text in seen:
> +            continue
> +        seen.add(text)
>          if len(text) > max_len:
>              text = (text[:max_len] + "\n\n[Changelog truncated as it exceeds {} characters; \n"
>                      "the full changelog can be found in an attachment to the AUH email]".format(max_len))

The patch will work when the oe-
patch https://lore.kernel.org/openembedded-core/20260918120125.770604-1-daniel.turull@ericsson.com/

that I send to create the metadata is merged. Until then the files are slightly
different with the changelog since the recipe is on it.

Daniel
Alexander Kanavin Sept. 23, 2026, 9:16 a.m. UTC | #2
On Wed, 23 Sept 2026 at 11:06, Daniel Turull <daniel.turull@ericsson.com>
wrote:

>
> The patch will work when the oe-
> patch
> https://lore.kernel.org/openembedded-core/20260918120125.770604-1-daniel.turull@ericsson.com/
>
> that I send to create the metadata is merged. Until then the files are
> slightly
> different with the changelog since the recipe is on it.
>

That patch is already merged?
https://git.openembedded.org/openembedded-core/log/

Alex
Daniel Turull Sept. 23, 2026, 10:57 a.m. UTC | #3
On Wed, 2026-09-23 at 11:16 +0200, Alexander Kanavin wrote:
> 
> On Wed, 23 Sept 2026 at 11:06, Daniel Turull <daniel.turull@ericsson.com> wrote:
> > 
> > The patch will work when the oe-
> > patch https://lore.kernel.org/openembedded-core/20260918120125.770604-1-daniel.turull@ericsson.com/
> > 
> > that I send to create the metadata is merged. Until then the files are slightly
> > different with the changelog since the recipe is on it.
> > 
> 
> That patch is already merged?
> https://git.openembedded.org/openembedded-core/log/
> 

Yes. I did check to quickly without pulling oe-core

Daniel
> Alex
diff mbox series

Patch

diff --git a/modules/steps.py b/modules/steps.py
index 835cb60..e678a4b 100644
--- a/modules/steps.py
+++ b/modules/steps.py
@@ -98,10 +98,16 @@  def _get_changelog(pn, workdir):
 
 def _append_changelog_to_commit_msg(group, opts):
     max_len = int(opts['changelog_max_len'])
+    seen = set()
     for p in group['pkgs']:
         if 'changelog_text' not in p:
             continue
         text = p['changelog_text'].strip()
+        # Group recipes may share a source and produce identical changelogs
+        # (e.g. mesa, mesa-native); skip proven duplicates, keep the rest.
+        if text in seen:
+            continue
+        seen.add(text)
         if len(text) > max_len:
             text = (text[:max_len] + "\n\n[Changelog truncated as it exceeds {} characters; \n"
                     "the full changelog can be found in an attachment to the AUH email]".format(max_len))