main.star 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. #!/usr/bin/env lucicfg
  2. # Copyright 2020 The Chromium Authors. All rights reserved.
  3. # Use of this source code is governed by a BSD-style license that can be
  4. # found in the LICENSE file.
  5. # See https://chromium.googlesource.com/infra/luci/luci-go/+/HEAD/lucicfg/doc/README.md
  6. # for information on starlark/lucicfg
  7. load("//lib/branches.star", "branches")
  8. load("//project.star", "settings")
  9. lucicfg.check_version(
  10. min = "1.31.1",
  11. message = "Update depot_tools",
  12. )
  13. # Use LUCI Scheduler BBv2 names and add Scheduler realms configs.
  14. lucicfg.enable_experiment("crbug.com/1182002")
  15. # Tell lucicfg what files it is allowed to touch
  16. lucicfg.config(
  17. config_dir = "generated",
  18. tracked_files = [
  19. "builders/*/*/*",
  20. "cq-builders.md",
  21. "cq-usage/default.cfg",
  22. "cq-usage/full.cfg",
  23. "luci/commit-queue.cfg",
  24. "luci/chops-weetbix.cfg",
  25. "luci/cr-buildbucket.cfg",
  26. "luci/luci-logdog.cfg",
  27. "luci/luci-milo.cfg",
  28. "luci/luci-notify.cfg",
  29. "luci/luci-notify/email-templates/*.template",
  30. "luci/luci-scheduler.cfg",
  31. "luci/project.cfg",
  32. "luci/realms.cfg",
  33. "luci/tricium-prod.cfg",
  34. "outages.pyl",
  35. "sheriff-rotations/*.txt",
  36. "project.pyl",
  37. ],
  38. fail_on_warnings = True,
  39. lint_checks = [
  40. "default",
  41. "-confusing-name",
  42. "-function-docstring",
  43. "-function-docstring-args",
  44. "-function-docstring-return",
  45. "-function-docstring-header",
  46. "-module-docstring",
  47. ],
  48. )
  49. # Just copy tricium-prod.cfg to the generated outputs
  50. lucicfg.emit(
  51. dest = "luci/tricium-prod.cfg",
  52. data = io.read_file("tricium-prod.cfg"),
  53. )
  54. # Weetbix configuration is also copied verbatim to generated
  55. # outputs.
  56. lucicfg.emit(
  57. dest = "luci/chops-weetbix.cfg",
  58. data = io.read_file("chops-weetbix.cfg"),
  59. )
  60. luci.project(
  61. name = settings.project,
  62. config_dir = "luci",
  63. buildbucket = "cr-buildbucket.appspot.com",
  64. logdog = "luci-logdog.appspot.com",
  65. milo = "luci-milo.appspot.com",
  66. notify = "luci-notify.appspot.com",
  67. scheduler = "luci-scheduler.appspot.com",
  68. swarming = "chromium-swarm.appspot.com",
  69. acls = [
  70. acl.entry(
  71. roles = [
  72. acl.LOGDOG_READER,
  73. acl.PROJECT_CONFIGS_READER,
  74. acl.SCHEDULER_READER,
  75. ],
  76. groups = "all",
  77. ),
  78. acl.entry(
  79. roles = acl.LOGDOG_WRITER,
  80. groups = "luci-logdog-chromium-writers",
  81. ),
  82. acl.entry(
  83. roles = acl.SCHEDULER_OWNER,
  84. groups = "project-chromium-admins",
  85. ),
  86. ],
  87. bindings = [
  88. luci.binding(
  89. roles = "role/configs.validator",
  90. groups = "project-chromium-try-task-accounts",
  91. ),
  92. luci.binding(
  93. roles = "role/weetbix.reader",
  94. groups = "all",
  95. ),
  96. luci.binding(
  97. roles = "role/weetbix.queryUser",
  98. groups = "authenticated-users",
  99. ),
  100. luci.binding(
  101. roles = "role/weetbix.editor",
  102. groups = "project-chromium-committers",
  103. ),
  104. ],
  105. )
  106. luci.cq(
  107. submit_max_burst = 2,
  108. submit_burst_delay = time.minute,
  109. status_host = "chromium-cq-status.appspot.com",
  110. )
  111. luci.logdog(
  112. gs_bucket = "chromium-luci-logdog",
  113. )
  114. luci.milo(
  115. logo = "https://storage.googleapis.com/chrome-infra-public/logo/chromium.svg",
  116. )
  117. luci.notify(
  118. tree_closing_enabled = True,
  119. )
  120. # An all-purpose public realm.
  121. luci.realm(
  122. name = "public",
  123. bindings = [
  124. luci.binding(
  125. roles = "role/buildbucket.reader",
  126. groups = "all",
  127. ),
  128. luci.binding(
  129. roles = "role/resultdb.invocationCreator",
  130. groups = "project-chromium-tryjob-access",
  131. ),
  132. # Other roles are inherited from @root which grants them to group:all.
  133. ],
  134. )
  135. luci.realm(
  136. name = "ci",
  137. bindings = [
  138. # Allow CI builders to create invocations in their own builds.
  139. luci.binding(
  140. roles = "role/resultdb.invocationCreator",
  141. groups = "project-chromium-ci-task-accounts",
  142. ),
  143. ],
  144. )
  145. luci.realm(
  146. name = "try",
  147. bindings = [
  148. # Allow try builders to create invocations in their own builds.
  149. luci.binding(
  150. roles = "role/resultdb.invocationCreator",
  151. groups = [
  152. "project-chromium-try-task-accounts",
  153. # In order to be able to reproduce test tasks that have
  154. # ResultDB enabled (at this point that should be all
  155. # tests), a realm must be provided. The ability to
  156. # trigger machines in the test pool is associated with
  157. # the try realm, so allow those who can trigger swarming
  158. # tasks in that pool tasks to create invocations.
  159. "chromium-led-users",
  160. "project-chromium-tryjob-access",
  161. ],
  162. ),
  163. ],
  164. )
  165. luci.realm(
  166. name = "webrtc",
  167. bindings = [
  168. # Allow WebRTC builders to create invocations in their own builds.
  169. luci.binding(
  170. roles = "role/resultdb.invocationCreator",
  171. groups = "project-chromium-ci-task-accounts",
  172. ),
  173. ],
  174. )
  175. luci.builder.defaults.test_presentation.set(resultdb.test_presentation(grouping_keys = ["status", "v.test_suite"]))
  176. exec("//swarming.star")
  177. exec("//recipes.star")
  178. exec("//notifiers.star")
  179. exec("//subprojects/chromium/subproject.star")
  180. branches.exec("//subprojects/codesearch/subproject.star")
  181. branches.exec("//subprojects/findit/subproject.star")
  182. branches.exec("//subprojects/flakiness/subproject.star")
  183. branches.exec("//subprojects/goma/subproject.star")
  184. branches.exec("//subprojects/reclient/subproject.star")
  185. branches.exec("//subprojects/reviver/subproject.star")
  186. branches.exec("//subprojects/webrtc/subproject.star")
  187. exec("//generators/cq-usage.star")
  188. branches.exec("//generators/cq-builders-md.star")
  189. exec("//generators/sort-consoles.star")
  190. exec("//validators/builders-in-consoles.star")
  191. # Execute this file last so that any configuration changes needed for handling
  192. # outages gets final say
  193. exec("//outages/outages.star")