diff mbox series

patchtest: detect leftover AUH changelog-truncation notice

Message ID 20260731132714.1672980-1-daniel.turull@ericsson.com
State Under Review
Headers show
Series patchtest: detect leftover AUH changelog-truncation notice | expand

Commit Message

Daniel Turull July 31, 2026, 1:27 p.m. UTC
From: Daniel Turull <daniel.turull@ericsson.com>

Add a check for the changelog-truncation notice that auto-upgrade-helper
appends to the commit message when the devtool changelog exceeds
changelog_max_len. This text is meant to be replaced by the submitter
with their own summary of the changes before sending the patch, so flag
it if left in place.

AI-Generated: Kiro with Claude Sonnet 5
Signed-off-by: Daniel Turull <daniel.turull@ericsson.com>
---
 meta/lib/patchtest/patchtest_patterns.py      |  1 +
 ....test_auh_changelog_truncation_notice.fail | 25 +++++++++++++++++++
 ....test_auh_changelog_truncation_notice.pass |  1 +
 meta/lib/patchtest/tests/test_mbox.py         |  9 +++++++
 4 files changed, 36 insertions(+)
 create mode 100644 meta/lib/patchtest/selftest/files/TestMbox.test_auh_changelog_truncation_notice.fail
 create mode 120000 meta/lib/patchtest/selftest/files/TestMbox.test_auh_changelog_truncation_notice.pass
diff mbox series

Patch

diff --git a/meta/lib/patchtest/patchtest_patterns.py b/meta/lib/patchtest/patchtest_patterns.py
index 1a8db92aa5..11e5996df0 100644
--- a/meta/lib/patchtest/patchtest_patterns.py
+++ b/meta/lib/patchtest/patchtest_patterns.py
@@ -48,6 +48,7 @@  patchmetadata_regex = re.compile(
 
 # mbox
 auh_email = 'auh@yoctoproject.org'
+auh_changelog_truncated = 'the full changelog can be found in an attachment to the AUH email'
 
 invalid_submitters = [pyparsing.Regex("^Upgrade Helper.+"),
             pyparsing.Regex(auh_email),
diff --git a/meta/lib/patchtest/selftest/files/TestMbox.test_auh_changelog_truncation_notice.fail b/meta/lib/patchtest/selftest/files/TestMbox.test_auh_changelog_truncation_notice.fail
new file mode 100644
index 0000000000..7fe3c77df3
--- /dev/null
+++ b/meta/lib/patchtest/selftest/files/TestMbox.test_auh_changelog_truncation_notice.fail
@@ -0,0 +1,25 @@ 
+From c9519f11502d5bb5c143ed43b4c981b6a211bdf9 Mon Sep 17 00:00:00 2001
+From: Trevor Gamblin <tgamblin@baylibre.com>
+Date: Fri, 31 May 2024 09:54:50 -0400
+Subject: [PATCH] selftest-hello: upgrade 1.0 -> 1.1
+
+[Changelog truncated as it exceeds 3000 characters;
+the full changelog can be found in an attachment to the AUH email]
+
+Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
+---
+ meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb
+index 2dc352d479e..b6be3f2e1e0 100644
+--- a/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb
++++ b/meta-selftest/recipes-test/selftest-hello/selftest-hello_1.0.bb
+@@ -1,4 +1,4 @@
+-SUMMARY = "This is an example summary"
++SUMMARY = "This is an example summary, slightly updated"
+ DESCRIPTION = "Simple helloworld application -- selftest variant"
+ SECTION = "examples"
+ LICENSE = "MIT"
+-- 
+2.45.1
diff --git a/meta/lib/patchtest/selftest/files/TestMbox.test_auh_changelog_truncation_notice.pass b/meta/lib/patchtest/selftest/files/TestMbox.test_auh_changelog_truncation_notice.pass
new file mode 120000
index 0000000000..afeb3e7cdd
--- /dev/null
+++ b/meta/lib/patchtest/selftest/files/TestMbox.test_auh_changelog_truncation_notice.pass
@@ -0,0 +1 @@ 
+TestMbox.test_commit_message_presence.pass
\ No newline at end of file
diff --git a/meta/lib/patchtest/tests/test_mbox.py b/meta/lib/patchtest/tests/test_mbox.py
index feb87fa2ae..3db21d2104 100644
--- a/meta/lib/patchtest/tests/test_mbox.py
+++ b/meta/lib/patchtest/tests/test_mbox.py
@@ -177,3 +177,12 @@  class TestMbox(base.Base):
                     % patchtest_patterns.auh_email,
                     commit=commit,
                 )
+
+    def test_auh_changelog_truncation_notice(self):
+        for commit in self.commits:
+            if patchtest_patterns.auh_changelog_truncated in commit.commit_message:
+                self.fail(
+                    "Commit message contains the AUH changelog-truncation notice left over from "
+                    "the auto upgrade. Remove it and summarize the relevant changes yourself",
+                    commit=commit,
+                )