Commit 0c3081e3 authored by Garrett Beaty's avatar Garrett Beaty Committed by Commit Bot

Push details out of settings into the actual config code.

This will reduce the amount of manual change that must be made when
updating configuration for a branch and put more values inline in the
config.

Change-Id: I033beff961f1d88a30795e12ca7f784abd0c331a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2551668
Auto-Submit: Garrett Beaty <gbeaty@chromium.org>
Reviewed-by: default avatarErik Staab <estaab@chromium.org>
Commit-Queue: Erik Staab <estaab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#829857}
parent c0b4d41c
......@@ -402,5 +402,5 @@ HEADER = _header(
]],
),
],
tree_status_host = settings.tree_status_host,
tree_status_host = branches.value(for_main = "chromium-status.appspot.com"),
)
......@@ -5,13 +5,10 @@
def _project_settings(
*,
project,
branch_title,
project_title,
is_master,
is_lts_branch,
ref,
cq_ref_regexp,
try_triggering_projects,
tree_status_host):
ref):
"""Declare settings for the project.
This provides the central location for what must be modified when
......@@ -21,54 +18,34 @@ def _project_settings(
Args:
* project - The name of the LUCI project.
* branch_title - A string identifying the branch in console titles.
* project_title - A string identifying the project in title contexts (e.g.
titles of consoles).
* is_master - Whether this branch is main/master/trunk.
* is_lts_branch - Whether this branch is in the LTS channel.
* ref - The git ref containing the code for this branch.
* cq_ref_regexp - A regular expression determining the git refs that the
CQ group for this project should watch.
* try_trigger_projects - A list of names of other LUCI projects whose CQ
is allowed to trigger this project's try builders. None can also be
passed to prohibit other projects' CQ from triggering this project's try
builders.
* tree_status_host - The host of the tree status app associated with this
project. Builders with tree closers configured will notify this host and
CQ attempts will block if the host indicates the tree is closed. It also
appears at the top of the console header. None indicates there is no
associated tree status app for the project.
"""
if is_master and is_lts_branch:
fail("is_master and is_lts_branch can't both be True")
return struct(
project = project,
project_title = project_title,
is_master = is_master,
is_lts_branch = is_lts_branch,
ref = ref,
cq_ref_regexp = cq_ref_regexp,
try_triggering_projects = try_triggering_projects,
tree_status_host = tree_status_host,
main_console_title = "{} Main Console".format(branch_title),
cq_mirrors_console_title = "{} CQ Mirrors Console".format(branch_title),
main_list_view_title = "{} CQ Console".format(branch_title),
)
settings = _project_settings(
# Set this to the name of the milestone's project
project = "chromium",
# Set this to how the branch should be referred to in console titles
branch_title = "Chromium",
# Set this to how the project should be referred to in a title context (e.g.
# for project chromium-mXX, the project title would be Chromium MXX)
project_title = "Chromium",
# Set this to False for branches
is_master = True,
# Set this to True for LTC/LTS branches
is_lts_branch = False,
# Set this to the branch ref for branches
ref = "refs/heads/master",
# Set this to the branch ref for branches
cq_ref_regexp = "refs/heads/.+",
# Set this to None for branches
try_triggering_projects = ["angle", "dawn", "skia", "v8"],
# Set this to None for branches
tree_status_host = "chromium-status.appspot.com",
)
def _generate_project_pyl(ctx):
......
......@@ -84,8 +84,8 @@ luci.gitiles_poller(
"chromium.updater",
],
) for name, title in (
("main", settings.main_console_title),
("mirrors", settings.cq_mirrors_console_title),
("main", "{} Main Console".format(settings.project_title)),
("mirrors", "{} CQ Mirrors Console".format(settings.project_title)),
)]
ci.console_view(
......
......@@ -53,7 +53,7 @@ luci.bucket(
"service-account-chromeperf",
"service-account-cq",
],
projects = settings.try_triggering_projects,
projects = branches.value(for_main = ["angle", "dawn", "skia", "v8"]),
),
acl.entry(
roles = acl.BUILDBUCKET_OWNER,
......@@ -65,10 +65,17 @@ luci.bucket(
luci.cq_group(
name = "cq",
retry_config = cq.RETRY_ALL_FAILURES,
tree_status_host = settings.tree_status_host,
tree_status_host = branches.value(for_main = "chromium-status.appspot.com"),
watch = cq.refset(
repo = "https://chromium.googlesource.com/chromium/src",
refs = [settings.cq_ref_regexp],
refs = [branches.value(
# The chromium project's CQ covers all of the refs under refs/heads,
# which includes refs/heads/master
for_main = "refs/heads/.+",
# For projects running out of a branch, the CQ only runs for that
# ref
for_branches = settings.ref,
)],
),
acls = [
acl.entry(
......@@ -87,7 +94,7 @@ luci.cq_group(
try_.list_view(
name = "try",
branch_selector = branches.ALL_BRANCHES,
title = settings.main_list_view_title,
title = "{} CQ Console".format(settings.project_title),
)
try_.list_view(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment