@@ -57,6 +57,7 @@ invalid_submitters = [pyparsing.Regex("^Upgrade Helper.+"),
mbox_bugzilla = pyparsing.Regex(r'\[\s?YOCTO.*\]')
mbox_bugzilla_validation = pyparsing.Regex(r'\[(\s?YOCTO\s?#\s?(\d+)\s?,?)+\]')
mbox_revert_shortlog_regex = pyparsing.Regex(r'Revert\s+".*"')
+mbox_cover_letter_regex = pyparsing.Regex(r'\[\S+\s+0+/\d+\]')
mbox_shortlog_maxlength = 90
# based on https://stackoverflow.com/questions/30281026/regex-parsing-github-usernames-javascript
mbox_github_username = pyparsing.Regex(r'\B(?<!\${)@([a-z0-9](?:-(?=[a-z0-9])|[a-z0-9]){0,38}(?<=[a-z0-9]))')
@@ -38,6 +38,9 @@ class TestMbox(base.Base):
# skip those patches that revert older commits, these do not required the tag presence
if patchtest_patterns.mbox_revert_shortlog_regex.search_string(commit.shortlog):
continue
+ # cover letters (00/N) are not commits and do not need Signed-off-by
+ if patchtest_patterns.mbox_cover_letter_regex.search_string(commit.subject):
+ continue
if not patchtest_patterns.signed_off_by.search_string(commit.payload):
self.fail(
'Mbox is missing Signed-off-by. Add it manually or with "git commit --amend -s"',
@@ -53,6 +56,9 @@ class TestMbox(base.Base):
# no reason to re-check on revert shortlogs
if shortlog.startswith('Revert "'):
continue
+ # cover letters (00/N) have series titles, not target: summary format
+ if patchtest_patterns.mbox_cover_letter_regex.search_string(commit.subject):
+ continue
try:
patchtest_patterns.shortlog.parseString(shortlog)
except pyparsing.ParseException as pe:
When testing directories containing multiple patches, it's possible that cover letters are present. The user should ideally account for this and remove them as required, but we can also add some capability to test whether a given file is actually a cover letter and act appropriately. Start by adding a new regex pattern in patchtest_patterns.py to detect this case, then adjust the test_mbox suite to make use of it. AI-Generated: Uses Claude Code Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> --- meta/lib/patchtest/patchtest_patterns.py | 1 + meta/lib/patchtest/tests/test_mbox.py | 6 ++++++ 2 files changed, 7 insertions(+)