infra: Make tryjobs run on change upload

Chromium's LUCI infrastructure gained the ability to automatically
trigger tryjobs on upload of a new or updated change.

https://crrev.com/c/3984801 was used as an example for this SwiftShader-
specific CL to enable this.

Bug: b/256820374
Change-Id: I724359c50bb8dd6917e36d078121c7f9fa759fd4
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/69448
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: use @chromium <jmadill@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Kokoro-Result: kokoro <noreply+kokoro@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
diff --git a/infra/config/generated/commit-queue.cfg b/infra/config/generated/commit-queue.cfg
index df9ed2f..18a85d9 100644
--- a/infra/config/generated/commit-queue.cfg
+++ b/infra/config/generated/commit-queue.cfg
@@ -22,9 +22,15 @@
     tryjob {
       builders {
         name: "chromium/try/linux-swangle-try-tot-swiftshader-x64"
+        mode_allowlist: "DRY_RUN"
+        mode_allowlist: "FULL_RUN"
+        mode_allowlist: "NEW_PATCHSET_RUN"
       }
       builders {
         name: "chromium/try/win-swangle-try-tot-swiftshader-x86"
+        mode_allowlist: "DRY_RUN"
+        mode_allowlist: "FULL_RUN"
+        mode_allowlist: "NEW_PATCHSET_RUN"
       }
       retry_config {
         single_quota: 1
diff --git a/infra/config/main.star b/infra/config/main.star
index 4c7d9f9..6270079 100755
--- a/infra/config/main.star
+++ b/infra/config/main.star
@@ -20,21 +20,30 @@
         refs = ["refs/heads/master"],
     ),
     acls = [
+        # Committers gonna commit.
         acl.entry(
             acl.CQ_COMMITTER,
             groups = "project-swiftshader-committers",
         ),
+        # Ability to launch CQ dry runs manually.
         acl.entry(
             acl.CQ_DRY_RUNNER,
             groups = "project-swiftshader-tryjob-access",
         ),
+        # Ability to automatically trigger new patchset runs on CV.
+        acl.entry(
+            roles = acl.CQ_NEW_PATCHSET_RUN_TRIGGERER,
+            groups = "project-swiftshader-tryjob-access",
+        ),
     ],
     verifiers = [
         luci.cq_tryjob_verifier(
             builder = "chromium:try/linux-swangle-try-tot-swiftshader-x64",
+            mode_allowlist = [cq.MODE_DRY_RUN, cq.MODE_FULL_RUN, cq.MODE_NEW_PATCHSET_RUN],
         ),
         luci.cq_tryjob_verifier(
             builder = "chromium:try/win-swangle-try-tot-swiftshader-x86",
+            mode_allowlist = [cq.MODE_DRY_RUN, cq.MODE_FULL_RUN, cq.MODE_NEW_PATCHSET_RUN],
         ),
     ],
 )