Commit 15d13a31 authored by Garrett Beaty's avatar Garrett Beaty Committed by Commit Bot

Prevent running the majority of CQ builders for changes to //docs.

Change-Id: I5587dff4225c4341ed80fa107cedf71b10f73e39
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2353331
Commit-Queue: Garrett Beaty <gbeaty@chromium.org>
Reviewed-by: default avatarBen Pastene <bpastene@chromium.org>
Cr-Commit-Position: refs/heads/master@{#797462}
parent 0dc98df5
This diff is collapsed.
......@@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
load("//lib/try.star", "INFRA_CONFIG_LOCATION_REGEXP")
load("//lib/try.star", "DEFAULT_EXCLUDE_REGEXPS")
_MD_HEADER = """\
<!-- Auto-generated by lucicfg (via cq-builders-md.star). -->
......@@ -70,7 +70,7 @@ def _normalize_builder(builder):
location_regexp_exclude = [
r
for r in builder.location_regexp_exclude
if r != INFRA_CONFIG_LOCATION_REGEXP
if r not in DEFAULT_EXCLUDE_REGEXPS
]
location_regexp = builder.location_regexp
if list(location_regexp) == [".*"] and not location_regexp_exclude:
......
......@@ -22,7 +22,12 @@ load("@stdlib//internal/luci/common.star", "keys")
load("./builders.star", "builders")
load("./args.star", "args")
INFRA_CONFIG_LOCATION_REGEXP = ".+/[+]/infra/config/.+"
DEFAULT_EXCLUDE_REGEXPS = [
# Contains documentation that doesn't affect the outputs
".+/[+]/docs/.+",
# Contains configuration files that aren't active until after committed
".+/[+]/infra/config/.+",
]
defaults = args.defaults(
extends = builders.defaults,
......@@ -160,22 +165,24 @@ def tryjob(
location_regexp = None,
location_regexp_exclude = None,
cancel_stale = None,
run_on_infra_config_changes = False):
add_default_excludes = True):
"""Specifies the details of a tryjob verifier.
See https://chromium.googlesource.com/infra/luci/luci-go/+/refs/heads/master/lucicfg/doc/README.md#luci.cq_tryjob_verifier
for details on the most of the arguments.
Arguments:
run_on_infra_changes - A bool indicating whether the try job should be run
for changes against //infra/config.
add_default_excludes - A bool indicating whether to add exclude regexps
for certain directories that would have no impact when building chromium
with the patch applied (docs, config files that don't take effect until
landing, etc., see DEFAULT_EXCLUDE_REGEXPS).
Returns:
A struct that can be passed to the `tryjob` argument of `try_.builder` to
enable the builder for CQ.
"""
if not run_on_infra_config_changes:
location_regexp_exclude = [INFRA_CONFIG_LOCATION_REGEXP] + (location_regexp_exclude or [])
if add_default_excludes:
location_regexp_exclude = DEFAULT_EXCLUDE_REGEXPS + (location_regexp_exclude or [])
return struct(
disable_reuse = disable_reuse,
experiment_percentage = experiment_percentage,
......
......@@ -345,7 +345,7 @@ try_.chromium_linux_builder(
},
tryjob = try_.job(
disable_reuse = True,
run_on_infra_config_changes = True,
add_default_excludes = False,
),
)
......
......@@ -306,7 +306,7 @@ try_.chromium_linux_builder(
},
tryjob = try_.job(
disable_reuse = True,
run_on_infra_config_changes = True,
add_default_excludes = False,
),
)
......
......@@ -311,7 +311,7 @@ try_.chromium_linux_builder(
},
tryjob = try_.job(
disable_reuse = True,
run_on_infra_config_changes = True,
add_default_excludes = False,
),
)
......
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