Commit 5ea9e9f6 authored by Garrett Beaty's avatar Garrett Beaty Committed by Chromium LUCI CQ

Specify the console_view value in ci.console_view_entry.

This is being modified so that the builder function can be modified to
accept multiple console view entries.

Change-Id: Ifb42b098cdd0a6d07a42ded71d88fee1a485a836
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2585049
Auto-Submit: Garrett Beaty <gbeaty@chromium.org>
Reviewed-by: default avatarStephen Martinis <martiniss@chromium.org>
Commit-Queue: Stephen Martinis <martiniss@chromium.org>
Cr-Commit-Position: refs/heads/master@{#835780}
parent fb7bb15b
......@@ -21,7 +21,6 @@ load("./builders.star", "builders")
defaults = args.defaults(
extends = builders.defaults,
console_view = args.COMPUTE,
header = None,
main_console_view = None,
cq_mirrors_console_view = None,
......@@ -257,8 +256,8 @@ def console_view(*, name, branch_selector = branches.MAIN, ordering = None, **kw
key in the dict. The ordering will be looked up by that key
instead.
kwargs - Additional keyword arguments to forward on to
`luci.console_view`. The header and repo arguments support
module-level defaults.
`luci.console_view`. The header, repo and refs arguments support
module-level defaults.
"""
if not branches.matches(branch_selector):
return
......@@ -311,17 +310,27 @@ def overview_console_view(*, name, top_level_ordering, branch_selector = branche
top_level_ordering = top_level_ordering,
)
def console_view_entry(*, category = None, short_name = None):
def console_view_entry(*, console_view = None, category = None, short_name = None):
"""Specifies the details of a console view entry.
See https://chromium.googlesource.com/infra/luci/luci-go/+/refs/heads/master/lucicfg/doc/README.md#luci.console_view_entry
for details on the arguments.
for more details on the arguments.
Args:
console_view - The console view to add an entry for the associated
builder to. By default, the entry will be for a console with the
same name as the builder's builder group, which the builder must
have.
category - The category of the builder in the console.
short_name - The short name of the builder in the console.
Returns:
A struct that can be passed to the `console_view_entry` argument of
`ci.builder` to add an entry to the console for the builder's group.
A struct that can be passed to the `console_view_entry` argument
of `ci.builder` in order to create a console view entry for the
builder.
"""
return struct(
console_view = console_view,
category = category,
short_name = short_name,
)
......@@ -330,10 +339,9 @@ def ci_builder(
*,
name,
branch_selector = branches.MAIN,
console_view = args.DEFAULT,
console_view_entry = None,
main_console_view = args.DEFAULT,
cq_mirrors_console_view = args.DEFAULT,
console_view_entry = None,
tree_closing = False,
notifies = None,
resultdb_bigquery_exports = None,
......@@ -346,9 +354,8 @@ def ci_builder(
branch_selector - A branch selector value controlling whether the
builder definition is executed. See branches.star for more
information.
console_view - A string identifying the ID of the console view to
add an entry to. Supports a module-level default that defaults to
the group of the builder, if provided.
console_view_entry - A structure providing the details of the entry
to add to the console view. See `ci.console_view_entry` for details.
main_console_view - A string identifying the ID of the main console
view to add an entry to. Supports a module-level default that
defaults to None. An entry will be added only if
......@@ -357,8 +364,6 @@ def ci_builder(
mirrors console view to add an entry to. Supports a module-level
default that defaults to None. An entry will be added only if
`console_view_entry` is provided.
console_view_entry - A structure providing the details of the entry
to add to the console view. See `ci.console_view_entry` for details.
tree_closing - If true, failed builds from this builder that meet certain
criteria will close the tree and email the sheriff. See the
'chromium-tree-closer' config in notifiers.star for the full criteria.
......@@ -412,43 +417,46 @@ def ci_builder(
)
if console_view_entry:
console_view = defaults.get_value("console_view", console_view)
if console_view == args.COMPUTE:
console_view = console_view_entry.console_view
if console_view == None:
console_view = defaults.get_value_from_kwargs("builder_group", kwargs)
if not console_view:
fail("Builder does not have builder group and " +
"console_view_entry does not have console view: {}"
.format(console_view_entry))
builder = "{}/{}".format(bucket, name)
luci.console_view_entry(
builder = builder,
console_view = console_view,
category = console_view_entry.category,
short_name = console_view_entry.short_name,
)
if console_view:
builder = "{}/{}".format(bucket, name)
overview_console_category = console_view
if console_view_entry.category:
overview_console_category = "|".join([console_view, console_view_entry.category])
main_console_view = defaults.get_value("main_console_view", main_console_view)
if main_console_view:
luci.console_view_entry(
builder = builder,
console_view = console_view,
category = console_view_entry.category,
console_view = main_console_view,
category = overview_console_category,
short_name = console_view_entry.short_name,
)
overview_console_category = console_view
if console_view_entry.category:
overview_console_category = "|".join([console_view, console_view_entry.category])
main_console_view = defaults.get_value("main_console_view", main_console_view)
if main_console_view:
luci.console_view_entry(
builder = builder,
console_view = main_console_view,
category = overview_console_category,
short_name = console_view_entry.short_name,
)
cq_mirrors_console_view = defaults.get_value(
"cq_mirrors_console_view",
cq_mirrors_console_view,
cq_mirrors_console_view = defaults.get_value(
"cq_mirrors_console_view",
cq_mirrors_console_view,
)
if cq_mirrors_console_view:
luci.console_view_entry(
builder = builder,
console_view = cq_mirrors_console_view,
category = overview_console_category,
short_name = console_view_entry.short_name,
)
if cq_mirrors_console_view:
luci.console_view_entry(
builder = builder,
console_view = cq_mirrors_console_view,
category = overview_console_category,
short_name = console_view_entry.short_name,
)
def android_builder(
*,
......
......@@ -409,8 +409,8 @@ ci.console_view(
ci.builder(
name = "android-androidx-packager",
console_view = "android.packager",
console_view_entry = ci.console_view_entry(
console_view = "android.packager",
short_name = "androidx",
),
executable = "recipe:android/androidx_packager",
......@@ -421,8 +421,8 @@ ci.builder(
ci.builder(
name = "android-avd-packager",
console_view = "android.packager",
console_view_entry = ci.console_view_entry(
console_view = "android.packager",
short_name = "avd",
),
executable = "recipe:android/avd_packager",
......@@ -444,8 +444,8 @@ ci.builder(
ci.builder(
name = "android-sdk-packager",
console_view = "android.packager",
console_view_entry = ci.console_view_entry(
console_view = "android.packager",
short_name = "sdk",
),
executable = "recipe:android/sdk_packager",
......@@ -1161,8 +1161,8 @@ ci.chromium_builder(
builderless = False,
# TODO(https://crbug.com/1072012) Use the default console view and add
# main_console_view = 'main' once the build is green
console_view = "chromium.fyi",
console_view_entry = ci.console_view_entry(
console_view = "chromium.fyi",
category = "linux",
short_name = "off",
),
......@@ -1201,8 +1201,8 @@ ci.chromium_builder(
builderless = False,
# TODO(https://crbug.com/1072012) Use the default console view and add
# main_console_view = 'main' once the build is green
console_view = "chromium.fyi",
console_view_entry = ci.console_view_entry(
console_view = "chromium.fyi",
category = "mac",
short_name = "off",
),
......@@ -4265,8 +4265,8 @@ ci.linux_builder(
ci.linux_builder(
name = "Leak Detection Linux",
console_view = "chromium.fyi",
console_view_entry = ci.console_view_entry(
console_view = "chromium.fyi",
category = "linux",
short_name = "lk",
),
......@@ -4419,8 +4419,8 @@ ci.linux_builder(
ci.linux_builder(
name = "Linux Ozone Tester (Headless)",
branch_selector = branches.STANDARD_MILESTONE,
console_view = "chromium.fyi",
console_view_entry = ci.console_view_entry(
console_view = "chromium.fyi",
category = "linux",
short_name = "loh",
),
......@@ -4432,8 +4432,8 @@ ci.linux_builder(
ci.linux_builder(
name = "Linux Ozone Tester (Wayland)",
branch_selector = branches.STANDARD_MILESTONE,
console_view = "chromium.fyi",
console_view_entry = ci.console_view_entry(
console_view = "chromium.fyi",
category = "linux",
short_name = "low",
),
......@@ -4445,8 +4445,8 @@ ci.linux_builder(
ci.linux_builder(
name = "Linux Ozone Tester (X11)",
branch_selector = branches.STANDARD_MILESTONE,
console_view = "chromium.fyi",
console_view_entry = ci.console_view_entry(
console_view = "chromium.fyi",
category = "linux",
short_name = "lox",
),
......@@ -4509,8 +4509,9 @@ ci.linux_builder(
ci.linux_builder(
name = "metadata-exporter",
console_view = "metadata.exporter",
console_view_entry = ci.console_view_entry(),
console_view_entry = ci.console_view_entry(
console_view = "metadata.exporter",
),
executable = "recipe:chromium_export_metadata",
service_account = "component-mapping-updater@chops-service-accounts.iam.gserviceaccount.com",
notifies = ["metadata-mapping"],
......@@ -4691,10 +4692,10 @@ ci.mac_ios_builder(
ci.memory_builder(
name = "Android CFI",
# TODO(https://crbug.com/1008094) When this builder is not consistently
# failing, remove the console_view value
console_view = "chromium.android.fyi",
console_view_entry = ci.console_view_entry(
# TODO(https://crbug.com/1008094) When this builder is not consistently
# failing, remove the console_view value
console_view = "chromium.android.fyi",
category = "memory",
short_name = "cfi",
),
......
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