pre-upload: reject CQ-DEPEND lines These were only for the old CQ system. We use Cq-Depend: tags now. Reject the old style to help people migrate. BUG=None TEST=`repo upload` works Change-Id: I442b093be67bbc237c5a49ff346b569214c44068 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/repohooks/+/1933029 Commit-Queue: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Brian Norris <briannorris@chromium.org>
diff --git a/pre-upload.py b/pre-upload.py index 5f1f95d..511324d 100755 --- a/pre-upload.py +++ b/pre-upload.py
@@ -634,13 +634,20 @@ except ValueError as ex: return HookFailure(msg, [example, str(ex)]) # Check that Cq-Depend is in the same paragraph as Change-Id. - msg = 'Cq-Depend (or CQ-DEPEND) is not in the same paragraph as Change-Id.' + msg = 'Cq-Depend is not in the same paragraph as Change-Id.' paragraphs = desc.split('\n\n') for paragraph in paragraphs: - if (re.search(r'^Cq-Depend:', paragraph, re.M) or - re.search(r'^CQ-DEPEND=', paragraph, re.M)) \ - and not re.search('^Change-Id:', paragraph, re.M): + if (re.search(r'^Cq-Depend:', paragraph, re.M) and not + re.search('^Change-Id:', paragraph, re.M)): return HookFailure(msg) + + # We no longer support CQ-DEPEND= lines. + if re.search(r'^CQ-DEPEND[=:]', desc, re.M): + return HookFailure( + 'CQ-DEPEND= is no longer supported. Please see:\n' + 'https://chromium.googlesource.com/chromiumos/docs/+/HEAD/' + 'contributing.md#CQ-DEPEND') + return None
diff --git a/pre-upload_unittest.py b/pre-upload_unittest.py index 62e5d90..f672a7c 100755 --- a/pre-upload_unittest.py +++ b/pre-upload_unittest.py
@@ -1166,6 +1166,7 @@ self.assertMessageRejected('\nCq-Depend=chromium=1234\n') self.assertMessageRejected('\nCq-Depend: None\n') self.assertMessageRejected('\nCq-Depend: chromium:1234\n\nChange-Id: I123') + self.assertMessageRejected('\nCQ-DEPEND=1234\n') class CheckCommitMessageContribution(CommitMessageTestCase):