pre-upload: Cq-Include-Trybots is valid in footer.
Allow Cq-Include-Trybots: tag in footer to land alphabetically with
Change-Id.
BUG=None
TEST=unit tests pass
Change-Id: I5bfbe0d3879ae5261022c01520b716bd43feae63
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/repohooks/+/2085658
Tested-by: LaMont Jones <lamontjones@chromium.org>
Auto-Submit: LaMont Jones <lamontjones@chromium.org>
Reviewed-by: Chris McDonald <cjmcdonald@chromium.org>
Commit-Queue: Chris McDonald <cjmcdonald@chromium.org>
diff --git a/pre-upload.py b/pre-upload.py
index 81d1e42..c0bd20b 100755
--- a/pre-upload.py
+++ b/pre-upload.py
@@ -757,6 +757,7 @@
'Reported-by',
'Acked-for-chrome-by',
'Cq-Cl-Tag',
+ 'Cq-Include-Trybots',
}
# Ignore tags, which could reasonably contain OEM names
@@ -1195,8 +1196,8 @@
if not m:
return HookFailure('Last paragraph of description must include Change-Id.')
- # S-o-b tags always allowed to follow Change-ID.
- allowed_tags = ['Signed-off-by', 'Cq-Cl-Tag']
+ # S-o-b and some other tags always allowed to follow Change-ID in the footer.
+ allowed_tags = ['Signed-off-by', 'Cq-Cl-Tag', 'Cq-Include-Trybots']
end = desc[m.end():].strip().splitlines()
cherry_pick_marker = 'cherry picked from commit'
diff --git a/pre-upload_unittest.py b/pre-upload_unittest.py
index 1e3d4cb..384af0e 100755
--- a/pre-upload_unittest.py
+++ b/pre-upload_unittest.py
@@ -1272,6 +1272,11 @@
"""Permit Cq-Cl-Tag tags to follow the Change-Id."""
self.assertMessageAccepted('foo\n\nChange-Id: I1234\nCq-Cl-Tag: Hi\n')
+ def testCqIncludeTrybotsTag(self):
+ """Permit Cq-Include-Trybots tags to follow the Change-Id."""
+ self.assertMessageAccepted(
+ 'foo\n\nChange-Id: I1234\nCq-Include-Trybots: chromeos/cq:foo\n')
+
class CheckCommitMessageNoOEM(CommitMessageTestCase):
"""Tests for _check_change_no_include_oem."""