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

Side by Side Diff: infra/recipe_modules/hacky_tryserver_detection/api.py

Issue 1641363002: Adds bot_update to depot_tools. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Don't delete the old files in this CL. Created 4 years, 10 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 unified diff | Download patch
OLDNEW
(Empty)
1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 from recipe_engine import recipe_api
6
7 PATCH_STORAGE_GIT = 'git'
8
9 class HackyTryserverDetectionApi(recipe_api.RecipeApi):
10 @property
11 def patch_url(self):
12 """Reads patch_url property and corrects it if needed."""
13 url = self.m.properties.get('patch_url')
14 return url
15
16 @property
17 def is_tryserver(self):
18 """Returns true iff we can apply_issue or patch."""
19 return (self.can_apply_issue or self.is_patch_in_svn or
20 self.is_patch_in_git or self.is_gerrit_issue)
21
22 @property
23 def can_apply_issue(self):
24 """Returns true iff the properties exist to apply_issue from rietveld."""
25 return (self.m.properties.get('rietveld')
26 and 'issue' in self.m.properties
27 and 'patchset' in self.m.properties)
28
29 @property
30 def is_gerrit_issue(self):
31 """Returns true iff the properties exist to match a Gerrit issue."""
32 return ('event.patchSet.ref' in self.m.properties and
33 'event.change.url' in self.m.properties and
34 'event.change.id' in self.m.properties)
35
36 @property
37 def is_patch_in_svn(self):
38 """Returns true iff the properties exist to patch from a patch URL."""
39 return self.patch_url
40
41 @property
42 def is_patch_in_git(self):
43 return (self.m.properties.get('patch_storage') == PATCH_STORAGE_GIT and
44 self.m.properties.get('patch_repo_url') and
45 self.m.properties.get('patch_ref'))
46
OLDNEW
« no previous file with comments | « infra/recipe_modules/hacky_tryserver_detection/__init__.py ('k') | infra/recipe_modules/hacky_tryserver_detection/example.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698