aboutsummaryrefslogtreecommitdiffhomepage
path: root/infra/bots/recipe_modules
diff options
context:
space:
mode:
authorGravatar rmistry <rmistry@google.com>2016-08-24 05:07:06 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-08-24 05:07:06 -0700
commit3f1c9c0a7227d4ea45c39eb1e596538bb483f65a (patch)
tree55208de5c2469cc70cedce760ae3a753d75f0b66 /infra/bots/recipe_modules
parent6a88206b2ece8b64534c87fca156e5fe161f884e (diff)
Apply gerrit ref if it is a Gerrit patch.
Also: * Pass through a new property 'patch_storage' to DM/Nanobench/Coverage. This will be used by the different frameworks to figure out if it is Rietveld or Gerrit issue. * Calculate issue and patchset for Gerrit patches similar to Rietveld. BUG=skia:5627 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2263323002 Review-Url: https://codereview.chromium.org/2263323002
Diffstat (limited to 'infra/bots/recipe_modules')
-rw-r--r--infra/bots/recipe_modules/core/__init__.py1
-rw-r--r--infra/bots/recipe_modules/core/api.py3
-rw-r--r--infra/bots/recipe_modules/vars/api.py11
3 files changed, 11 insertions, 4 deletions
diff --git a/infra/bots/recipe_modules/core/__init__.py b/infra/bots/recipe_modules/core/__init__.py
index df4078b271..8fe6053715 100644
--- a/infra/bots/recipe_modules/core/__init__.py
+++ b/infra/bots/recipe_modules/core/__init__.py
@@ -4,6 +4,7 @@
DEPS = [
'build/file',
+ 'depot_tools/bot_update',
'depot_tools/gclient',
'depot_tools/tryserver',
'flavor',
diff --git a/infra/bots/recipe_modules/core/api.py b/infra/bots/recipe_modules/core/api.py
index e65073cb36..bc96d99a85 100644
--- a/infra/bots/recipe_modules/core/api.py
+++ b/infra/bots/recipe_modules/core/api.py
@@ -140,6 +140,9 @@ class SkiaApi(recipe_api.RecipeApi):
self.m.vars.got_revision = (
update_step.presentation.properties['got_revision'])
self.m.tryserver.maybe_apply_issue()
+ if self.m.properties.get('patch_storage') == 'gerrit':
+ self.m.bot_update.apply_gerrit_ref(
+ root=str(self.m.vars.checkout_root.join('skia')))
if self.m.vars.need_chromium_checkout:
self.m.gclient.runhooks(cwd=self.m.vars.checkout_root,
diff --git a/infra/bots/recipe_modules/vars/api.py b/infra/bots/recipe_modules/vars/api.py
index e2d0ed99c0..5418e26022 100644
--- a/infra/bots/recipe_modules/vars/api.py
+++ b/infra/bots/recipe_modules/vars/api.py
@@ -110,13 +110,16 @@ class SkiaVarsApi(recipe_api.RecipeApi):
self.default_env.update({'SKIA_OUT': self.skia_out,
'BUILDTYPE': self.configuration})
self.is_trybot = self.builder_cfg['is_trybot']
+ self.patch_storage = self.m.properties.get('patch_storage', '')
self.issue = None
self.patchset = None
- self.rietveld = None
if self.is_trybot:
- self.issue = self.m.properties['issue']
- self.patchset = self.m.properties['patchset']
- self.rietveld = self.m.properties['rietveld']
+ if self.patch_storage == 'gerrit':
+ self.issue = self.m.properties['event.change.number']
+ self.patchset = self.m.properties['event.patchSet.ref'].split('/')[-1]
+ else:
+ self.issue = self.m.properties['issue']
+ self.patchset = self.m.properties['patchset']
self.dm_dir = self.m.path.join(
self.swarming_out_dir, 'dm')
self.perf_data_dir = self.m.path.join(self.swarming_out_dir,