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

Side by Side Diff: scripts/master/gatekeeper.py

Issue 744913002: Restore order to the universe. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Created 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | scripts/master/goodrevisions.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """A StatusReceiver module to potentially close the tree when needed. 5 """A StatusReceiver module to potentially close the tree when needed.
6 6
7 The GateKeeper class can be given a dictionary of categories of builder to a set 7 The GateKeeper class can be given a dictionary of categories of builder to a set
8 of critical steps to validate. If no steps are given for a category, we simply 8 of critical steps to validate. If no steps are given for a category, we simply
9 check the results for FAILURES. If no categories are given, we check all 9 check the results for FAILURES. If no categories are given, we check all
10 builders for FAILURES results. A dictionary of builder steps exclusions can also 10 builders for FAILURES results. A dictionary of builder steps exclusions can also
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 used by the GitPoller(s). Implies that this 58 used by the GitPoller(s). Implies that this
59 GateKeeper will be operating in git mode for a given 59 GateKeeper will be operating in git mode for a given
60 repository url. 60 repository url.
61 61
62 @type branches: [String] or None 62 @type branches: [String] or None
63 @param branches: A list of strings defining branches of interest. If None 63 @param branches: A list of strings defining branches of interest. If None
64 (the default) indicates that all branches are of interest. 64 (the default) indicates that all branches are of interest.
65 65
66 @type password: String. 66 @type password: String.
67 @param password: Password for service. If None, look in 67 @param password: Password for service. If None, look in
68 .chromium_status_password. 68 .status_password.
69 """ 69 """
70 if throttle: 70 if throttle:
71 adjective = 'throttled' 71 adjective = 'throttled'
72 gerund = 'throttling' 72 gerund = 'throttling'
73 else: 73 else:
74 adjective = 'closed' 74 adjective = 'closed'
75 gerund = 'closing' 75 gerund = 'closing'
76 # Set defaults. 76 # Set defaults.
77 kwargs.setdefault('sheriffs', ['sheriff']) 77 kwargs.setdefault('sheriffs', ['sheriff'])
78 kwargs.setdefault('sendToInterestedUsers', True) 78 kwargs.setdefault('sendToInterestedUsers', True)
(...skipping 11 matching lines...) Expand all
90 self._last_closure_revision = 0 90 self._last_closure_revision = 0
91 self.interesting_branches = branches 91 self.interesting_branches = branches
92 92
93 # Set up variables for operating on commits in a Git repository. 93 # Set up variables for operating on commits in a Git repository.
94 self.gitpoller_paths = gitpoller_paths or {} 94 self.gitpoller_paths = gitpoller_paths or {}
95 self.checkouts = {} 95 self.checkouts = {}
96 96
97 self.password = None 97 self.password = None
98 if tree_status_url: 98 if tree_status_url:
99 self.password = get_password.Password( 99 self.password = get_password.Password(
100 '.chromium_status_password').GetPassword() 100 '.status_password').GetPassword()
101 101
102 102
103 @staticmethod 103 @staticmethod
104 def msg(message, **kwargs): 104 def msg(message, **kwargs):
105 log.msg('[gatekeeper] ' + message, **kwargs) 105 log.msg('[gatekeeper] ' + message, **kwargs)
106 106
107 def getGitRepo(self, repository_url): 107 def getGitRepo(self, repository_url):
108 """Returns a GitHelper object if the repository at the given url 108 """Returns a GitHelper object if the repository at the given url
109 is mapped to a gitpoller path. 109 is mapped to a gitpoller path.
110 """ 110 """
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 GateKeeper.msg('Failed to close the tree at rev %s' % 294 GateKeeper.msg('Failed to close the tree at rev %s' %
295 str(latest_revision)) 295 str(latest_revision))
296 296
297 # Trigger the HTTP POST request to update the tree status. 297 # Trigger the HTTP POST request to update the tree status.
298 headers = {'Content-Type': 'application/x-www-form-urlencoded'} 298 headers = {'Content-Type': 'application/x-www-form-urlencoded'}
299 connection = client.getPage(self.tree_status_url, method='POST', 299 connection = client.getPage(self.tree_status_url, method='POST',
300 postdata=params, headers=headers, 300 postdata=params, headers=headers,
301 agent='buildbot') 301 agent='buildbot')
302 connection.addCallbacks(success, failure) 302 connection.addCallbacks(success, failure)
303 return connection 303 return connection
OLDNEW
« no previous file with comments | « no previous file | scripts/master/goodrevisions.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698