Copy over all build properties starting with patch_ to avoid missing something we need

BUG=skia:5946

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4542

Change-Id: I2c16ac84ceff598084263deb91795aa5b53cc42f
Reviewed-on: https://skia-review.googlesource.com/4542
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
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 bcff912..cc77eeb 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
@@ -375,13 +375,13 @@
       "repository=skia",
       "buildername=Build-Ubuntu-GCC-x86_64-Debug-Trybot",
       "mastername=client.skia.compile",
-      "patch_issue=2100",
       "patch_storage=gerrit",
+      "patch_ref=refs/changes/00/2100/2",
       "buildnumber=1",
       "slavename=skiabot-dummy-compile-slave",
       "reason=Triggered by Skia swarm_trigger Recipe",
       "swarm_out_dir=${ISOLATED_OUTDIR}",
-      "patch_ref=refs/changes/00/2100/2",
+      "patch_issue=2100",
       "revision=abc123"
     ],
     "name": "[trigger] compile_skia on Ubuntu",
@@ -654,13 +654,13 @@
       "repository=skia",
       "buildername=Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-Trybot",
       "mastername=client.skia",
-      "patch_issue=2100",
       "patch_storage=gerrit",
+      "patch_ref=refs/changes/00/2100/2",
       "buildnumber=5",
       "slavename=skiabot-linux-swarm-000",
       "reason=Triggered by Skia swarm_trigger Recipe",
       "swarm_out_dir=${ISOLATED_OUTDIR}",
-      "patch_ref=refs/changes/00/2100/2",
+      "patch_issue=2100",
       "revision=abc123"
     ],
     "name": "[trigger] test_skia on Ubuntu",
@@ -898,13 +898,13 @@
       "repository=skia",
       "buildername=Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-Trybot",
       "mastername=client.skia",
-      "patch_issue=2100",
       "patch_storage=gerrit",
+      "patch_ref=refs/changes/00/2100/2",
       "buildnumber=5",
       "slavename=skiabot-linux-swarm-000",
       "reason=Triggered by Skia swarm_trigger Recipe",
       "swarm_out_dir=${ISOLATED_OUTDIR}",
-      "patch_ref=refs/changes/00/2100/2",
+      "patch_issue=2100",
       "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 2547c79..40b5499 100644
--- a/infra/bots/recipes/swarm_trigger.py
+++ b/infra/bots/recipes/swarm_trigger.py
@@ -142,7 +142,7 @@
       dimensions['device'] = {
         # TODO(stephana): Remove this temporary discrepancy between the bot name
         # and device. When we expand iOS testing names and devices need to match
-        # again. 
+        # again.
         'iPad4': 'iPad5,1',
       }[builder_cfg['model']]
       # TODO(borenet): Replace this hack with something better.
@@ -217,11 +217,10 @@
   }
   if builder_cfg['is_trybot']:
     if api.properties.get('patch_storage') == 'gerrit':
-      properties['patch_storage'] = api.properties['patch_storage']
       properties['repository'] = api.properties['repository']
-      properties['patch_ref'] = api.properties['patch_ref']
-      properties['patch_set'] = api.properties['patch_set']
-      properties['patch_issue'] = api.properties['patch_issue']
+      for prop in api.properties:
+        if prop.startswith('patch_'):
+          properties[prop] = api.properties[prop]
     else:
       properties['issue'] = str(api.properties['issue'])
       properties['patchset'] = str(api.properties['patchset'])