* ci(advisory): move Conformance/Regression/Migration/Smoke/Docs/Proxied-Local to Blacksmith, fold matrices, path-filter, drop redundant nix-build PR trigger (F7c)
Reduces per-PR GitHub-hosted job load for advisory (non-required) workflows
per the "PR CI -> 5 min" plan, slice F7c. None of these workflows gate the
required CI Gate / PR Risk Gate checks.
- conformance.yml: same-repo PR/merge_group runs move to Blacksmith
(4vcpu); PR trigger gets the shared "upgrade-relevant code" path filter
(any non-test Go change or build input); also now runs on push to main.
- regression.yml: fold detect-regression-need into regression's first step
(gated via `if:`), eliminating a whole job; move to Blacksmith.
- migration-test.yml: fold the 14-version x cache-identity matrix into 3
shards (src/pre-dolt/dolt-runtime), looping every version in a shard via
a new "Verify explicit historical upgrades" step so a bad version does
not hide the rest; gains the shared path filter; move to Blacksmith.
- cross-version-smoke.yml: fold the 1-job-per-version matrix into chunks of
5 (delegated to upgrade-smoke-test.sh's native SMOKE_VERSIONS support);
gains the shared path filter; move to Blacksmith.
- docs-mintlify.yml, proxied-local-smoke.yml: move to Blacksmith
(2vcpu/4vcpu); add missing timeout-minutes where absent.
- nix-build.yml: drop the pull_request trigger — pr-risk.yml's required
test-nix job (nix run + nix flake check) is a strict superset of
`nix build .#default`, pinned by a new regression test.
- main.yml: add blacksmith-setup-go-cache, a push-to-main-only job that
warms setup-go's implicit cache with cache: true, since Blacksmith
runners cannot see GitHub-saved actions/cache entries that the six
workflows above now rely on via setup-go's own caching. Carves a scoped,
documented exception into assertPinnedGoCacheActions for this one job;
every other setup-go step in main.yml/pr.yml/pr-risk.yml still must pin
cache: false.
Forks and Dependabot PRs are unaffected (still ubuntu-latest, no secrets),
via the same conditional runner expression used elsewhere in the repo.
New policy tests in scripts/ci_f7c_advisory_test.go pin: path-filter
identity across the three filtered workflows, full version-set coverage
of the migration-harness fold (no scenario dropped), the per-shard/per-
chunk retry-all-versions-even-on-failure loop, fork/dependabot runner
selection semantics, no Blacksmith job reads secrets, and that the new
cache-seed job exists and that its six consumers don't disable the cache
it warms. All new tests and their underlying behaviors were mutation-
tested (each fails when the behavior it pins is reverted).
Caveat for rollout: the Blacksmith cache-seed job assumes Blacksmith
labels have branch-protected cache isolation from fork/untrusted PRs at
the org level (spec-f7.md Group B precondition) — this needs confirming
with an org admin before merge, since the seed job's cache becomes shared
infrastructure the six advisory workflows implicitly trust.
Replayed the last 60 merged PRs' changed-file lists against the new path
filter: 20/60 would now skip Conformance/Migration/Smoke (matches the
spec's estimate), and none of the 60 touched non-test Go code while being
classified as skip.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(ci,advisory): F7c review B1/B2 - pin migration fallback, restore-only Blacksmith caches
B1: migration-test.yml's non-Blacksmith historical-upgrades fallback was
`ubuntu-latest`, which actions/runner-images#14748 schedules to move from
24.04 to 26.04 starting 2026-10-19. 26.04 drops libicu74, which the v0.55.4
fixture's ICU ABI depends on (and which "Install test dependencies" installs
explicitly). Pin the fallback to the literal `ubuntu-24.04` label instead, and
add the matching sameRepoBlacksmith4vcpuNoble constant so the pin itself is
tested. Confirmed via `git show <pre-F7c>` that none of the other five
workflows F7c touched ever had a pinned-OS fallback, so this regression was
scoped to migration-test.yml only.
B2: Blacksmith cannot see GitHub-hosted cache entries, and a same-repo PR
writing a cache entry another PR or main later reads back unverified is a
poisoning vector. Make every advisory consumer (conformance, regression,
migration-test, cross-version-smoke, docs-mintlify, proxied-local-smoke)
disable setup-go's own implicit cache on self-hosted runners and restore-only
from a self-defined `blacksmith-sg-v1-...` key namespace (not setup-go's own
implicit key, so there is no dependency on Blacksmith's $ImageOS matching
GitHub-hosted resolution). Only main.yml's new blacksmith-setup-go-cache job
(push-to-main only, always trusted) saves: it always restores, unconditionally
re-runs every warm-up command (no longer gated on a cache hit, so a stale or
partial restore self-heals), and always saves under the same key. Delete the
now-unneeded goCacheImplicitCacheExceptions carve-out in ci_workflow_test.go.
Also convert cross-version-smoke.yml's smoke-binaries-* and regression.yml's
regression-baseline-* caches from a monolithic actions/cache (auto-saves on
any miss) into an explicit restore (always, modulo the job's own gate) / save
(gated off pull_request) pair, closing the same poisoning vector for
per-release binaries. migration-test.yml's historical-dolt-* cache is left
unchanged: it is already checksum-verified on every read by
scripts/migration-test/lib/binary.sh.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* test(ci,advisory): F7c review SF - behavioral tests, path filters, F7a naming coordination
Replace substring-matching tests with behavioral ones that execute the real
embedded bash/jq against synthetic input, closing the reviewer's 12 surviving
mutations:
- TestMigrationHarnessLoopExecutesBehaviorally runs the real "Verify explicit
historical upgrades" step against a stub run.sh: every version in a shard
still runs after an earlier one fails (closes `exit 0`/`break` mutations),
failures are ::error:: annotated and written to $GITHUB_STEP_SUMMARY, a bad
or empty SHARD_VERSIONS fails closed without ever invoking run.sh, and a
hung version is bounded by `timeout --kill-after` without hiding the version
queued after it. The step's env now exports SHARD so its run: body has no
literal ${{ }} GH-expression syntax left for a test harness to choke on.
- TestMigrationHarnessCacheHashMatchesDerivation pins each shard's cache-hash
against sha256(join(",", <shard's cache-identity strings>))[:16], recovered
from the pre-fold 14-entry table (git show 362eecc6bf), closing a stale-
cache-hash mutation.
- TestMigrationHarnessDoltRuntimeStepGatedByShard pins the exact gate
expression for "Install Dolt test runtime".
- TestCrossVersionSmokeChunksEveryResolvedVersion now executes the real jq
chunking and join programs (via the new ghExtractJQProgram helper) against
synthetic version lists of several sizes, and asserts the smoke step's run:
command is an exact match - closing jq-slice-off-by-one and
dropped-SMOKE_VERSIONS mutations a substring check could not catch.
- TestRegressionStepsAfterDetectAreGated pins that every step after
regression.yml's detect step stays gated on
steps.detect.outputs.run_regression == 'true', closing an
ungated-regression-step mutation.
- TestBlacksmithSetupGoSeedExistsForAdvisoryConsumers,
TestAdvisoryBlacksmithConsumersAreCacheRestoreOnly (replacing
TestAdvisoryBlacksmithConsumersKeepImplicitSetupGoCache),
TestBlacksmithSetupGoCacheKeysMatchAcrossSeederAndConsumers, and
TestAdvisoryBinaryCachesAreRestoreAlwaysSavePRGated cover the B2
restore-only/seeder-saves cache topology end to end, including a
seeder/consumer key-match check and scoping the "no save in a consumer job"
check to the blacksmith-sg-v1- namespace specifically so migration-test.yml's
legitimate, checksum-verified historical-dolt-* cache is not flagged.
Path filters: add scripts/migrate-legacy-to-current.sh to migration-test.yml
(the harness invokes it directly but it lives outside scripts/migration-test/)
and internal/storage/embeddeddolt/conformance_test.go plus backend/conformance/**
to conformance.yml, with a new TestConformancePushPathsMatchPullRequestPaths
pinning push.paths and pull_request.paths stay identical.
Coordination with F7a (ci/f7a-blacksmith-fold, lands before F7c): F7a
independently defines its own sameRepoBlacksmith4vcpu/2vcpu constants and a
TestSameRepoBlacksmithExpressionSemantics, and is moving a real GH-Actions
expression evaluator into a shared scripts test helper file. Per the
coordinator, rename this branch's same-named test to
TestF7cAdvisorySameRepoBlacksmithExpressionSemantics (deliberately left as the
same simple literal mirror it always was, not a competing evaluator) so it
does not collide with F7a's helper on rebase; at rebase time this test should
be reduced or replaced in favor of F7a's shared evaluator.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* docs(ci): update stale nix-build PR-trigger and renamed check-name references (F7c review S6)
F7c (bb81136203) dropped nix-build.yml's pull_request trigger as redundant
with PR Risk's test-nix job, and folded cross-version-smoke.yml's one-job-
per-version matrix into one job per 5-version chunk. Update the docs that
still described the old topology:
- CONTRIBUTING.md: nix build .#default no longer runs on PRs; point at PR
Risk's required test-nix job instead.
- update-vendor-hash.yml: same correction in its header comment and the
GITHUB_TOKEN-retrigger caveat.
- engdocs/CI_TEST_SURFACE_AUDIT.md: migration-test.yml now also runs on PRs
(path-filtered, advisory) across 3 shards instead of 14 per-version legs;
nix-build.yml's row now reflects push-to-main-only.
- engdocs/CI_REQUIRED_CHECK_TOPOLOGY.md: replace `Upgrade smoke
(<version> -> candidate)` with the current `Upgrade smoke (chunk N)` job
name in both the "do not require directly" list and the Cross-Version
Smoke section; rewrite the Nix Build section to describe nix-build.yml as
push-to-main-only (no longer a PR check to warn about requiring directly)
and remove the now-unreachable `nix build .#default` bullet from the
"do not require" list.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* ci(advisory): rebase onto F7a shared Blacksmith helper, drop duplicate const/evaluator
F7a (PR #7139, ci/f7a-blacksmith-fold) landed its own sameRepoBlacksmith4vcpu
const and TestSameRepoBlacksmithExpressionSemantics, plus a real GitHub
Actions expression evaluator (evalGHExpr/mustEvalGHRunsOn) in a new shared
scripts/ci_blacksmith_runner_test.go. This branch rebased onto
origin/ci/f7a-blacksmith-fold and reconciles the two:
- Removed this branch's duplicate sameRepoBlacksmith4vcpu definition in
ci_workflow_test.go (rebase conflict); it's now served solely by F7a's
shared const. sameRepoBlacksmith4vcpuNoble (F7c's B1 fix, fallback pinned
to ubuntu-24.04 instead of ubuntu-latest) is kept as its own const, as
instructed, since it is F7c-specific and not shared.
- Replaced TestF7cAdvisorySameRepoBlacksmithExpressionSemantics's
hand-written Go mirror of the same-repo Blacksmith boolean logic with real
evaluation of each F7c advisory job's actual, as-parsed runs-on expression
text via F7a's evalGHExpr/mustEvalGHRunsOn, across the same event-shape
truth table F7a's own test uses (same-repo/fork/dependabot/deleted-fork-
head/merge_group/push/pull_request_target/schedule/workflow_dispatch).
This covers all 8 F7c advisory Blacksmith jobs, including
migration-test.yml's historical-upgrades job falling back to the literal
ubuntu-24.04 label rather than ubuntu-latest. Confirmed via a cp-backed
mutation (flipping the Noble fallback back to ubuntu-latest) that this new
test, unlike the deleted hand-written mirror, actually catches a
regression in the real expression text.
- Merged two more rebase conflicts in ci_workflow_test.go: the
assertNoUnmanagedGoCacheSteps main.yml allowlist (F7a's
windows-test-binaries-cache plus F7c's blacksmith-setup-go-cache) and a
subsequent non-conflicting-but-incomplete 3-way merge of
TestSameRepoBlacksmithRunners' main.yml entry (added
windows-test-binaries-cache alongside blacksmith-setup-go-cache so the "no
other Blacksmith label leaks" sweep covers both).
Did not merge TestBlacksmithAdvisoryJobsReadNoSecrets into F7a's
TestBlacksmithJobsReadNoSecrets (ci_workflow_test.go) even though the shared
helper file's doc comment suggests it; out of scope for this round per the
coordinator's explicit instructions, left as a follow-up.
Re-ran full verification after rebase + reconciliation: go build/vet/test
./scripts/..., bazel --nohome_rc test //scripts:scripts_test, actionlint
-shellcheck=shellcheck across all touched workflows, make ci-pr-policy, make
bazel-sync-check - all green. gofmt -l clean.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(ci,advisory): close F7c re-review blocker X1 and S1-S5/N1 gaps
Re-review (~/beads-bazel-plan/f7c/rereview.md) found one blocker and five
should-fix gaps against ci/f7c-advisory-workflows:
X1 (blocker): migration-test.yml's historical-dolt-* cache was still a bare
actions/cache that auto-saves on any key miss on Blacksmith for same-repo
PRs. tar -P extraction plus lib/binary.sh's cp -f following a planted
symlink can redirect a write before sha256 verification ever runs, so the
"checksum-verified" exemption was unsound. Converted to the same
restore-always/save-off-PR split as smoke-binaries-*/regression-baseline-*,
dropped the exemption comments, and added it to advisoryBinaryCaches.
S1: TestRegressionDetectStepBehavioral executes regression.yml's detect
step's actual bash against a scratch git repo, closing mutation M13 (detect
step hard-wired to emit run_regression=false).
S2: TestBlacksmithReachableAdvisoryJobsNeverSaveACache sweeps every job in
every F7c advisory workflow (plus main.yml) whose runs-on resolves to a
Blacksmith label under a same-repo pull_request/merge_group context, and
fails on any bare actions/cache, any un-gated actions/cache/save, or any
setup-go/setup-node/setup-python step that would still cache there. Also
added a job-level `if: github.event_name == 'push' && github.ref ==
'refs/heads/main' && github.repository == 'gastownhall/beads'` guard to
main.yml's seeder job (TestBlacksmithSeederGuardedAgainstPullRequest) so a
future pull_request/merge_group trigger on main.yml can't turn the seeder
into a same-repo-PR-reachable cache writer.
S3: advisoryBinaryCaches' save-gate check is now exact-equality, not
strings.Contains, so a `... || true` gate can no longer slip past it.
S4: conformance.yml's path filters now include
internal/storage/embeddeddolt/test_fixture_test.go, which holds TestMain
for the whole package (moved out of conformance_test.go) and was previously
excluded by the blanket !**_test.go negation.
S5: main.yml's blacksmith-setup-go-cache seeder keyed its save on
github.sha, so every push to main - regardless of whether go.sum changed -
wrote a new multi-GB ~/go/pkg/mod + ~/.cache/go-build entry, risking LRU
eviction of F7a's own Blacksmith-seeded caches. Added a "Compute cache
date" step and keyed on the UTC calendar day instead, capping writes to at
most once per day; the same step/key was added to all 6 consumers so their
restore key stays byte-identical to the seeder's save key
(TestBlacksmithSetupGoCacheKeysMatchAcrossSeederAndConsumers).
N1: flipped `cache: ${{ runner.environment != 'self-hosted' }}` to
`cache: ${{ runner.environment == 'github-hosted' }}` on setup-go's own
implicit cache across all 7 call sites, so an empty/unknown
runner.environment value fails closed (caching off) instead of open.
Verification: go build/vet/test ./scripts/..., bazel --nohome_rc test
//scripts:scripts_test, actionlint -shellcheck=shellcheck
.github/workflows/*.yml, make ci-pr-policy, make bazel-sync-check all pass.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* fix(ci,advisory): close merge_group gap in binary-cache save gates
Running TestBlacksmithReachableAdvisoryJobsNeverSaveACache against every
Blacksmith trust context it is reachable under (instead of stopping at the
first match found, which made the check's coverage depend on Go's
randomized map iteration order) surfaced a real gap the S2 sweep was meant
to close: smoke-binaries-*, regression-baseline-* and historical-dolt-*'s
save gates were all `if: github.event_name != 'pull_request'`, a deny-list
that also admits a hypothetical future merge_group event. All three jobs'
runs-on expressions already resolve to a Blacksmith label under
merge_group, so a merge_group run would have been able to write those
caches too - the same same-repo-writer risk X1 closed for pull_request,
just not currently reachable since none of these three workflows has an
`on: merge_group:` trigger today.
Changed all three save gates to an exact allow-list of the triggers they
actually intend to write from (push, workflow_dispatch) rather than a
deny-list of the one trigger they don't. Updated
TestAdvisoryBinaryCachesAreRestoreAlwaysSavePRGated's wantSaveIf strings to
match, and made TestBlacksmithReachableAdvisoryJobsNeverSaveACache check
every blacksmithTrustContexts entry per job (sorted for determinism)
instead of breaking on the first Blacksmith-reachable context, so this
class of context-dependent gate gap can't hide behind map iteration order
again.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* test(ci,advisory): directly assert main.yml has no PR-reachable trigger
TestBlacksmithSeederGuardedAgainstPullRequest's job-level guard defuses the
vulnerability structurally, but a mutation that only edits main.yml's on:
block (adding pull_request:) without touching the job-level if: was not
caught by any existing test (confirmed: mutate.py's N6 probe survived).
Add TestMainWorkflowHasNoSameRepoPRReachableTrigger, the direct half of
F7c review fix S2's "pin the seeder's trust boundary" ask: assert main.yml's
on: has none of pull_request/pull_request_target/merge_group/workflow_run,
and still has push. Confirmed this kills N6 (manually applied and reverted
via a cp backup).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* build(bazel): auto-sync BUILD files
Applied from the bazel-sync-patch artifact of https://github.com/gastownhall/beads/actions/runs/37159233834
(`make bazel-sync`: gazelle, tools/bazel/go_srcs.py, bazel mod tidy).
Only BUILD.bazel, MODULE.bazel and MODULE.bazel.lock are ever pushed; see
scripts/bazel-autofix-push.sh.
---------
Co-authored-by: Gas City Adopt-PR <adopt-pr@gascity.local>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
264 lines
13 KiB
YAML
264 lines
13 KiB
YAML
name: Migration Test Harness
|
|
|
|
on:
|
|
pull_request:
|
|
# "Upgrade-relevant code" allowlist (spec-f7.md §2.4): kept identical
|
|
# (modulo each workflow's own file/script entries) across conformance.yml,
|
|
# migration-test.yml and cross-version-smoke.yml, and pinned by
|
|
# TestAdvisoryWorkflowPathFilters.
|
|
paths:
|
|
- '**.go'
|
|
- '!**_test.go'
|
|
- 'go.mod'
|
|
- 'go.sum'
|
|
- 'Makefile'
|
|
- '.buildflags'
|
|
- '.github/workflows/migration-test.yml'
|
|
- 'scripts/migration-test/**'
|
|
- 'scripts/migrate-legacy-to-current.sh'
|
|
push:
|
|
tags: ['v*']
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
env:
|
|
BD_DISABLE_METRICS: "1"
|
|
BD_DISABLE_EVENT_FLUSH: "1"
|
|
DOLT_TEST_RUNTIME_VERSION: v2.1.8
|
|
DOLT_TEST_RUNTIME_SHA256: f66318f08ed66e409fc39363ae0fff8ce6fbf6dba9f5bac632b91527b9632a74
|
|
|
|
jobs:
|
|
historical-upgrades:
|
|
name: Historical ${{ matrix.shard }} shard → candidate
|
|
# v0.55.4 is dynamically linked against the ICU version shipped by Ubuntu
|
|
# 24.04's libicu74 package. blacksmith-*-ubuntu-2404 IS 24.04, so the pin
|
|
# holds there. The non-Blacksmith fallback below is pinned to the literal
|
|
# `ubuntu-24.04` label (NOT `ubuntu-latest`) for the same reason:
|
|
# actions/runner-images#14748 schedules `ubuntu-latest` to move from 24.04
|
|
# to 26.04 starting 2026-10-19, and 26.04 drops libicu74 entirely, which
|
|
# would break the "Install test dependencies" step below and the v0.55.4
|
|
# fixture's ICU ABI even if it didn't. Do not change this fallback to
|
|
# `ubuntu-latest`; see sameRepoBlacksmith4vcpuNoble in ci_workflow_test.go.
|
|
# F7c: 14 matrix legs (one per historical version) folded into 3 shards.
|
|
# Each shard builds the candidate once, installs its own dependencies
|
|
# once, then loops over `run.sh --version` for every version it owns,
|
|
# collecting failures so one bad version does not hide the rest (see
|
|
# "Verify explicit historical upgrades" below).
|
|
runs-on: ${{ (github.event_name == 'merge_group' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]')) && 'blacksmith-4vcpu-ubuntu-2404' || 'ubuntu-24.04' }}
|
|
timeout-minutes: 20
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
# src: the one version built from source against Go 1.25, instead
|
|
# of installed as a pinned binary.
|
|
- shard: src
|
|
versions: '["v0.9.1"]'
|
|
cache-hash: 453aa2e25bbad328
|
|
# pre-dolt: historical versions that predate the separate Dolt
|
|
# runtime oracle (no "Install Dolt test runtime" step needed).
|
|
- shard: pre-dolt
|
|
versions: '["v0.17.0","v0.49.6","v0.50.3","v0.63.3","v1.0.0"]'
|
|
cache-hash: 03cccab45291ead3
|
|
# dolt-runtime: versions that need the pinned Dolt runtime binary
|
|
# as a read-only oracle (the old per-version `contains(...)` list).
|
|
- shard: dolt-runtime
|
|
versions: '["v0.55.4","v0.56.1","v0.57.0","v0.62.0","v1.0.1","v1.1.0","v1.1.2","v1.2.2"]'
|
|
cache-hash: a8579bd64e9a0926
|
|
# The v1.1.2 tree re-tagged by the recovery release, so it adds no
|
|
# new storage regime — but it is the tag field upgrades actually
|
|
# start from, and it was never in this corpus.
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
|
|
- name: Set up Go
|
|
id: setup-go
|
|
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
cache: ${{ runner.environment == 'github-hosted' }}
|
|
|
|
# Blacksmith runners cannot see GitHub-hosted setup-go cache entries, so
|
|
# setup-go's own `cache: true` (used above on ubuntu-24.04/ubuntu-latest)
|
|
# is disabled here and this job restores from the Blacksmith-side cache
|
|
# main.yml's blacksmith-setup-go-cache job seeds on every push to main.
|
|
# Restore-only by design (see B2 in the F7c implementation report): a
|
|
# same-repo PR can read this cache but never write to it, so a PR cannot
|
|
# poison what main's seeder or other PRs read.
|
|
# F7c review fix S5: this job's own key copy must match main.yml's
|
|
# seeder key byte-for-byte (TestBlacksmithSetupGoCacheKeysMatchAcrossSeederAndConsumers),
|
|
# which now keys by UTC calendar day instead of github.sha so main
|
|
# pushes don't churn a multi-GB cache entry on every commit; this step
|
|
# computes that same day value locally so the key expression below
|
|
# resolves (steps.* references only resolve within the same job).
|
|
- name: Compute cache date
|
|
id: cache-date
|
|
if: runner.environment == 'self-hosted'
|
|
run: echo "today=$(date -u +%Y%m%d)" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Restore Blacksmith setup-go cache
|
|
if: runner.environment == 'self-hosted'
|
|
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
|
with:
|
|
path: |
|
|
~/go/pkg/mod
|
|
~/.cache/go-build
|
|
key: blacksmith-sg-v1-${{ runner.os }}-${{ runner.arch }}-go-${{ steps.setup-go.outputs.go-version }}-${{ hashFiles('go.sum') }}-${{ steps.cache-date.outputs.today }}
|
|
restore-keys: |
|
|
blacksmith-sg-v1-${{ runner.os }}-${{ runner.arch }}-go-${{ steps.setup-go.outputs.go-version }}-${{ hashFiles('go.sum') }}-
|
|
blacksmith-sg-v1-${{ runner.os }}-${{ runner.arch }}-go-${{ steps.setup-go.outputs.go-version }}-
|
|
|
|
- name: Install test dependencies
|
|
# Backstop for a hang that escapes the inner `timeout` calls, so it has
|
|
# to sit ABOVE what those calls can legitimately consume: 3 update
|
|
# attempts x 120s + 2 backoffs x 10s + 180s install = 560s worst case.
|
|
# 11m leaves ~100s of headroom and stays under the job's 20m budget, so
|
|
# a stuck step fails as a step instead of cancelling the whole job.
|
|
timeout-minutes: 11
|
|
run: |
|
|
updated=""
|
|
for attempt in 1 2 3; do
|
|
if sudo timeout 120 apt-get \
|
|
-o Acquire::Retries=3 \
|
|
-o Acquire::http::Timeout=30 \
|
|
-o Acquire::https::Timeout=30 \
|
|
update; then
|
|
updated=yes
|
|
break
|
|
fi
|
|
echo "::warning::apt-get update attempt $attempt failed or timed out"
|
|
# No backoff after the final attempt - there is nothing left to wait for.
|
|
if [ "$attempt" -lt 3 ]; then
|
|
sleep 10
|
|
fi
|
|
done
|
|
# Deliberate best-effort: a stale index still installs these packages
|
|
# from the runner image cache far more often than not, and failing the
|
|
# job here would turn a transient mirror outage into a red build. The
|
|
# warning is what makes the degraded path visible in the job log.
|
|
if [ -z "$updated" ]; then
|
|
echo "::warning::apt-get update failed after 3 attempts; proceeding with cached index"
|
|
fi
|
|
sudo timeout 180 apt-get install -y jq libicu74
|
|
|
|
- name: Install Dolt test runtime
|
|
# v0.55.4-v0.62.0 host their fixture on this server; v1.0.1-v1.1.2 use
|
|
# the same pinned binary as a read-only oracle over the wisp plane,
|
|
# which has no `bd dolt sql` equivalent. This is exactly the
|
|
# dolt-runtime shard's version list.
|
|
if: matrix.shard == 'dolt-runtime'
|
|
run: |
|
|
archive="$RUNNER_TEMP/dolt-linux-amd64.tar.gz"
|
|
runtime="$RUNNER_TEMP/dolt-runtime"
|
|
install_root="$GITHUB_WORKSPACE/.tools/dolt"
|
|
curl -fsSL --retry 3 --retry-all-errors --retry-delay 2 \
|
|
"https://github.com/dolthub/dolt/releases/download/${DOLT_TEST_RUNTIME_VERSION}/dolt-linux-amd64.tar.gz" \
|
|
-o "$archive"
|
|
echo "${DOLT_TEST_RUNTIME_SHA256} $archive" | sha256sum -c -
|
|
mkdir -p "$runtime" "$install_root/bin"
|
|
tar -xzf "$archive" -C "$runtime"
|
|
install -m 0755 "$runtime/dolt-linux-amd64/bin/dolt" "$install_root/bin/dolt"
|
|
"$install_root/bin/dolt" version
|
|
|
|
- name: Configure Git
|
|
run: |
|
|
git config --global user.name "CI Bot"
|
|
git config --global user.email "ci@beads.test"
|
|
|
|
# F7c review fix X1: a bare actions/cache here would auto-save on any
|
|
# key miss. On Blacksmith, same-repo PRs are the only ones that ever
|
|
# run this job (tag push and workflow_dispatch land on ubuntu-24.04,
|
|
# not Blacksmith), so a bare save would make every historical-dolt-*
|
|
# entry a same-repo-PR-only write - exactly what B2 forbids elsewhere.
|
|
# The checksum verification lib/binary.sh does on every extracted
|
|
# archive is not a sufficient mitigation: `tar -P` extraction plus
|
|
# `cp -f` following a planted `verified/<ver>/bd` symlink can still
|
|
# write outside ~/.cache/beads-regression (e.g. over the checked-out
|
|
# workspace or the candidate binary itself) before the checksum check
|
|
# ever runs. Restore-only here, same split as smoke-binaries-*/
|
|
# regression-baseline-* below: only push/dispatch (always GitHub-hosted
|
|
# for this job) may save.
|
|
- name: Restore pinned historical release cache
|
|
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
|
with:
|
|
path: ~/.cache/beads-regression
|
|
key: historical-dolt-${{ matrix.shard }}-${{ matrix.cache-hash }}-${{ runner.os }}-${{ runner.arch }}
|
|
|
|
- name: Build candidate
|
|
run: make build
|
|
|
|
- name: Set up Go 1.25 for v0.9.1 source build
|
|
if: matrix.shard == 'src'
|
|
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
|
|
with:
|
|
go-version: '1.25.0'
|
|
# No Blacksmith restore step for this narrow one-off (src shard
|
|
# only, a single version): accepting a cold build here rather than
|
|
# adding a second seeded cache keyspace for one matrix leg.
|
|
cache: ${{ runner.environment == 'github-hosted' }}
|
|
|
|
# Each version runs as its own `run.sh` subprocess: the underlying
|
|
# historical-dolt-upgrade-test.sh uses `set -euo pipefail` and aborts at
|
|
# its first failure within one process, so a single multi-version
|
|
# invocation could silently hide every version queued after the first
|
|
# failure. Looping subprocess calls here, guarded by `if !`, is what
|
|
# lets "all versions run, and the job fails if any failed" (spec-f7.md
|
|
# §2.3.7) hold for shards with more than one version.
|
|
- name: Verify explicit historical upgrades
|
|
env:
|
|
CANDIDATE_BIN: ./bd
|
|
GIT_CONFIG_NOSYSTEM: "1"
|
|
DOLT_BIN: ${{ github.workspace }}/.tools/dolt/bin/dolt
|
|
SHARD_VERSIONS: ${{ matrix.versions }}
|
|
SHARD: ${{ matrix.shard }}
|
|
run: |
|
|
set -euo pipefail
|
|
mapfile -t versions < <(jq -r '.[]' <<<"$SHARD_VERSIONS")
|
|
# Fail closed: `jq -r '.[]'` over an empty array, a non-array
|
|
# scalar, or unparsable JSON all produce zero lines rather than a
|
|
# non-zero exit under process substitution, so mapfile would
|
|
# otherwise silently succeed with an empty $versions and this step
|
|
# would report green having verified nothing.
|
|
if [ "${#versions[@]}" -eq 0 ]; then
|
|
echo "::error::shard $SHARD resolved to zero versions from SHARD_VERSIONS=$SHARD_VERSIONS; failing closed instead of reporting a false pass"
|
|
exit 1
|
|
fi
|
|
failed=0
|
|
failed_versions=()
|
|
for v in "${versions[@]}"; do
|
|
echo "::group::Historical upgrade: $v"
|
|
# 8m per version plus a 30s SIGKILL grace: observed real runs take
|
|
# well under a minute, so this only trips on a genuine hang, and
|
|
# bounds the damage to one version's budget instead of a stuck
|
|
# subprocess silently consuming the rest of the job's 20m timeout
|
|
# and hiding every version queued after it.
|
|
if ! timeout --kill-after=30s 8m ./scripts/migration-test/run.sh --version "$v"; then
|
|
echo "::error::historical upgrade failed for $v"
|
|
failed=1
|
|
failed_versions+=("$v")
|
|
fi
|
|
echo "::endgroup::"
|
|
done
|
|
if [ "${#failed_versions[@]}" -gt 0 ]; then
|
|
{
|
|
echo "### Failed historical upgrades (shard $SHARD)"
|
|
printf -- '- %s\n' "${failed_versions[@]}"
|
|
} >> "$GITHUB_STEP_SUMMARY"
|
|
fi
|
|
exit "$failed"
|
|
|
|
- name: Save pinned historical release cache
|
|
# Allow-list push/workflow_dispatch rather than deny-list
|
|
# pull_request: a deny-list also admits a hypothetical future
|
|
# merge_group event, which this job's runs-on expression already
|
|
# resolves to Blacksmith for - exactly the same same-repo-writer
|
|
# risk X1 closed for pull_request. Pinned by
|
|
# TestBlacksmithReachableAdvisoryJobsNeverSaveACache (checks both the
|
|
# pull_request and merge_group trust contexts independently).
|
|
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
|
|
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
|
with:
|
|
path: ~/.cache/beads-regression
|
|
key: historical-dolt-${{ matrix.shard }}-${{ matrix.cache-hash }}-${{ runner.os }}-${{ runner.arch }}
|