patchtest: detect leftover AUH changelog-truncation notice
PATCH 1/1 patchtest: detect leftover AUH changelog-truncation notice
From: Daniel Turull <[email protected]>
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 <[email protected]>
--- 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
meta/lib/patchtest/patchtest_patterns.py +1 -0
@@ -48,6 +48,7 @@ patchmetadata_regex = re.compile( # mbox auh_email = '[email protected]' +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),
meta/lib/patchtest/selftest/files/TestMbox.test_auh_changelog_truncation_notice.fail new file +25 -0
@@ -0,0 +1,25 @@ +From c9519f11502d5bb5c143ed43b4c981b6a211bdf9 Mon Sep 17 00:00:00 2001 +From: Trevor Gamblin <[email protected]> +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 <[email protected]> +--- + 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
meta/lib/patchtest/selftest/files/TestMbox.test_auh_changelog_truncation_notice.pass new file +1 -0
@@ -0,0 +1 @@ +TestMbox.test_commit_message_presence.pass
meta/lib/patchtest/tests/test_mbox.py +9 -0
@@ -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, + )