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 @@ ...@@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
load("//lib/try.star", "INFRA_CONFIG_LOCATION_REGEXP") load("//lib/try.star", "DEFAULT_EXCLUDE_REGEXPS")
_MD_HEADER = """\ _MD_HEADER = """\
<!-- Auto-generated by lucicfg (via cq-builders-md.star). --> <!-- Auto-generated by lucicfg (via cq-builders-md.star). -->
...@@ -70,7 +70,7 @@ def _normalize_builder(builder): ...@@ -70,7 +70,7 @@ def _normalize_builder(builder):
location_regexp_exclude = [ location_regexp_exclude = [
r r
for r in builder.location_regexp_exclude 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 location_regexp = builder.location_regexp
if list(location_regexp) == [".*"] and not location_regexp_exclude: if list(location_regexp) == [".*"] and not location_regexp_exclude:
......
...@@ -22,7 +22,12 @@ load("@stdlib//internal/luci/common.star", "keys") ...@@ -22,7 +22,12 @@ load("@stdlib//internal/luci/common.star", "keys")
load("./builders.star", "builders") load("./builders.star", "builders")
load("./args.star", "args") 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( defaults = args.defaults(
extends = builders.defaults, extends = builders.defaults,
...@@ -160,22 +165,24 @@ def tryjob( ...@@ -160,22 +165,24 @@ def tryjob(
location_regexp = None, location_regexp = None,
location_regexp_exclude = None, location_regexp_exclude = None,
cancel_stale = None, cancel_stale = None,
run_on_infra_config_changes = False): add_default_excludes = True):
"""Specifies the details of a tryjob verifier. """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 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. for details on the most of the arguments.
Arguments: Arguments:
run_on_infra_changes - A bool indicating whether the try job should be run add_default_excludes - A bool indicating whether to add exclude regexps
for changes against //infra/config. 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: Returns:
A struct that can be passed to the `tryjob` argument of `try_.builder` to A struct that can be passed to the `tryjob` argument of `try_.builder` to
enable the builder for CQ. enable the builder for CQ.
""" """
if not run_on_infra_config_changes: if add_default_excludes:
location_regexp_exclude = [INFRA_CONFIG_LOCATION_REGEXP] + (location_regexp_exclude or []) location_regexp_exclude = DEFAULT_EXCLUDE_REGEXPS + (location_regexp_exclude or [])
return struct( return struct(
disable_reuse = disable_reuse, disable_reuse = disable_reuse,
experiment_percentage = experiment_percentage, experiment_percentage = experiment_percentage,
......
...@@ -345,7 +345,7 @@ try_.chromium_linux_builder( ...@@ -345,7 +345,7 @@ try_.chromium_linux_builder(
}, },
tryjob = try_.job( tryjob = try_.job(
disable_reuse = True, disable_reuse = True,
run_on_infra_config_changes = True, add_default_excludes = False,
), ),
) )
......
...@@ -306,7 +306,7 @@ try_.chromium_linux_builder( ...@@ -306,7 +306,7 @@ try_.chromium_linux_builder(
}, },
tryjob = try_.job( tryjob = try_.job(
disable_reuse = True, disable_reuse = True,
run_on_infra_config_changes = True, add_default_excludes = False,
), ),
) )
......
...@@ -311,7 +311,7 @@ try_.chromium_linux_builder( ...@@ -311,7 +311,7 @@ try_.chromium_linux_builder(
}, },
tryjob = try_.job( tryjob = try_.job(
disable_reuse = True, 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