Skip to content

Commit ab3f2a6

Browse files
authored
Avoid generate duplicated tasks (#2093)
Previously, bazel version defined in the matrix was still expanded via the "old_bazel" attributes, leading to duplicated tasks: - https://buildkite.com/bazel/bcr-bazel-compatibility-test/builds/22#0192d96c-70d2-4057-a659-c9944b421a0b - https://buildkite.com/bazel/bcr-bazel-compatibility-test/builds/22#0192d96c-70dc-458b-bd72-637d99898ac5 This PR flattens bazel versions in the matrix to a single string to avoid that while still keeping a nice warning message like ``` Bazel version overridden from 6.x, 7.x to 8.0.0rc2 ```
1 parent 3dcd4a3 commit ab3f2a6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

buildkite/bazelci.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,6 +1042,10 @@ def maybe_overwrite_bazel_version(bazel_version, config):
10421042
for task in config.get("tasks", {}):
10431043
config["tasks"][task]["old_bazel"] = config["tasks"][task].get("bazel")
10441044
config["tasks"][task]["bazel"] = bazel_version
1045+
matrix = config.get("matrix", {})
1046+
if "bazel" in matrix:
1047+
# This will only apply to "old_bazel" and avoid generating multiple tasks with the same config
1048+
matrix["bazel"] = [", ".join(matrix["bazel"])]
10451049

10461050

10471051
def load_config(http_url, file_config, allow_imports=True, bazel_version=None):

0 commit comments

Comments
 (0)