From b8b6afad8cffae2ab1a98baeaa6bc87064f023c3 Mon Sep 17 00:00:00 2001 From: Andrei Vagin Date: Thu, 15 Feb 2024 11:23:53 -0800 Subject: [PATCH] buildkite: set the same tag for all test changes STABLE_VERSION depends on the most recent tag, so let's set the same tag for all tests changes to better utilize the bazel cache. With this change, the syscall tests will not be re-executed if no code changes are introduced. PiperOrigin-RevId: 607398034 --- .buildkite/hooks/pre-command | 11 +++++++++++ tools/make_release.sh | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/.buildkite/hooks/pre-command b/.buildkite/hooks/pre-command index 11de5c228..40ad254dc 100644 --- a/.buildkite/hooks/pre-command +++ b/.buildkite/hooks/pre-command @@ -53,6 +53,17 @@ export PARTITION=${BUILDKITE_PARALLEL_JOB:-0} PARTITION=$((${PARTITION}+1)) # 1-indexed, but PARALLEL_JOB is 0-indexed. export TOTAL_PARTITIONS=${BUILDKITE_PARALLEL_JOB_COUNT:-1} +if [[ "${BUILDKITE_BRANCH}" =~ ^test/ ]]; then + # STABLE_VERSION depends on the most recent tag, so let's set the same tag + # for all tests changes to better utilize the bazel cache. We have to be sure + # that binaries depends only on code changes but not metadata such as commit + # id. + + # LINT.IfChange + git tag -f buildkite-test-branch + # LINT.ThenChange(../../tools/make_release.sh) +fi + # Set the system-wide Docker runtime name after the BuildKite branch name. # Remove any slashes and other characters that are not supported in Docker # runtime names. The runtime name must be a single valid path component. diff --git a/tools/make_release.sh b/tools/make_release.sh index 32605896b..8823b189d 100755 --- a/tools/make_release.sh +++ b/tools/make_release.sh @@ -72,6 +72,11 @@ else # Note that a given commit can match any number of tags. We have to iterate # through all possible tags and produce associated artifacts. for tag in ${tags}; do + # LINT.IfChange + if [[ "$tag" == "buildkite-test-branch" ]]; then + continue + fi + # LINT.ThenChange(../.buildkite/hooks/pre-command) name=$(echo "${tag}" | cut -d'-' -f2) base=$(echo "${name}" | cut -d'.' -f1) # Install the "specific" release. This is the latest release with the