Enable Tint running Dawn try jobs on its CQ

Set ACLs to allow calling the builders and create uniquely named
builders, so there isn't a name collision.

BUG=tint:734

Change-Id: Ic3e61eac6fcc2f097f8be778abaecde642bdd665
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/54100
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
diff --git a/infra/config/global/generated/cr-buildbucket.cfg b/infra/config/global/generated/cr-buildbucket.cfg
index 318035c..90d6d12 100644
--- a/infra/config/global/generated/cr-buildbucket.cfg
+++ b/infra/config/global/generated/cr-buildbucket.cfg
@@ -271,6 +271,10 @@
   }
   acls {
     role: SCHEDULER
+    group: "project-tint-tryjob-access"
+  }
+  acls {
+    role: SCHEDULER
     group: "service-account-cq"
   }
   swarming {
@@ -347,6 +351,24 @@
       service_account: "dawn-try-builder@chops-service-accounts.iam.gserviceaccount.com"
     }
     builders {
+      name: "linux-tint-rel"
+      swarming_host: "chromium-swarm.appspot.com"
+      dimensions: "cpu:x86-64"
+      dimensions: "os:Ubuntu-18.04"
+      dimensions: "pool:luci.flex.try"
+      recipe {
+        name: "dawn"
+        cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build"
+        cipd_version: "refs/heads/master"
+        properties_j: "$build/goma:{\"enable_ats\":true,\"rpc_extra_params\":\"?prod\",\"server_host\":\"goma.chromium.org\"}"
+        properties_j: "$depot_tools/bot_update:{\"apply_patch_on_gclient\":true}"
+        properties_j: "clang:true"
+        properties_j: "debug:false"
+        properties_j: "target_cpu:\"x64\""
+      }
+      service_account: "dawn-try-builder@chops-service-accounts.iam.gserviceaccount.com"
+    }
+    builders {
       name: "mac-dbg"
       swarming_host: "chromium-swarm.appspot.com"
       dimensions: "cpu:x86-64"
@@ -391,6 +413,50 @@
       service_account: "dawn-try-builder@chops-service-accounts.iam.gserviceaccount.com"
     }
     builders {
+      name: "mac-tint-rel"
+      swarming_host: "chromium-swarm.appspot.com"
+      dimensions: "cpu:x86-64"
+      dimensions: "os:Mac-10.15"
+      dimensions: "pool:luci.flex.try"
+      recipe {
+        name: "dawn"
+        cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build"
+        cipd_version: "refs/heads/master"
+        properties_j: "$build/goma:{\"rpc_extra_params\":\"?prod\",\"server_host\":\"goma.chromium.org\"}"
+        properties_j: "$depot_tools/bot_update:{\"apply_patch_on_gclient\":true}"
+        properties_j: "clang:true"
+        properties_j: "debug:false"
+        properties_j: "target_cpu:\"x64\""
+      }
+      caches {
+        name: "osx_sdk"
+        path: "osx_sdk"
+      }
+      service_account: "dawn-try-builder@chops-service-accounts.iam.gserviceaccount.com"
+    }
+    builders {
+      name: "msvc-tint-rel"
+      swarming_host: "chromium-swarm.appspot.com"
+      dimensions: "cpu:x86-64"
+      dimensions: "os:Mac-10.15"
+      dimensions: "pool:luci.flex.try"
+      recipe {
+        name: "dawn"
+        cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build"
+        cipd_version: "refs/heads/master"
+        properties_j: "$build/goma:{\"rpc_extra_params\":\"?prod\",\"server_host\":\"goma.chromium.org\"}"
+        properties_j: "$depot_tools/bot_update:{\"apply_patch_on_gclient\":true}"
+        properties_j: "clang:false"
+        properties_j: "debug:false"
+        properties_j: "target_cpu:\"x64\""
+      }
+      caches {
+        name: "osx_sdk"
+        path: "osx_sdk"
+      }
+      service_account: "dawn-try-builder@chops-service-accounts.iam.gserviceaccount.com"
+    }
+    builders {
       name: "presubmit"
       swarming_host: "chromium-swarm.appspot.com"
       dimensions: "cpu:x86-64"
@@ -528,5 +594,27 @@
       }
       service_account: "dawn-try-builder@chops-service-accounts.iam.gserviceaccount.com"
     }
+    builders {
+      name: "win-tint-rel"
+      swarming_host: "chromium-swarm.appspot.com"
+      dimensions: "cpu:x86-64"
+      dimensions: "os:Windows-10"
+      dimensions: "pool:luci.flex.try"
+      recipe {
+        name: "dawn"
+        cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build"
+        cipd_version: "refs/heads/master"
+        properties_j: "$build/goma:{\"enable_ats\":true,\"rpc_extra_params\":\"?prod\",\"server_host\":\"goma.chromium.org\"}"
+        properties_j: "$depot_tools/bot_update:{\"apply_patch_on_gclient\":true}"
+        properties_j: "clang:true"
+        properties_j: "debug:false"
+        properties_j: "target_cpu:\"x64\""
+      }
+      caches {
+        name: "win_toolchain"
+        path: "win_toolchain"
+      }
+      service_account: "dawn-try-builder@chops-service-accounts.iam.gserviceaccount.com"
+    }
   }
 }
diff --git a/infra/config/global/generated/luci-milo.cfg b/infra/config/global/generated/luci-milo.cfg
index 5770d7d..4690349 100644
--- a/infra/config/global/generated/luci-milo.cfg
+++ b/infra/config/global/generated/luci-milo.cfg
@@ -118,6 +118,18 @@
   builders {
     name: "buildbucket/luci.dawn.try/win-msvc-rel-x64"
   }
+  builders {
+    name: "buildbucket/luci.dawn.try/linux-tint-rel"
+  }
+  builders {
+    name: "buildbucket/luci.dawn.try/mac-tint-rel"
+  }
+  builders {
+    name: "buildbucket/luci.dawn.try/win-tint-rel"
+  }
+  builders {
+    name: "buildbucket/luci.dawn.try/msvc-tint-rel"
+  }
   builder_view_only: true
 }
 logo_url: "https://storage.googleapis.com/chrome-infra-public/logo/dawn-logo.png"
diff --git a/infra/config/global/main.star b/infra/config/global/main.star
index 52bf63a..ba271ff 100644
--- a/infra/config/global/main.star
+++ b/infra/config/global/main.star
@@ -70,6 +70,7 @@
             acl.BUILDBUCKET_TRIGGERER,
             groups = [
                 "project-dawn-tryjob-access",
+                "project-tint-tryjob-access",
                 "service-account-cq",
             ],
         ),
@@ -333,6 +334,25 @@
         builder = "chromium:try/" + os + "-dawn-rel",
     )
 
+def dawn_tint_builder(name, clang = True):
+    """Adds builder(s) for Tint to run Dawn tests in its CQ.
+
+    These builders have the same configuration as the standard Dawn
+    try bots, but different names, so they don't collide with the
+    names used by Tint's CQ.
+
+    Args:
+      name: builder's name in string form
+      clang: Use llvm compiler
+    """
+    os = get_os_from_arg(name)
+
+    add_try_builder(name, os, clang, False, "x64", False)
+    luci.list_view_entry(
+        list_view = "try",
+        builder = "try/" + name,
+    )
+
 luci.gitiles_poller(
     name = "primary-poller",
     bucket = "ci",
@@ -385,6 +405,11 @@
 chromium_dawn_tryjob("mac")
 chromium_dawn_tryjob("win")
 
+dawn_tint_builder("linux-tint-rel")
+dawn_tint_builder("mac-tint-rel")
+dawn_tint_builder("win-tint-rel")
+dawn_tint_builder("msvc-tint-rel", False)
+
 # Views
 
 luci.milo(