Harden CI against transient Bazelisk setup failures#264
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves GitHub Actions CI resilience by retrying Bazelisk setup and adding an explicit “tool is installed” verification step before running Bazel fetch/build/test work.
Changes:
- Add a two-attempt
bazel-contrib/setup-bazel(Bazelisk) installation sequence with a conditional second attempt. - Add a post-setup verification step intended to fail fast when Bazelisk is not usable.
- Apply the same pattern across macOS and Linux CI workflows/jobs.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
.github/workflows/ci_macos.yml |
Adds two-attempt Bazelisk setup plus a verification step in macOS build_and_test and sanitizers jobs. |
.github/workflows/ci_linux.yml |
Adds two-attempt Bazelisk setup plus a verification step across Linux build_and_test, asan, and tsan jobs. |
Comments suppressed due to low confidence (2)
.github/workflows/ci_linux.yml:118
- The workflow verifies
bazelisk, but subsequent steps in this job use thebazelcommand (bazel fetch/test). To fail fast on a missing toolchain, verifybazelis available (or verify bothbazelandbazelisk).
- name: Verify Bazelisk installation
run: bazelisk version || (echo "Failed to install Bazelisk after two setup attempts, or Bazelisk is not available on PATH." && exit 1)
.github/workflows/ci_linux.yml:179
- The workflow verifies
bazelisk, but subsequent steps in this job use thebazelcommand (bazel fetch/test). To fail fast on a missing toolchain, verifybazelis available (or verify bothbazelandbazelisk).
- name: Verify Bazelisk installation
run: bazelisk version || (echo "Failed to install Bazelisk after two setup attempts, or Bazelisk is not available on PATH." && exit 1)
zzcgumn
left a comment
There was a problem hiding this comment.
This looks like an improvement which I am happy to merge. Is there a way to move the duplicated code to a separate script that is invoked from two places?
Deduplicate the retry-and-verify Bazelisk install across CI workflows so version and retry policy live in one place. Co-authored-by: Cursor <cursoragent@cursor.com>
Possible and desirable. Done. This also highlighted that the change was missing from Windows and WASM builds. It's now everywhere. All four CI workflows call it with: That’s 7 call sites (Linux ×3, macOS ×2, Windows, WASM). |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
.github/workflows/ci_linux.yml:32
- The PR description still frames the resilience change as macOS-specific, but this PR updates all CI workflows (Linux/Windows/WASM/macOS) to use the new
./.github/actions/setup-bazeliskcomposite action. Please update the PR description to reflect the broader scope (or, if unintended, revert the non-macOS workflow changes).
# 3️⃣ Install Bazelisk (recommended Bazel launcher)
- name: Setup Bazelisk
uses: ./.github/actions/setup-bazelisk
Avoid a Bash-only dependency on Windows runners while keeping one composite action for all CI platforms. Co-authored-by: Cursor <cursoragent@cursor.com>
pwsh is not always available on Linux runners after free-disk-space, so pick the verify shell per OS in the shared action. Co-authored-by: Cursor <cursoragent@cursor.com>
build_and_testfailed before any Bazel build/test work due to a timeout inbazel-contrib/setup-bazel(api.github.comconnect timeout). This change makes Bazelisk setup resilient to transient network failure in the macOS CI path.Workflow resilience update (
.github/workflows/ci_macos.yml)build_and_test.Fail-fast verification
bazeliskis actually available before fetch/build/test steps.