blob: a81311eb1f4d6316176dc81f5066903ddf6ffd7d [file] [log] [blame]
Frank Borden512ebc42023-01-25 16:21:40 +01001# 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.
8luci.builder(
Frank Borden16c60932023-03-09 12:33:31 +01009 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 Borden512ebc42023-01-25 16:21:40 +010021)
22
23# Create a CQ group to watch gerrit repo for changes.
24luci.cq_group(
Frank Borden16c60932023-03-09 12:33:31 +010025 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 Borden512ebc42023-01-25 16:21:40 +010047 ),
Frank Borden7e4ddbd2023-05-04 11:04:19 +020048 post_actions = [
49 cq.post_action_gerrit_label_votes(
Frank Borden7e4ddbd2023-05-04 11:04:19 +020050 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 Borden512ebc42023-01-25 16:21:40 +010078)
79
80# Attach our "Verify gerrit CL" builder to this CQ group.
81luci.cq_tryjob_verifier(
Frank Borden16c60932023-03-09 12:33:31 +010082 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 Borden8f57f592023-04-12 15:55:41 +020090 location_filters = [
91 cq.location_filter(
92 path_regexp = 'polygerrit-ui/.+'
93 ),
94 ],
Frank Borden0f92d592023-02-23 17:21:03 +010095)
96
97# Show on https://ci.chromium.org/p/gerrit
98luci.list_view(
Frank Borden16c60932023-03-09 12:33:31 +010099 name = "gerrit",
100 title = "gerrit builders",
101 entries = [luci.list_view_entry(builder = "try/Verify gerrit CL")],
Frank Borden0f92d592023-02-23 17:21:03 +0100102)