beads/scripts/ci
Julian Knutsen e7894732e0
fix(ci): make a failed pinned-dolt download actually fail the job (#5935)
* fix(ci): make a failed pinned-dolt download actually fail the job

scripts/ci/install-dolt.sh retried the download with

    if curl -fsSL -o "$workdir/$asset" "$url"; then
      break
    fi
    status=$?

`status=$?` there reads the status of the *if compound*, not of curl. A
compound whose condition fails and which has no else branch is itself
successful, so `status` was 0 on every failed attempt, and the
retries-exhausted branch ran `exit 0`. A download that never succeeded
reported success.

That defeats the entire point of the script. The step goes green, the
version-drift guard at the bottom never runs, and the job proceeds on
whatever `dolt` the runner image already had on PATH -- the unpinned
binary the pin exists to keep out, and the one that made
TestFreshBootstrapHealIncarnation flake when releases/latest moved to
2.3.x.

Capture curl's status directly instead, and include it in the
retries-exhausted message so the log says which failure it was.

Guarded by TestInstallDoltPropagatesDownloadFailure, which runs the real
script against stub curl/sleep/tar/sudo/dolt/uname on PATH. Against the
unfixed script exactly one subtest reddens ("exhausted retries": exit 0,
want 42); "immediate success", "eventual success" and "installed version
drifts" stay green, so the harness demonstrably observes success and the
new signal is specific to this bug rather than to everything failing.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* test(ci): pin what install-dolt.sh actually downloads and installs

The review council mutated the script and found two changes the new test
waved through: swapping the pinned release URL for releases/latest, and
installing mode 0644 into /opt/dolt instead of 0755 into /usr/local/bin.
Both are exactly the drift this script exists to prevent, and both left
all four subtests green because the test only counted calls. The sibling
pull_dolt_image_test.go already asserts its docker argv; this one now
does the same for curl and sudo.

The council also flagged the drift guard itself: `[[ $installed !=
*"$version"* ]]` accepts any version containing the pin as a substring,
so 12.2.0 and 2.2.0-rc1 both pass. Compare the version token exactly.

Red before green, by real on-disk swaps (a -overlay cannot reach a file
the test execs):

  releases/latest URL          all 5 subtests red (was: all green)
  install -m 0644 /opt/dolt    4 of 5 red -- exhausted_retries stays
                               green because it never reaches sudo
  substring drift guard        only installed_version_merely_contains
                               _the_pin reddens

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-21 16:58:46 -07:00
..
go-list-test-names Add PR CI wrapper command surface (#4211) 2026-05-29 18:52:53 -07:00
lib Add PR CI wrapper command surface (#4211) 2026-05-29 18:52:53 -07:00
detect-package-gates.sh docs: go all-in on Mintlify — delete the Docusaurus site and its machinery 2026-07-12 10:37:17 -07:00
fmt-check.sh fix(ci): remove recursive Make from lint formatting (#5302) (#5320) 2026-08-10 21:43:59 -07:00
gen_proxied_shard_manifest.py test(proxied): split the six heaviest suites so shards balance under the timeout 2026-07-20 15:55:17 -07:00
go-test-shard-names.sh Add PR CI wrapper command surface (#4211) 2026-05-29 18:52:53 -07:00
go-test-shard-packages.sh Add PR CI wrapper command surface (#4211) 2026-05-29 18:52:53 -07:00
install-dolt.sh fix(ci): make a failed pinned-dolt download actually fail the job (#5935) 2026-08-21 16:58:46 -07:00
package-mcp.sh Add PR CI wrapper command surface (#4211) 2026-05-29 18:52:53 -07:00
package-npm.sh Add PR CI wrapper command surface (#4211) 2026-05-29 18:52:53 -07:00
pr-core.sh Add PR CI wrapper command surface (#4211) 2026-05-29 18:52:53 -07:00
pr-lint.sh fix(ci): remove recursive Make from lint formatting (#5302) (#5320) 2026-08-10 21:43:59 -07:00
pr-policy.sh merge(bd-ilb): OpenAPI v0 spec, types-only codegen and drift gates 2026-07-31 18:34:34 +00:00
pull-dolt-image.sh ci: retry Dolt image pulls (bd-m0o1z) (#5228) 2026-08-01 08:18:41 -07:00