Fix recipes for Gerrit property rename

NOTREECHECKS=true
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2455523004

Review-Url: https://codereview.chromium.org/2455523004
diff --git a/infra/bots/recipe_modules/vars/api.py b/infra/bots/recipe_modules/vars/api.py
index 85e5921..eea6e36 100644
--- a/infra/bots/recipe_modules/vars/api.py
+++ b/infra/bots/recipe_modules/vars/api.py
@@ -120,17 +120,17 @@
         self.is_trybot = True
         self.issue = self.m.properties['issue']
         self.patchset = self.m.properties['patchset']
-      elif (self.m.properties.get('event.change.number', '') and
-            self.m.properties.get('event.patchSet.ref', '')):
+      elif (self.m.properties.get('patch_issue', '') and
+            self.m.properties.get('patch_ref', '')):
         self.is_trybot = True
-        self.issue = self.m.properties['event.change.number']
-        self.patchset = self.m.properties['event.patchSet.ref'].split('/')[-1]
+        self.issue = self.m.properties['patch_issue']
+        self.patchset = self.m.properties['patch_ref'].split('/')[-1]
     else:
       self.is_trybot = self.builder_cfg['is_trybot']
       if self.is_trybot:
         if self.patch_storage == 'gerrit':
-          self.issue = self.m.properties['event.change.number']
-          self.patchset = self.m.properties['event.patchSet.ref'].split('/')[-1]
+          self.issue = self.m.properties['patch_issue']
+          self.patchset = self.m.properties['patch_ref'].split('/')[-1]
         else:
           self.issue = self.m.properties['issue']
           self.patchset = self.m.properties['patchset']
diff --git a/infra/bots/recipes/swarm_compile.expected/buildbotless_trybot_gerrit.json b/infra/bots/recipes/swarm_compile.expected/buildbotless_trybot_gerrit.json
index dab9d34..e7fd2cb 100644
--- a/infra/bots/recipes/swarm_compile.expected/buildbotless_trybot_gerrit.json
+++ b/infra/bots/recipes/swarm_compile.expected/buildbotless_trybot_gerrit.json
@@ -34,10 +34,10 @@
       "{\"skia\": \"got_revision\"}",
       "--git-cache-dir",
       "[CUSTOM_C:\\_B_CACHE]",
-      "--issue",
-      "500",
-      "--patchset",
-      "1",
+      "--gerrit_repo",
+      "skia",
+      "--gerrit_ref",
+      "refs/changes/89/456789/12",
       "--output_json",
       "/path/to/tmp/json",
       "--revision",
diff --git a/infra/bots/recipes/swarm_compile.expected/recipe_with_gerrit_patch.json b/infra/bots/recipes/swarm_compile.expected/recipe_with_gerrit_patch.json
index cc0eef6..08da211 100644
--- a/infra/bots/recipes/swarm_compile.expected/recipe_with_gerrit_patch.json
+++ b/infra/bots/recipes/swarm_compile.expected/recipe_with_gerrit_patch.json
@@ -35,9 +35,9 @@
       "--git-cache-dir",
       "[CUSTOM_C:\\_B_CACHE]",
       "--gerrit_repo",
-      "skia",
+      "https://skia.googlesource.com/skia",
       "--gerrit_ref",
-      "refs/changes/00/2100/2",
+      "refs/changes/89/456789/12",
       "--output_json",
       "/path/to/tmp/json",
       "--revision",
diff --git a/infra/bots/recipes/swarm_compile.py b/infra/bots/recipes/swarm_compile.py
index cf4f46f..a85e90f 100644
--- a/infra/bots/recipes/swarm_compile.py
+++ b/infra/bots/recipes/swarm_compile.py
@@ -175,12 +175,6 @@
       api.platform('win', 64)
   )
 
-  gerrit_kwargs = {
-    'patch_storage': 'gerrit',
-    'repository': 'skia',
-    'event.patchSet.ref': 'refs/changes/00/2100/2',
-    'event.change.number': '2100',
-  }
   yield (
       api.test('recipe_with_gerrit_patch') +
       api.properties(
@@ -191,7 +185,12 @@
           path_config='kitchen',
           swarm_out_dir='[SWARM_OUT_DIR]',
           revision='abc123',
-          **gerrit_kwargs) +
+          patch_storage='gerrit') +
+      api.properties.tryserver(
+          buildername=buildername + '-Trybot',
+          gerrit_project='skia',
+          gerrit_url='https://skia-review.googlesource.com/',
+      ) +
       api.platform('win', 64)
   )
 
@@ -226,9 +225,13 @@
           swarm_out_dir='[SWARM_OUT_DIR]',
           revision='abc123',
           nobuildbot='True',
-          issue=500,
-          patchset=1,
-          patch_storage='gerrit',
-          gerrit='https://skia-review.googlesource.com') +
+          patch_issue=500,
+          patch_set=1,
+          patch_storage='gerrit') +
+      api.properties.tryserver(
+          buildername=buildername,
+          gerrit_project='skia',
+          gerrit_url='https://skia-review.googlesource.com/',
+      ) +
       api.platform('win', 64)
   )
diff --git a/infra/bots/recipes/swarm_perf.expected/nobuildbot.json b/infra/bots/recipes/swarm_perf.expected/nobuildbot.json
index 26c22ab..d31e978 100644
--- a/infra/bots/recipes/swarm_perf.expected/nobuildbot.json
+++ b/infra/bots/recipes/swarm_perf.expected/nobuildbot.json
@@ -190,11 +190,11 @@
       "gitHash",
       "abc123",
       "build_number",
-      "5",
+      "571",
       "issue",
-      "2100",
+      "456789",
       "patchset",
-      "2",
+      "12",
       "patch_storage",
       "gerrit",
       "no_buildbot",
diff --git a/infra/bots/recipes/swarm_perf.py b/infra/bots/recipes/swarm_perf.py
index 95948aa..70d9775 100644
--- a/infra/bots/recipes/swarm_perf.py
+++ b/infra/bots/recipes/swarm_perf.py
@@ -320,37 +320,44 @@
     api.platform('win', 64)
   )
 
-  gerrit_kwargs = {
-    'patch_storage': 'gerrit',
-    'repository': 'skia',
-    'event.patchSet.ref': 'refs/changes/00/2100/2',
-    'event.change.number': '2100',
-  }
+  builder = ('Perf-Ubuntu-GCC-ShuttleA-GPU-GTX550Ti-x86_64-Release-Valgrind-'
+             'Trybot')
   yield (
       api.test('recipe_with_gerrit_patch') +
       api.properties(
-          buildername='Perf-Ubuntu-GCC-ShuttleA-GPU-GTX550Ti-x86_64-Release-' +
-                      'Valgrind-Trybot',
+          buildername=builder,
           mastername='client.skia',
           slavename='skiabot-linux-swarm-000',
           buildnumber=5,
           path_config='kitchen',
           swarm_out_dir='[SWARM_OUT_DIR]',
           revision='abc123',
-          **gerrit_kwargs)
+          patch_storage='gerrit') +
+      api.properties.tryserver(
+          buildername=builder,
+          gerrit_project='skia',
+          gerrit_url='https://skia-review.googlesource.com/',
+      )
   )
 
+  builder = 'Perf-Win8-MSVC-ShuttleB-GPU-HD4600-x86_64-Release-Trybot'
   yield (
       api.test('nobuildbot') +
-      api.properties(buildername=builder,
-                     mastername='client.skia',
-                     slavename='skiabot-linux-swarm-000',
-                     buildnumber=5,
-                     revision='abc123',
-                     path_config='kitchen',
-                     nobuildbot='True',
-                     swarm_out_dir='[SWARM_OUT_DIR]',
-                     **gerrit_kwargs) +
+      api.properties(
+          buildername=builder,
+          mastername='client.skia',
+          slavename='skiabot-linux-swarm-000',
+          buildnumber=5,
+          revision='abc123',
+          path_config='kitchen',
+          nobuildbot='True',
+          swarm_out_dir='[SWARM_OUT_DIR]',
+          patch_storage='gerrit') +
+      api.properties.tryserver(
+          buildername=builder,
+          gerrit_project='skia',
+          gerrit_url='https://skia-review.googlesource.com/',
+      ) +
       api.path.exists(
           api.path['slave_build'].join('skia'),
           api.path['slave_build'].join('skia', 'infra', 'bots', 'assets',
diff --git a/infra/bots/recipes/swarm_test.expected/nobuildbot.json b/infra/bots/recipes/swarm_test.expected/nobuildbot.json
index 92944e0..73f1502 100644
--- a/infra/bots/recipes/swarm_test.expected/nobuildbot.json
+++ b/infra/bots/recipes/swarm_test.expected/nobuildbot.json
@@ -219,15 +219,15 @@
       "gitHash",
       "abc123",
       "master",
-      "client.skia",
+      "chromium.testing.master",
       "builder",
       "Test-Ubuntu-GCC-GCE-CPU-AVX2-x86-Debug-Trybot",
       "build_number",
-      "5",
+      "571",
       "issue",
-      "2100",
+      "456789",
       "patchset",
-      "2",
+      "12",
       "patch_storage",
       "gerrit",
       "no_buildbot",
diff --git a/infra/bots/recipes/swarm_test.expected/recipe_with_gerrit_patch.json b/infra/bots/recipes/swarm_test.expected/recipe_with_gerrit_patch.json
index a00b453..88927b4 100644
--- a/infra/bots/recipes/swarm_test.expected/recipe_with_gerrit_patch.json
+++ b/infra/bots/recipes/swarm_test.expected/recipe_with_gerrit_patch.json
@@ -191,15 +191,15 @@
       "gitHash",
       "abc123",
       "master",
-      "client.skia",
+      "chromium.testing.master",
       "builder",
       "Test-Ubuntu-GCC-GCE-CPU-AVX2-x86-Debug-Trybot",
       "build_number",
-      "5",
+      "571",
       "issue",
-      "2100",
+      "456789",
       "patchset",
-      "2",
+      "12",
       "patch_storage",
       "gerrit",
       "--svgs",
diff --git a/infra/bots/recipes/swarm_test.py b/infra/bots/recipes/swarm_test.py
index a84de46..24c9518 100644
--- a/infra/bots/recipes/swarm_test.py
+++ b/infra/bots/recipes/swarm_test.py
@@ -677,12 +677,6 @@
   )
 
   builder = 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86-Debug-Trybot'
-  gerrit_kwargs = {
-    'patch_storage': 'gerrit',
-    'repository': 'skia',
-    'event.patchSet.ref': 'refs/changes/00/2100/2',
-    'event.change.number': '2100',
-  }
   yield (
       api.test('recipe_with_gerrit_patch') +
       api.properties(
@@ -693,7 +687,12 @@
           path_config='kitchen',
           swarm_out_dir='[SWARM_OUT_DIR]',
           revision='abc123',
-          **gerrit_kwargs)
+          patch_storage='gerrit') +
+      api.properties.tryserver(
+          buildername=builder,
+          gerrit_project='skia',
+          gerrit_url='https://skia-review.googlesource.com/',
+      )
   )
 
   yield (
@@ -707,7 +706,12 @@
           swarm_out_dir='[SWARM_OUT_DIR]',
           revision='abc123',
           nobuildbot='True',
-          **gerrit_kwargs) +
+          patch_storage='gerrit') +
+      api.properties.tryserver(
+          buildername=builder,
+          gerrit_project='skia',
+          gerrit_url='https://skia-review.googlesource.com/',
+      ) +
       api.step_data('get swarming bot id',
           stdout=api.raw_io.output('skia-bot-123')) +
       api.step_data('get swarming task id', stdout=api.raw_io.output('123456'))
diff --git a/infra/bots/recipes/swarm_trigger.expected/recipe_with_gerrit_patch.json b/infra/bots/recipes/swarm_trigger.expected/recipe_with_gerrit_patch.json
index 5ac2417..c4b7585 100644
--- a/infra/bots/recipes/swarm_trigger.expected/recipe_with_gerrit_patch.json
+++ b/infra/bots/recipes/swarm_trigger.expected/recipe_with_gerrit_patch.json
@@ -4,7 +4,7 @@
       "python",
       "-u",
       "\nimport json\nimport sys\n\nwith open(sys.argv[1]) as f:\n  content = json.load(f)\n\nprint json.dumps(content, indent=2)\n",
-      "{\"buildername\": \"Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-Trybot\", \"buildnumber\": 5, \"event.change.number\": \"2100\", \"event.patchSet.ref\": \"refs/changes/00/2100/2\", \"mastername\": \"client.skia\", \"patch_storage\": \"gerrit\", \"path_config\": \"kitchen\", \"recipe\": \"swarm_trigger\", \"repository\": \"skia\", \"revision\": \"abc123\", \"slavename\": \"skiabot-linux-swarm-000\"}"
+      "{\"buildername\": \"Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-Trybot\", \"buildnumber\": 5, \"mastername\": \"client.skia\", \"patch_issue\": \"2100\", \"patch_ref\": \"refs/changes/00/2100/2\", \"patch_set\": \"2\", \"patch_storage\": \"gerrit\", \"path_config\": \"kitchen\", \"recipe\": \"swarm_trigger\", \"repository\": \"skia\", \"revision\": \"abc123\", \"slavename\": \"skiabot-linux-swarm-000\"}"
     ],
     "name": "print properties",
     "~followup_annotations": [
@@ -371,16 +371,16 @@
       "--workdir",
       "../../..",
       "swarm_compile",
-      "event.change.number=2100",
       "repository=skia",
       "buildername=Build-Ubuntu-GCC-x86_64-Debug-Trybot",
       "mastername=client.skia.compile",
+      "patch_issue=2100",
       "patch_storage=gerrit",
       "buildnumber=1",
       "slavename=skiabot-dummy-compile-slave",
       "reason=Triggered by Skia swarm_trigger Recipe",
       "swarm_out_dir=${ISOLATED_OUTDIR}",
-      "event.patchSet.ref=refs/changes/00/2100/2",
+      "patch_ref=refs/changes/00/2100/2",
       "revision=abc123"
     ],
     "name": "[trigger] compile_skia on Ubuntu",
@@ -649,16 +649,16 @@
       "--workdir",
       "../../..",
       "swarm_test",
-      "event.change.number=2100",
       "repository=skia",
       "buildername=Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-Trybot",
       "mastername=client.skia",
+      "patch_issue=2100",
       "patch_storage=gerrit",
       "buildnumber=5",
       "slavename=skiabot-linux-swarm-000",
       "reason=Triggered by Skia swarm_trigger Recipe",
       "swarm_out_dir=${ISOLATED_OUTDIR}",
-      "event.patchSet.ref=refs/changes/00/2100/2",
+      "patch_ref=refs/changes/00/2100/2",
       "revision=abc123"
     ],
     "name": "[trigger] test_skia on Ubuntu",
@@ -892,16 +892,16 @@
       "--workdir",
       "../../..",
       "upload_dm_results",
-      "event.change.number=2100",
       "repository=skia",
       "buildername=Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-Trybot",
       "mastername=client.skia",
+      "patch_issue=2100",
       "patch_storage=gerrit",
       "buildnumber=5",
       "slavename=skiabot-linux-swarm-000",
       "reason=Triggered by Skia swarm_trigger Recipe",
       "swarm_out_dir=${ISOLATED_OUTDIR}",
-      "event.patchSet.ref=refs/changes/00/2100/2",
+      "patch_ref=refs/changes/00/2100/2",
       "revision=abc123"
     ],
     "name": "[trigger] upload_dm_results_skia on Linux",
diff --git a/infra/bots/recipes/swarm_trigger.py b/infra/bots/recipes/swarm_trigger.py
index cf77c0f..2869552 100644
--- a/infra/bots/recipes/swarm_trigger.py
+++ b/infra/bots/recipes/swarm_trigger.py
@@ -214,8 +214,8 @@
     if api.properties.get('patch_storage') == 'gerrit':
       properties['patch_storage'] = api.properties['patch_storage']
       properties['repository'] = api.properties['repository']
-      properties['event.patchSet.ref'] = api.properties['event.patchSet.ref']
-      properties['event.change.number'] = api.properties['event.change.number']
+      properties['patch_ref'] = api.properties['patch_ref']
+      properties['patch_issue'] = api.properties['patch_issue']
     else:
       properties['issue'] = str(api.properties['issue'])
       properties['patchset'] = str(api.properties['patchset'])
@@ -749,8 +749,9 @@
   gerrit_kwargs = {
     'patch_storage': 'gerrit',
     'repository': 'skia',
-    'event.patchSet.ref': 'refs/changes/00/2100/2',
-    'event.change.number': '2100',
+    'patch_ref': 'refs/changes/00/2100/2',
+    'patch_issue': '2100',
+    'patch_set': '2',
   }
   yield (
       api.test('recipe_with_gerrit_patch') +
diff --git a/infra/bots/recipes/upload_dm_results.expected/recipe_with_gerrit_patch.json b/infra/bots/recipes/upload_dm_results.expected/recipe_with_gerrit_patch.json
index b65631f..3d3a87a 100644
--- a/infra/bots/recipes/upload_dm_results.expected/recipe_with_gerrit_patch.json
+++ b/infra/bots/recipes/upload_dm_results.expected/recipe_with_gerrit_patch.json
@@ -99,7 +99,7 @@
       "-z",
       "json,log",
       "[CWD]/tmp_upload/*",
-      "gs://skia-infra-gm/trybot/dm-json-v1/2012/05/14/12/abc123/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-Trybot/1337000001/2100/2"
+      "gs://skia-infra-gm/trybot/dm-json-v1/2012/05/14/12/abc123/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-Trybot/1337000001/456789/12"
     ],
     "name": "upload JSON and logs"
   },
diff --git a/infra/bots/recipes/upload_dm_results.py b/infra/bots/recipes/upload_dm_results.py
index 4298b70..dffcc92 100644
--- a/infra/bots/recipes/upload_dm_results.py
+++ b/infra/bots/recipes/upload_dm_results.py
@@ -88,8 +88,8 @@
   patchset = str(api.properties.get('patchset', ''))
   if (api.properties.get('patch_storage', '') == 'gerrit' and
       api.properties.get('nobuildbot', '') != 'True'):
-    issue = str(api.properties['event.change.number'])
-    patchset = str(api.properties['event.patchSet.ref']).split('/')[-1]
+    issue = str(api.properties['patch_issue'])
+    patchset = str(api.properties['patch_ref']).split('/')[-1]
   if issue and patchset:
     summary_dest_path = '/'.join((
         'trybot', summary_dest_path, issue, patchset))
@@ -139,17 +139,16 @@
                    patchset='1002')
   )
 
-  gerrit_kwargs = {
-    'patch_storage': 'gerrit',
-    'repository': 'skia',
-    'event.patchSet.ref': 'refs/changes/00/2100/2',
-    'event.change.number': '2100',
-  }
   yield (
       api.test('recipe_with_gerrit_patch') +
       api.properties(
           buildername=builder,
           revision='abc123',
           path_config='kitchen',
-          **gerrit_kwargs)
+          patch_storage='gerrit') +
+      api.properties.tryserver(
+          buildername=builder,
+          gerrit_project='skia',
+          gerrit_url='https://skia-review.googlesource.com/',
+      )
   )
diff --git a/infra/bots/recipes/upload_nano_results.expected/recipe_with_gerrit_patch.json b/infra/bots/recipes/upload_nano_results.expected/recipe_with_gerrit_patch.json
index 1ed5afe..fdf449f 100644
--- a/infra/bots/recipes/upload_nano_results.expected/recipe_with_gerrit_patch.json
+++ b/infra/bots/recipes/upload_nano_results.expected/recipe_with_gerrit_patch.json
@@ -19,7 +19,7 @@
       "-z",
       "json",
       "[CWD]/perfdata/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-Trybot/data/nanobench_abc123.json",
-      "gs://skia-perf/trybot/nano-json-v1/2012/05/14/12/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-Trybot/2100/2/nanobench_abc123.json"
+      "gs://skia-perf/trybot/nano-json-v1/2012/05/14/12/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-Trybot/456789/12/nanobench_abc123.json"
     ],
     "name": "upload"
   },
diff --git a/infra/bots/recipes/upload_nano_results.py b/infra/bots/recipes/upload_nano_results.py
index 50883e7..cf71fdc 100644
--- a/infra/bots/recipes/upload_nano_results.py
+++ b/infra/bots/recipes/upload_nano_results.py
@@ -43,8 +43,8 @@
   patchset = str(api.properties.get('patchset', ''))
   if (api.properties.get('patch_storage', '') == 'gerrit' and
       api.properties.get('nobuildbot', '') != 'True'):
-    issue = str(api.properties['event.change.number'])
-    patchset = str(api.properties['event.patchSet.ref']).split('/')[-1]
+    issue = str(api.properties['patch_issue'])
+    patchset = str(api.properties['patch_ref']).split('/')[-1]
   if issue and patchset:
     gs_path = '/'.join(('trybot', gs_path, issue, patchset))
 
@@ -74,17 +74,16 @@
                    patchset='1002')
   )
 
-  gerrit_kwargs = {
-    'patch_storage': 'gerrit',
-    'repository': 'skia',
-    'event.patchSet.ref': 'refs/changes/00/2100/2',
-    'event.change.number': '2100',
-  }
   yield (
       api.test('recipe_with_gerrit_patch') +
       api.properties(
           buildername=builder,
           revision='abc123',
           path_config='kitchen',
-          **gerrit_kwargs)
+          patch_storage='gerrit') +
+      api.properties.tryserver(
+          buildername=builder,
+          gerrit_project='skia',
+          gerrit_url='https://skia-review.googlesource.com/',
+      )
   )
diff --git a/infra/config/recipes.cfg b/infra/config/recipes.cfg
index 1d3b0a7..a567b0d 100644
--- a/infra/config/recipes.cfg
+++ b/infra/config/recipes.cfg
@@ -5,17 +5,17 @@
   project_id: "build"
   url: "https://chromium.googlesource.com/chromium/tools/build.git"
   branch: "master"
-  revision: "6a6a57ff4c914c89b15b84be4a4fe327b75adc38"
+  revision: "b061208b3f8e9f45d4c436ad19d383dfb0ee5d98"
 }
 deps {
   project_id: "depot_tools"
   url: "https://chromium.googlesource.com/chromium/tools/depot_tools.git"
   branch: "master"
-  revision: "99e2cdf47a3f1083bde35d7553fda218fd7f37d6"
+  revision: "b655dbda883a2668433a54166ff1f42cddd13c8e"
 }
 deps {
   project_id: "recipe_engine"
   url: "https://chromium.googlesource.com/external/github.com/luci/recipes-py.git"
   branch: "master"
-  revision: "6e11fcc25f244f962bf750349a805bb3261977ff"
+  revision: "24a5bf068cee997aec0c60df51ca81bfa5ac5416"
 }