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

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 234872)
+++ verification/tree_status.py (working copy)
@@ -7,6 +7,7 @@
import calendar
import json
import logging
+import re
import ssl
import time
import urllib2
@@ -56,6 +57,12 @@
return u'Tree is currently not open: %s' % self.last_tree_status
+class AlwaysOpenTreeStatus(TreeStatus):
+ """Used when tree status does not need to be checked."""
+ def postpone(self):
+ return False
+
+
class TreeStatusVerifier(base.Verifier):
"""Checks the tree status before allowing a commit."""
name = 'tree status'
@@ -65,8 +72,15 @@
self.tree_status_url = tree_status_url
def verify(self, pending):
- pending.verifications[self.name] = TreeStatus(
- tree_status_url=self.tree_status_url, issue=pending.issue)
+ if re.search(r'(?im)^NOTREECHECKS=TRUE$', pending.description):
+ # Use a TreeStatus instance that always returns False for postpone().
+ tree_status = AlwaysOpenTreeStatus()
+ else:
+ tree_status = TreeStatus(
+ tree_status_url=self.tree_status_url, issue=pending.issue)
+ pending.verifications[self.name] = tree_status
+
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