* migration-test: port the historical-Dolt upgrade corpus to darwin/arm64 The harness was Linux/amd64-only, gated by an unconditional uname check. Porting it turned out to need more than the linux-only STRICT_RELEASE_ASSETS table: sourcing lib/versions.sh's associative arrays fails outright under macOS's bundled bash 3.2 (no `declare -A` support), `realpath -e` and `find -printf` are GNU-only, the release-binary version probe's sandboxed PATH=/usr/bin:/bin has no `timeout` on macOS, and the v0.9.1 source build's own scratch dir was never canonicalized against macOS's symlinked TMPDIR. - lib/versions.sh: guard on bash >= 4 with an actionable message instead of a cryptic mid-file parse error; add reviewed darwin|arm64 asset+checksum entries for all 12 corpus versions (existence confirmed via `gh release view`, checksums taken from each release's own checksums.txt — the same provenance as the existing linux|amd64 rows, cross-checked byte-for-byte against them). - historical-dolt-upgrade-test.sh: accept linux/x86_64 or darwin/arm64 (still an explicit allowlist, not a generic passthrough); replace the two `find -printf` uses with a portable per-entry describer (Linux keeps the original find command unchanged) and a plain `-exec basename`. - lib/binary.sh: add resolve_existing_path (realpath -e on Linux, plain realpath elsewhere — verified to already require existence on macOS); resolve `timeout` to an absolute path before entering the sandboxed probe rather than widening its PATH; canonicalize the v0.9.1 build's scratch dir immediately after mktemp; parameterize its GOOS/GOARCH/cache-path instead of hardcoding linux/amd64. Validated natively on darwin/arm64: syntax-checked under bash 5; the existing legacy-bridge-test.sh smoke suite passes unchanged (including its assertion that the sandboxed probe PATH stays exactly /usr/bin:/bin); real end-to-end runs of run.sh (the actual CI entrypoint) pass for the embedded Dolt lane (v1.1.2), the external server-Dolt lane against the pinned Dolt runtime (v0.62.0 — production's current schema), and a classic-SQLite bridge lane (v0.49.6). linux|amd64 behavior is unchanged (existing entries and branches are untouched byte-for-byte; only new darwin-only branches added). v0.9.1's own lane gets past every platform fix here and then hits an unrelated, pre-existing bug: migrate-legacy-to-current.sh's bridge comparison stringifies timestamps as local-time-with-offset on the old side and UTC-Z on the candidate side, so it only happens to line up when the runner's local timezone is UTC (true for CI, false here). Left unfixed as out of scope for a platform-corpus change — noted for the reviewer. Ref: ga-9sghx (Gas Town HQ) * fix(ga-9sghx): address PR #6072 review feedback bee-ghosttrack's review (CHANGES_REQUESTED) found resolve_existing_path's non-Linux branch assumed BSD realpath, but Homebrew coreutils puts GNU realpath on macOS PATH too — and GNU's flagless default silently accepts a missing final path component, dropping the existence guarantee this function promises callers. Add an explicit [ -e "$1" ] guard so it holds regardless of which realpath resolves. Also skip the v0.63.3 embedded-Dolt lane specifically on darwin/arm64: that release's published darwin/arm64 binary was built without CGO and can't open an embedded-Dolt store at all — an upstream release artifact limitation, not fixable here. Skipping just that one version (with an explicit, non-silent message) keeps ./run.sh from being permanently red on a Mac; every other embedded-Dolt version is unaffected. Verified: legacy-bridge-test.sh passes; --version v0.63.3 now exits via the explicit skip instead of the CGO error; resolve_existing_path unit-checked directly for both the existing-path and missing-path cases. --------- Co-authored-by: Test <test@example.com>
143 lines
7.3 KiB
Bash
Executable file
143 lines
7.3 KiB
Bash
Executable file
#!/bin/bash
|
|
# Storage era definitions and upgrade path matrix.
|
|
|
|
if ((BASH_VERSINFO[0] < 4)); then
|
|
printf 'versions.sh: this migration-test harness needs bash >= 4 for associative arrays (found %s).\n' "$BASH_VERSION" >&2
|
|
printf 'versions.sh: macOS ships bash 3.2 by default; install a newer bash (e.g. "brew install bash") and invoke this script through it.\n' >&2
|
|
return 1 2>/dev/null || exit 1
|
|
fi
|
|
|
|
# The explicit export/import bridges for reviewed classic SQLite layouts. They
|
|
# are not in-place schema migrations: each SQLite source remains a rollback copy.
|
|
readonly CLASSIC_SQLITE_VERSION="v0.49.6"
|
|
readonly CONFIGURED_SQLITE_VERSION="v0.50.3"
|
|
readonly PRE_CANONICAL_SQLITE_VERSION="v0.17.0"
|
|
# This source-tag-qualified lane deliberately has no release asset.
|
|
readonly SOURCE_TAG_SQLITE_VERSION="v0.9.1"
|
|
readonly SOURCE_TAG_SQLITE_MODULE="github.com/steveyegge/beads"
|
|
readonly SOURCE_TAG_SQLITE_MODULE_SUM="h1:2KRCRCEtHvfMzmhYrpZzWl2rk2Y1Wq9p2awTdQIK9yY="
|
|
readonly SOURCE_TAG_SQLITE_GOMOD_SUM="h1:CNV215xONrxBs18j3BXx/xvl1qyCO2SeQRqiTN213Vg="
|
|
readonly SOURCE_TAG_SQLITE_COMMIT="e3c8554fa2c3e4b9caf7e296e9c8abbe24211a72"
|
|
readonly SOURCE_TAG_SQLITE_REF="refs/tags/v0.9.1"
|
|
readonly SOURCE_TAG_SQLITE_GO_TOOLCHAIN="go1.25.0"
|
|
|
|
# Representative, public release binaries for the historical-Dolt E2E test.
|
|
# These are deliberately a small, reviewed compatibility corpus rather than
|
|
# a discovery mechanism or an exhaustive tag matrix.
|
|
declare -ar HISTORICAL_DOLT_VERSIONS=(
|
|
"v0.55.4"
|
|
"v0.56.1"
|
|
"v0.57.0"
|
|
"v0.62.0"
|
|
)
|
|
|
|
# Reviewed direct embedded-Dolt sources. Unlike the server corpus, their own
|
|
# embedded data is opened and migrated in place by the candidate.
|
|
declare -ar EMBEDDED_DOLT_VERSIONS=(
|
|
"v0.63.3"
|
|
"v1.0.0"
|
|
"v1.0.1"
|
|
"v1.1.0"
|
|
"v1.1.2"
|
|
)
|
|
|
|
# The test server is an external compatibility fixture, not the runner's
|
|
# ambient Dolt installation. CI downloads this exact linux/amd64 archive.
|
|
readonly DOLT_TEST_RUNTIME_VERSION="v2.1.8"
|
|
readonly DOLT_TEST_RUNTIME_SHA256="f66318f08ed66e409fc39363ae0fff8ce6fbf6dba9f5bac632b91527b9632a74"
|
|
|
|
# Classic SQLite files that must be retained byte-for-byte for rollback before
|
|
# the manual bridge removes the active copies.
|
|
declare -ar CLASSIC_SQLITE_ROLLBACK_FILES=(
|
|
"beads.db"
|
|
"beads.db-wal"
|
|
"beads.db-shm"
|
|
"metadata.json"
|
|
"config.json"
|
|
"config.yaml"
|
|
"issues.jsonl"
|
|
)
|
|
|
|
# Legacy Dolt-server metadata that must be retained with the dolt/ directory
|
|
# before the manual bridge clears the active source.
|
|
declare -ar LEGACY_DOLT_ROLLBACK_FILES=(
|
|
"metadata.json"
|
|
"config.json"
|
|
"config.yaml"
|
|
"issues.jsonl"
|
|
)
|
|
|
|
# Release artifacts and expected qualification outcomes for strict CI lanes.
|
|
# Strict entries are deliberately explicit: adding a historical lane requires
|
|
# reviewing the official asset, checksum, source capabilities, and supported
|
|
# migration outcome instead of silently discovering them at runtime.
|
|
declare -Ar STRICT_RELEASE_ASSETS=(
|
|
["v0.17.0|linux|amd64"]="beads_0.17.0_linux_amd64.tar.gz"
|
|
["v0.49.6|linux|amd64"]="beads_0.49.6_linux_amd64.tar.gz"
|
|
["v0.50.3|linux|amd64"]="beads_0.50.3_linux_amd64.tar.gz"
|
|
["v0.55.4|linux|amd64"]="beads_0.55.4_linux_amd64.tar.gz"
|
|
["v0.56.1|linux|amd64"]="beads_0.56.1_linux_amd64.tar.gz"
|
|
["v0.57.0|linux|amd64"]="beads_0.57.0_linux_amd64.tar.gz"
|
|
["v0.62.0|linux|amd64"]="beads_0.62.0_linux_amd64.tar.gz"
|
|
["v0.63.3|linux|amd64"]="beads_0.63.3_linux_amd64.tar.gz"
|
|
["v1.0.0|linux|amd64"]="beads_1.0.0_linux_amd64.tar.gz"
|
|
["v1.0.1|linux|amd64"]="beads_1.0.1_linux_amd64.tar.gz"
|
|
["v1.1.0|linux|amd64"]="beads_1.1.0_linux_amd64.tar.gz"
|
|
["v1.1.2|linux|amd64"]="beads_1.1.2_linux_amd64.tar.gz"
|
|
# darwin/arm64: reviewed 2026-08-29 (ga-9sghx) so the corpus can run
|
|
# natively on Apple Silicon. Every asset below was confirmed to exist via
|
|
# `gh release view <version> -R gastownhall/beads`, and every checksum was
|
|
# taken from that release's own goreleaser-published checksums.txt (the
|
|
# same provenance as the linux|amd64 entries above).
|
|
["v0.17.0|darwin|arm64"]="beads_0.17.0_darwin_arm64.tar.gz"
|
|
["v0.49.6|darwin|arm64"]="beads_0.49.6_darwin_arm64.tar.gz"
|
|
["v0.50.3|darwin|arm64"]="beads_0.50.3_darwin_arm64.tar.gz"
|
|
["v0.55.4|darwin|arm64"]="beads_0.55.4_darwin_arm64.tar.gz"
|
|
["v0.56.1|darwin|arm64"]="beads_0.56.1_darwin_arm64.tar.gz"
|
|
["v0.57.0|darwin|arm64"]="beads_0.57.0_darwin_arm64.tar.gz"
|
|
["v0.62.0|darwin|arm64"]="beads_0.62.0_darwin_arm64.tar.gz"
|
|
["v0.63.3|darwin|arm64"]="beads_0.63.3_darwin_arm64.tar.gz"
|
|
["v1.0.0|darwin|arm64"]="beads_1.0.0_darwin_arm64.tar.gz"
|
|
["v1.0.1|darwin|arm64"]="beads_1.0.1_darwin_arm64.tar.gz"
|
|
["v1.1.0|darwin|arm64"]="beads_1.1.0_darwin_arm64.tar.gz"
|
|
["v1.1.2|darwin|arm64"]="beads_1.1.2_darwin_arm64.tar.gz"
|
|
)
|
|
declare -Ar STRICT_RELEASE_SHA256=(
|
|
["v0.17.0|linux|amd64"]="d4d08617a324c85b45c9628bc519d659a9ff9c7c37da67aa48727e0af7f19a75"
|
|
["v0.49.6|linux|amd64"]="8546dc9a47e11dc31ac2bc9a0224a9c690975e91850932cbb62623053fbb7db8"
|
|
["v0.50.3|linux|amd64"]="e94b09e0b6a9324bbc0e81ea36bccaaa42172a926bfedfb389e9a26dedb63184"
|
|
["v0.55.4|linux|amd64"]="e0fa25456dd82890230eef17653448a0bf995104c78864be91c5ed84426a5f49"
|
|
["v0.56.1|linux|amd64"]="4f9f6cc44465a11613ff529009901eaaf841c6b1f91c15e002b0ecda2015a15c"
|
|
["v0.57.0|linux|amd64"]="f8629d5627bed7d25f06f92334addc171d679f9aed9d08c5d42a9684205dc04b"
|
|
["v0.62.0|linux|amd64"]="4cca7265b22e5c3ca8d62ab0b9752bec31f68b7f5fa636282a4c7e5454c35535"
|
|
["v0.63.3|linux|amd64"]="5f4efd2e010209b3f381dbcd783b2a3a652f50ea72f40ef04c8ba434d408bf9e"
|
|
["v1.0.0|linux|amd64"]="7057db1e92428fcf5c08d5dc6b07ead57e588b262cba78b9a26893d55bd29fdb"
|
|
["v1.0.1|linux|amd64"]="1d2364d5d7083a4634a9e734ca87822fb79c2b6625988f9f791e3376313b1b77"
|
|
["v1.1.0|linux|amd64"]="b0f3dd607c3fb989ee08d0a6854fba80d0402971eb108f9af6170bc14d491a34"
|
|
["v1.1.2|linux|amd64"]="a72d71ed374955dc9f83a0f90b54bd7b6a0016709dd1676ae2e368651ed401c2"
|
|
# darwin/arm64 — see provenance note on STRICT_RELEASE_ASSETS above.
|
|
["v0.17.0|darwin|arm64"]="41479fabf76ff76912096bf2e9c1988a9b0d0dd673c7e693342f711770f6d763"
|
|
["v0.49.6|darwin|arm64"]="007dacd919eeac48a3a0ecb6aad305ef04e903de02c43a8163d2fd6a63d9ab7d"
|
|
["v0.50.3|darwin|arm64"]="26c15b93d82be45c3fa9b6318ffee9a6ae89841ba7ec4ad5c8db6fe6e42d3d3a"
|
|
["v0.55.4|darwin|arm64"]="18afdf4f562323a71687b2f7ed95c27750aee8d361b176a4a79caf176f00c0b9"
|
|
["v0.56.1|darwin|arm64"]="aa8a4309de2ab8c27a90c03b652cedc53a45880a5c94cd65881006da3c2f0812"
|
|
["v0.57.0|darwin|arm64"]="fbbcbdff64da29f72fbe939d4cc285305d73e830889919d182c4c6826a338ced"
|
|
["v0.62.0|darwin|arm64"]="4f441c616240c7063a2257ac26138d06eae060a961f029c81855928eae6ae1c0"
|
|
["v0.63.3|darwin|arm64"]="2b3ab41dd74a3c2a79bc47dd0b36c0a63a2c5d76f1e3081db5288d294124f245"
|
|
["v1.0.0|darwin|arm64"]="b8763b428e6b68550eb2b2505483797794b49ae497a2e265ed3c60f0f0a0bcd2"
|
|
["v1.0.1|darwin|arm64"]="f9d5e878fbee8a7051289743e36e52b0b17f1058587170afab7f2d2a30f43199"
|
|
["v1.1.0|darwin|arm64"]="c42e24d83b258f7ba9f52a6d2d5f6b055869dfe7807165055988b12e7ea8c564"
|
|
["v1.1.2|darwin|arm64"]="9b0137a83a2afd343e2abd2a506be72ea032721000f76669c2cf81729e78501d"
|
|
)
|
|
|
|
strict_release_asset() {
|
|
local value="${STRICT_RELEASE_ASSETS["$1|$2|$3"]:-}"
|
|
[ -n "$value" ] || return 1
|
|
printf '%s\n' "$value"
|
|
}
|
|
|
|
strict_release_sha256() {
|
|
local value="${STRICT_RELEASE_SHA256["$1|$2|$3"]:-}"
|
|
[ -n "$value" ] || return 1
|
|
printf '%s\n' "$value"
|
|
}
|