Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(883)

Unified Diff: git_cl.py

Issue 2083063002: Rietveld git cl status: ignore CQ dry run and generated messages. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: review Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git_cl.py
diff --git a/git_cl.py b/git_cl.py
index 6506f2923b7fe21d2c2a0a9de9b1b1495a0a7bb6..5d91536dc7184517052591f9a67d4605cef09806 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -64,6 +64,7 @@ import watchlists
__version__ = '2.0'
+COMMIT_BOT_EMAIL = 'commit-bot@chromium.org'
DEFAULT_SERVER = 'https://codereview.appspot.com'
POSTUPSTREAM_HOOK_PATTERN = '.git/hooks/post-cl-%s'
DESCRIPTION_BACKUP_FILE = '~/.git_cl_description_backup'
@@ -1707,11 +1708,23 @@ class _RietveldChangelistImpl(_ChangelistCodereviewBase):
messages = props.get('messages') or []
+ # Skip CQ messages that don't require owner's action.
+ while messages and messages[-1]['sender'] == COMMIT_BOT_EMAIL:
+ if 'Dry run:' in messages[-1]['text']:
+ messages.pop()
+ elif 'The CQ bit was unchecked' in messages[-1]['text']:
+ # This message always follows prior messages from CQ,
+ # so skip this too.
+ messages.pop()
+ else:
+ # This is probably a CQ messages warranting user attention.
+ break
+
if not messages:
# No message was sent.
return 'unsent'
if messages[-1]['sender'] != props.get('owner_email'):
- # Non-LGTM reply from non-owner
+ # Non-LGTM reply from non-owner and not CQ bot.
return 'reply'
return 'waiting'
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698