Frank Borden | 512ebc4 | 2023-01-25 16:21:40 +0100 | [diff] [blame] | 1 | # This is configuration for LUCI for the gerrit repo |
| 2 | # https://gerrit.googlesource.com/gerrit |
| 3 | |
| 4 | # Builders |
| 5 | |
| 6 | # Defines a builder to run the "gerrit" recipe in a given bucket. This |
| 7 | # will be hooked up to the CQ label rather than having a set schedule. |
| 8 | luci.builder( |
Frank Borden | 16c6093 | 2023-03-09 12:33:31 +0100 | [diff] [blame] | 9 | name = "Verify gerrit CL", |
| 10 | bucket = "try", |
| 11 | executable = luci.recipe( |
| 12 | # The name of the recipe we just made. |
| 13 | name = "gerrit", |
| 14 | ), |
| 15 | service_account = "gerrit-luci-try-builder@gerritcodereview-ci.iam.gserviceaccount.com", |
| 16 | dimensions = { |
| 17 | "os": "Ubuntu", |
| 18 | "cpu": "x86-64", |
| 19 | "pool": "luci.gerrit.try", |
| 20 | }, |
Frank Borden | 512ebc4 | 2023-01-25 16:21:40 +0100 | [diff] [blame] | 21 | ) |
| 22 | |
| 23 | # Create a CQ group to watch gerrit repo for changes. |
| 24 | luci.cq_group( |
Frank Borden | 16c6093 | 2023-03-09 12:33:31 +0100 | [diff] [blame] | 25 | name = "gerrit_repo", |
| 26 | acls = [ |
| 27 | # Everyone can trigger dry runs by voting CQ+1 |
| 28 | acl.entry( |
| 29 | acl.CQ_DRY_RUNNER, |
| 30 | groups = "all", |
| 31 | ), |
| 32 | # Everyone can Trigger dry runs by uploading a new patchset |
| 33 | acl.entry( |
| 34 | acl.CQ_NEW_PATCHSET_RUN_TRIGGERER, |
| 35 | groups = "all", |
| 36 | ), |
| 37 | # Every CQ+2 should be able to submit since rights to vote CQ+2 are |
| 38 | # well-controlled on the Gerrit side. |
| 39 | acl.entry( |
| 40 | acl.CQ_COMMITTER, |
| 41 | groups = "all", |
| 42 | ), |
| 43 | ], |
| 44 | watch = cq.refset( |
| 45 | repo = "https://gerrit.googlesource.com/gerrit", |
| 46 | refs = ["refs/heads/master"], |
Frank Borden | 512ebc4 | 2023-01-25 16:21:40 +0100 | [diff] [blame] | 47 | ), |
Frank Borden | 7e4ddbd | 2023-05-04 11:04:19 +0200 | [diff] [blame] | 48 | post_actions = [ |
| 49 | cq.post_action_gerrit_label_votes( |
Frank Borden | 7e4ddbd | 2023-05-04 11:04:19 +0200 | [diff] [blame] | 50 | name = "success", |
| 51 | conditions = [ |
| 52 | cq.post_action_triggering_condition( |
| 53 | mode = cq.MODE_DRY_RUN, |
| 54 | statuses=[cq.STATUS_SUCCEEDED], |
| 55 | ), |
| 56 | cq.post_action_triggering_condition( |
| 57 | mode = cq.MODE_NEW_PATCHSET_RUN, |
| 58 | statuses=[cq.STATUS_SUCCEEDED], |
| 59 | ), |
| 60 | ], |
| 61 | labels = {"Frontend-Verified": 1}, |
| 62 | ), |
| 63 | cq.post_action_gerrit_label_votes( |
| 64 | name = "failure", |
| 65 | conditions = [ |
| 66 | cq.post_action_triggering_condition( |
| 67 | mode = cq.MODE_DRY_RUN, |
| 68 | statuses=[cq.STATUS_FAILED, cq.STATUS_CANCELLED], |
| 69 | ), |
| 70 | cq.post_action_triggering_condition( |
| 71 | mode = cq.MODE_NEW_PATCHSET_RUN, |
| 72 | statuses=[cq.STATUS_FAILED, cq.STATUS_CANCELLED], |
| 73 | ), |
| 74 | ], |
| 75 | labels = {"Frontend-Verified": -1}, |
| 76 | ), |
| 77 | ], |
Frank Borden | 512ebc4 | 2023-01-25 16:21:40 +0100 | [diff] [blame] | 78 | ) |
| 79 | |
| 80 | # Attach our "Verify gerrit CL" builder to this CQ group. |
| 81 | luci.cq_tryjob_verifier( |
Frank Borden | 16c6093 | 2023-03-09 12:33:31 +0100 | [diff] [blame] | 82 | builder = "try/Verify gerrit CL", |
| 83 | cq_group = "gerrit_repo", |
| 84 | # Add NEW_PATCHSET_RUN to the defaults DRY_RUN and FULL_RUN |
| 85 | mode_allowlist = [ |
| 86 | cq.MODE_DRY_RUN, |
| 87 | cq.MODE_FULL_RUN, |
| 88 | cq.MODE_NEW_PATCHSET_RUN, |
| 89 | ], |
Frank Borden | 8f57f59 | 2023-04-12 15:55:41 +0200 | [diff] [blame] | 90 | location_filters = [ |
| 91 | cq.location_filter( |
| 92 | path_regexp = 'polygerrit-ui/.+' |
| 93 | ), |
| 94 | ], |
Frank Borden | 0f92d59 | 2023-02-23 17:21:03 +0100 | [diff] [blame] | 95 | ) |
| 96 | |
| 97 | # Show on https://ci.chromium.org/p/gerrit |
| 98 | luci.list_view( |
Frank Borden | 16c6093 | 2023-03-09 12:33:31 +0100 | [diff] [blame] | 99 | name = "gerrit", |
| 100 | title = "gerrit builders", |
| 101 | entries = [luci.list_view_entry(builder = "try/Verify gerrit CL")], |
Frank Borden | 0f92d59 | 2023-02-23 17:21:03 +0100 | [diff] [blame] | 102 | ) |