Build Bazel with embedded label for release candidate downstream test
@@ -1117,7 +1117,7 @@ def execute_commands(
bazel_version,
bazel_binary,
platform,
- build_flags,
+ build_flags + ["--embed_label=%s" % get_release_name_from_branch_name()] if save_but else [],
build_targets,
None,
incompatible_flags,
@@ -1325,6 +1325,11 @@ def current_branch_is_main_branch():
return os.getenv("BUILDKITE_BRANCH") in ("master", "stable", "main")
+def get_release_name_from_branch_name():
+ res = re.match(r"release-(\d+\.\d+\.\d+).*", os.getenv("BUILDKITE_BRANCH"))
+ return res.group(1) if res else ""
+
+
def is_pull_request():
third_party_repo = os.getenv("BUILDKITE_PULL_REQUEST_REPO", "")
return len(third_party_repo) > 0
