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

Unified Diff: verification/tree_status.py

Issue 68113009: Adding support for NOTREECHECKS (Closed) Base URL: https://src.chromium.org/chrome/trunk/tools/commit-queue/
Patch Set: Created 7 years, 1 month 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 | « tests/tree_status_test.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: verification/tree_status.py
===================================================================
--- verification/tree_status.py (revision 234489)
+++ verification/tree_status.py (working copy)
@@ -7,6 +7,7 @@
import calendar
import json
import logging
+import re
import ssl
import time
import urllib2
@@ -18,12 +19,16 @@
tree_status_url = unicode
issue = int
last_tree_status = unicode
+ description = unicode
def get_state(self):
return base.SUCCEEDED
def postpone(self):
self.last_tree_status = u''
+ if _is_skip_tree_status(self.description):
+ logging.debug('Skipping tree status check for CL %s' % self.issue)
+ return False
try:
logging.debug('Fetching tree status for %s' % self.tree_status_url)
now = time.time()
@@ -56,6 +61,12 @@
return u'Tree is currently not open: %s' % self.last_tree_status
+def _is_skip_tree_status(description):
+ """Returns True if a description contains NOTREECHECKS=true."""
+ match = re.search(r'^NOTREECHECKS=(.*)$', description, re.MULTILINE)
+ return match and match.group(1).lower() == 'true'
iannucci 2013/11/13 06:24:22 I'm not sure why this function can't be inlined as
rmistry 2013/11/13 19:44:44 No reason, this was just exactly how try_job_on_ri
+
+
class TreeStatusVerifier(base.Verifier):
"""Checks the tree status before allowing a commit."""
name = 'tree status'
@@ -66,7 +77,8 @@
def verify(self, pending):
pending.verifications[self.name] = TreeStatus(
- tree_status_url=self.tree_status_url, issue=pending.issue)
+ tree_status_url=self.tree_status_url, issue=pending.issue,
+ description=pending.description)
iannucci 2013/11/13 06:24:22 Another way to do it would be to process descripti
iannucci 2013/11/13 06:25:15 Actually... we could just do the description proce
rmistry 2013/11/13 19:44:44 SGTM. Done. PTAL.
def update_status(self, queue):
pass
« no previous file with comments | « tests/tree_status_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698