Skip to content

workflow: download Bazelisk and Bazel with retries and mirror fallback - #4325

Merged
rickeylev merged 1 commit into
mainfrom
fix_bazelisk_download_retry
Oct 23, 2026
Merged

rickeylev merged 1 commit into
mainfrom
fix_bazelisk_download_retry

Conversation

@rickeylev

Copy link
Copy Markdown
Collaborator

bazel-contrib/setup-bazel resolves bazelisk-version by querying the
GitHub Releases API without retries—which intermittently returns an
empty [] response—and downloads the binary without retries or SHA-256
verification. Additionally, Bazelisk does not retry mid-stream transfer
failures when downloading the Bazel binary.

Replace the bazelisk-version input and shell retry script with a
Python download script in the setup-bazel composite action. The
script downloads Bazelisk directly from GitHub Releases with an npm
registry tarball fallback, verifies SHA-256 checksums, caches the
binary under the Bazelisk cache directory, and retries bazel --version
with exponential backoff.

  • Also updates agent style rules to allow long string literals (such as
    URLs and hashes) to exceed line length limits.

`bazel-contrib/setup-bazel` resolves `bazelisk-version` by querying the
GitHub Releases API without retries—which intermittently returns an
empty `[]` response—and downloads the binary without retries or SHA-256
verification. Additionally, Bazelisk does not retry mid-stream transfer
failures when downloading the Bazel binary.

Replace the `bazelisk-version` input and shell retry script with a
Python download script in the `setup-bazel` composite action. The
script downloads Bazelisk directly from GitHub Releases with an npm
registry tarball fallback, verifies SHA-256 checksums, caches the
binary under the Bazelisk cache directory, and retries `bazel --version`
with exponential backoff.

* Also updates agent style rules to allow long string literals (such as
  URLs and hashes) to exceed line length limits.

@aignas aignas left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but we should switch to latest bazelisk version either in this PR or later.

Comment on lines +45 to +46
("https://github.com/bazelbuild/bazelisk/releases/download/v1.28.1/bazelisk-darwin-amd64", "023225736cea5dc88f2b0807d5b1af4eb0f69a4ed45e3994b2c18c263bc80e48"),
("https://registry.npmjs.org/@bazel/bazelisk/-/bazelisk-1.28.1.tgz", "023225736cea5dc88f2b0807d5b1af4eb0f69a4ed45e3994b2c18c263bc80e48"),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Latest bazelisk is 1.30.0, could we switch to that? https://github.com/bazelbuild/bazelisk/releases/tag/v1.30.0

@rickeylev
rickeylev marked this pull request as ready for review October 23, 2026 03:11
@rickeylev
rickeylev merged commit 15f5f93 into main Oct 23, 2026
18 checks passed
@rickeylev
rickeylev deleted the fix_bazelisk_download_retry branch October 23, 2026 03:11
@rickeylev

Copy link
Copy Markdown
Collaborator Author

Good idea. I should have thought to check that the version it was picking was latest.

rickeylev added a commit that referenced this pull request Oct 23, 2026
PR #4325 pinned the Bazelisk download URLs to v1.28.1 to match the
latest version available on the npm registry mirror, inadvertently
downgrading the primary GitHub Releases download from 1.29.0.

Update the primary GitHub Releases URLs and SHA-256 checksums in the
`setup-bazel` download script to v1.30.0 (the latest GitHub release),
while retaining 1.28.1 for the npm registry fallback.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants