Skip to content

Commit 46c47fe

Browse files
authored
Remove release-snapshot workflow; use release-build for bugbash (#4907)
## Summary - Remove the `release-snapshot` workflow, which is superseded by the `release-build` workflow introduced in #4900 - Add `demo-*` and `bugbash-*` branch triggers to `release-build` (previously only on `release-snapshot`) - Update the bugbash script to download from `release-build` and extract platform-specific archives instead of per-platform artifact directories - The `snapshot` GitHub release is no longer automatically populated on each push to `main`; it may take a little while for the new workflow's artifacts to become available ## Test plan - [x] Pushed a `bugbash-*` branch and confirmed `release-build` triggers and completes successfully - [x] Ran the updated bugbash script against the build artifact and confirmed it works This pull request was AI-assisted by Isaac.
1 parent 4b732a1 commit 46c47fe

3 files changed

Lines changed: 30 additions & 143 deletions

File tree

.github/workflows/release-build.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ on:
66
- "v*"
77
branches:
88
- "main"
9-
- "split-release-workflows"
9+
- "demo-*"
10+
- "bugbash-*"
1011

1112
workflow_dispatch:
1213

.github/workflows/release-snapshot.yml

Lines changed: 0 additions & 107 deletions
This file was deleted.

internal/bugbash/exec.sh

Lines changed: 28 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,43 +5,39 @@ set -euo pipefail
55
# Set the GitHub repository for the Databricks CLI.
66
export GH_REPO="databricks/cli"
77

8-
# Synthesize the directory name for the snapshot build.
9-
function cli_snapshot_directory() {
10-
dir="cli"
8+
# Synthesize the archive name for the snapshot build.
9+
function cli_snapshot_archive() {
10+
name="databricks_cli"
1111

1212
# Append OS
1313
case "$(uname -s)" in
1414
Linux)
15-
dir="${dir}_linux"
15+
name="${name}_linux"
1616
;;
1717
Darwin)
18-
dir="${dir}_darwin"
18+
name="${name}_darwin"
1919
;;
2020
*)
21-
echo "Unknown operating system: $os"
21+
echo "Unknown operating system: $(uname -s)"
22+
return 1
2223
;;
2324
esac
2425

2526
# Append architecture
2627
case "$(uname -m)" in
2728
x86_64)
28-
dir="${dir}_amd64_v1"
29-
;;
30-
i386|i686)
31-
dir="${dir}_386"
29+
name="${name}_amd64"
3230
;;
3331
arm64|aarch64)
34-
dir="${dir}_arm64_v8.0"
35-
;;
36-
armv7l|armv8l)
37-
dir="${dir}_arm_6"
32+
name="${name}_arm64"
3833
;;
3934
*)
40-
echo "Unknown architecture: $arch"
35+
echo "Unknown architecture: $(uname -m)"
36+
return 1
4137
;;
4238
esac
4339

44-
echo $dir
40+
echo "${name}.tar.gz"
4541
}
4642

4743
BRANCH=$1
@@ -72,39 +68,36 @@ echo "Looking for a snapshot build of the Databricks CLI on branch $BRANCH..."
7268

7369
# Find last successful build on $BRANCH.
7470
last_successful_run_id=$(
75-
gh run list -b "$BRANCH" -w release-snapshot --json 'databaseId,conclusion' |
71+
gh run list -b "$BRANCH" -w release-build --json 'databaseId,conclusion' |
7672
jq 'limit(1; .[] | select(.conclusion == "success")) | .databaseId'
7773
)
7874
if [ -z "$last_successful_run_id" ]; then
79-
echo "Unable to find last successful build of the release-snapshot workflow for branch $BRANCH."
75+
echo "Unable to find last successful build of the release-build workflow for branch $BRANCH."
8076
exit 1
8177
fi
8278

83-
# Determine artifact name with the right binaries for this runner.
84-
case "$(uname -s)" in
85-
Linux)
86-
artifact="cli_linux_snapshot"
87-
;;
88-
Darwin)
89-
artifact="cli_darwin_snapshot"
90-
;;
91-
esac
92-
93-
# Create a temporary directory to download the artifact.
79+
# Create a temporary directory to download and extract the artifact.
9480
dir=$(mktemp -d)
9581

9682
# Download the artifact.
9783
echo "Downloading the snapshot build..."
98-
gh run download "$last_successful_run_id" -n "$artifact" -D "$dir/.bin"
99-
dir="$dir/.bin/$(cli_snapshot_directory)"
100-
if [ ! -d "$dir" ]; then
101-
echo "Directory does not exist: $dir"
84+
gh run download "$last_successful_run_id" -n cli -D "$dir/.download"
85+
86+
# Extract the archive for this platform.
87+
archive=$(cli_snapshot_archive)
88+
if [ ! -f "$dir/.download/$archive" ]; then
89+
echo "Archive not found: $archive"
90+
echo "Available archives:"
91+
ls "$dir/.download/"
10292
exit 1
10393
fi
10494

95+
mkdir -p "$dir/.bin"
96+
tar -xzf "$dir/.download/$archive" -C "$dir/.bin"
97+
10598
# Make CLI available on $PATH.
106-
chmod +x "$dir/databricks"
107-
export PATH="$dir:$PATH"
99+
chmod +x "$dir/.bin/databricks"
100+
export PATH="$dir/.bin:$PATH"
108101

109102
# Set the prompt to indicate the bugbash environment and exec.
110103
export PS1="(bugbash $BRANCH) \[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ "

0 commit comments

Comments
 (0)