ci(bazel): pin the bazelisk digests instead of querying the releases API #3828
All Vouch review confidence checks passed
Residual risk 0.20 = Change Risk (0.50) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.50 · 583 lines diff across 7 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.381
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #3828"
general
weight: 0.35
icfaust
Description
Second step of the Bazel maintainability series (after #3827).
install-bazeldid not download Bazelisk directly: it first calledapi.github.com/repos/bazelbuild/bazelisk/releases/tags/$BAZELISK_VERSION,hand-parsed the JSON with a
while readloop to find the asset digest, and onlythen downloaded. That API is rate limited per IP for unauthenticated callers, so
on a busy runner the request comes back 403, the digest string ends up empty and
the step dies with a download failure that has nothing to do with the change
under test.
GITHUB_TOKENis passed when it happens to be in the environment,but most of the jobs that run this script do not export one.
This PR pins the digests next to the version, downloads the asset directly and
verifies it locally, so the install no longer depends on a network API call at
all. The version itself is unchanged (
v1.29.0).Three pre-existing problems fall out of the rewrite:
The digest was never actually enforced.
.ci/env/bazelisk.shranecho "$SHA256" | sha256sum --checkand ignored the exit status. The script issourced by most of its callers, so it cannot use
set -eeither. A mismatchprinted
FAILEDinto the log and the build went on and used the binary. Thecheck is now explicit and removes the file before exiting non-zero.
nightly-test.ymllost the PATH export. That workflow runs the scriptrather than sourcing it, so the
export PATH=...at the end went to asubshell; the job worked only because the runner image already had a
bazelon PATH. Both scripts now also append the install directory to
GITHUB_PATH.The Windows jobs pinned Bazelisk a second time.
WindowsBazelandWindowsBazelReleaseAlleach declared their ownBAZELISK_VERSION(which haddrifted to
v1.28.1, one release behind the shell script) and inlined thedownload in four lines of PowerShell. They now call
.ci/env/bazelisk.ps1,which publishes
BAZELISK_VERSIONandBAZELISK_EXEback as pipelinevariables via
##vso[task.setvariable], so the version lives in exactly oneplace per platform and the
Cache@2keys keep working unchanged.bazelisk.ps1picks its output channel from the environment:GITHUB_PATHunderGitHub Actions, the two
##vsovariables under Azure (TF_BUILD), and theprocess
PATHotherwise, which makes it usable for local reproduction.Trade-off to be aware of
Renovate bumps
BAZELISK_VERSION/$bazeliskVersionbut cannot compute therelease asset digests, so a Renovate version bump will now fail
install-bazeluntil the digests are updated in the same PR. That is deliberate — a loud,
self-explanatory failure is better than the silent unverified install we had —
and the error message quotes the exact command that prints the new digests:
Changes
| File | Change |
| --- | --- |
|
.ci/env/bazelisk.sh| Pinned amd64/arm64 digests, direct download, enforced hash check,GITHUB_PATH||
.ci/env/bazelisk.ps1| Pinned digest, direct download,Get-FileHashcheck,GITHUB_PATH/##vso/PATH||
.ci/pipeline/ci.yml| Both Windows Bazel jobs delegate to the script; duplicatedBAZELISK_variables dropped ||
.gitignore| Ignore thebazel/install directory the scripts create |No behavioural change to the Bazel build itself.
Validation
Linux, in a scratch directory:
happy path, sourced — exit 0,
BAZEL_VERSION=9.2.0,bazel/bin/bazelinstalled,
GITHUB_PATHfile contains the install directory;failure path with a deliberately zeroed digest —
FAILED, the:error:message naming the script to fix, exit 1, and no binary left behind (the old
script installed it);
bazelisk-linux-amd64digest re-derived withsha256sumon thedownloaded asset, independently of the release metadata.
The Windows digest and the
##vsovariable publication are whatWindowsBazeland
WindowsBazelReleaseAllon this PR exercise; there is no Windows hostavailable locally.
---
🤖 Generated with Claude Code