Commit graph

18 commits

Author SHA1 Message Date
Julian Knutsen
84390b03ab
ci(bazel): run every Windows/macOS job on Blacksmith; retire the Linux preflight leg and the cross-compiled Windows pair (#7355)
- pr.yml's Windows jobs and the macOS/Windows legs of pr-preflight-platforms
  and check-doc-freshness-platforms run on Blacksmith for every PR and merge
  group, forks and Dependabot included: no windows-latest/macos-latest
  fallback (Blacksmith serves this org's fork PRs). Matrix legs name their
  label (runs-on: ${{ matrix.runner }}); the same-repo "matrix marker"
  ternary and its policy plumbing are gone.
- pr-preflight-platforms drops its Linux leg: its tests run under Bazel on
  rbe-west (//scripts:scripts_test, //cmd/bd:bd_test,
  //internal/config:config_test).
- The Linux-cross-compiled Windows path is retired: windows-test-binaries,
  its two -prebuilt twins, main.yml's windows-test-binaries-cache, the
  WINDOWS_PREBUILT_REQUIRED flag and the build script/manifest. The native
  pair (test-windows-liveness, worktree-remove-windows) is the required run.
- main.yml's test-windows and blacksmith-macos-go-build-cache drop their
  GitHub-hosted venue legs (no GitHub-hosted consumer left).

Gate names unchanged. ga-96smfk.22

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-07 10:41:14 +00:00
Julian Knutsen
c1fc671fcf
ci: cross-build Windows test binaries on Linux (advisory side-by-side), drop PR macOS full suite (F4) (#7135)
* ci(F4): advisory Linux-cross-built Windows test binaries, macOS cache restore

Side-by-side rollout slice of the PR CI -> 5 min plan (F4):

- Add pr.yml `windows-test-binaries`: a Linux job that cross-compiles
  bd.exe and two go-test-c binaries (cgo and nocgo) for windows/amd64
  via mingw (CC/CXX=x86_64-w64-mingw32-*, matching release.yml's
  goreleaser setup), driven by a committed manifest
  (scripts/ci/windows-test-binaries.txt) and build script
  (scripts/ci/build-windows-test-binaries.sh). Artifacts are uploaded
  and consumed by two new advisory "-prebuilt" twins
  (test-windows-liveness-prebuilt, worktree-remove-windows-prebuilt)
  that run the identical test selection/flags/env (including
  BEADS_TEST_REPO_ROOT) against the prebuilt binaries via
  scripts/ci/run-go-test-binary.sh and scripts/test.sh's new
  BEADS_TEST_PREBUILT_TEST_BINARY short-circuit.
- The original native Windows jobs are untouched and remain required;
  the new jobs are advisory only (not in CI_GATE_REQUIRED) for this
  rollout phase. Flipping to the cross-built path later is a one-line
  CI_GATE_REQUIRED change.
- Add main.yml `windows-test-binaries-cache`: seeds the Go build cache
  for the cross-compile toolchain/packages on a schedule, mirroring
  the existing module/build cache warmers; reorder build-artifacts'
  warm-cache step to precede the module-cache save for a cleaner
  build -> warm -> save grouping.
- Restore macOS's native build-cache save step in main.yml (lost
  during an earlier job consolidation).
- Remove the non-required "Test (macos-latest)" full-suite job from
  PRs; the native macOS gate jobs still run, so required coverage is
  unaffected. This does drop a non-required pre-merge macOS race
  signal; see docs/notes for the accepted tradeoff.
- Add scripts/windows_test_binaries_manifest_test.go: policy tests
  pinning the manifest's three advisory-phase entries, pinning the
  mingw toolchain to release.yml's, checking consumer jobs only
  reference manifest-listed binaries, checking upload/download
  artifact names and `needs` match, checking the prebuilt jobs select
  exactly the same tests (-run literals) as their native counterparts,
  and checking none of the new jobs reference secrets (fork safety).
  All mutation-tested.
- Add two scripts/ci_workflow_apt_get_timeout_test.go budget entries
  for the new "Install mingw cross-compiler" steps.
- Fix two latent Bazel-only scripts_test failures surfaced while
  wiring the new test file into scripts/BUILD.bazel: materialize
  cmd/bd's sources via the existing //cmd/bd:go_srcs filegroup so
  sourceRepoRoot(t)-based package-directory checks work under Bazel's
  runfiles root, and strip Bazel's own TEST_TIMEOUT env var before
  exercising scripts/test.sh's hardcoded default in
  test_script_test.go (name collision with test.sh's own override
  knob).

Verified: go test ./scripts/...; bazel --nohome_rc test
//scripts:scripts_test; actionlint; shellcheck; make ci-pr-policy;
make bazel-sync-check; a from-scratch /tmp clone cross-build using
the exact job commands (cold 130.2s, warm/cache-hit 30.3s, PE32+
x86-64 validity via file/objdump, byte-identical SHA-256 across
cold/warm/traced runs); wine -test.list confirms
TestPrimeBinaryPortfolio/TestIsServerProbablyRunning* present in the
cgo binary and the full TestWorktreeRemove* family (including
Windows-specific variants) present in the nocgo binary.

Scoping note: only 2 of the spec's 4 consumer jobs (liveness,
worktree-remove) get prebuilt twins, and only 3 of 8 spec-listed
manifest binaries are built this slice; preflight, doc-freshness and
credential-fixture consumers are deferred as documented follow-up.

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

* fix(ci): address F4 review findings (SF-1..SF-6 + nits)

Addresses the F4 review (~/beads-bazel-plan/f4/review.md): no blockers, six
substantive findings plus several nits.

- SF-1: main.yml's windows-test-binaries-cache job now seeds the Windows
  cross-compile cache from both runner selections pr.yml's consumer job can
  land on (Blacksmith for same-repo PRs/merge_group, ubuntu-latest for
  forks/Dependabot) via a 2-leg matrix with identical keys/paths, instead of
  a single ubuntu-latest leg Blacksmith runners can never see.
- SF-2: removed the two consumer-less "Warm non-race Go build cache
  (test-only packages)" steps from main.yml (build-artifacts, test macOS
  leg); they had no real consumer and cost ~270s on main's macOS leg for
  nothing.
- SF-3: scripts/ci/run-go-test-binary.sh now injects the same
  -test.timeout=10m default (when -timeout is omitted) and unconditional
  -test.paniconexit0 flag `go test` itself injects; added
  timeout-minutes to test-windows-liveness-prebuilt; added a direct
  regression test (TestRunGoTestBinaryDefaultsTimeoutWhenOmitted) for the
  omitted-timeout branch, which no path through scripts/test.sh can reach
  (test.sh always supplies its own -timeout default first).
- SF-4: scripts/test.sh's BEADS_TEST_PREBUILT_TEST_BINARY branch now runs
  run-go-test-binary.sh as a child process (capturing and re-exiting its
  status) instead of `exec`-ing it, so the EXIT trap (beads_test_env_cleanup)
  still runs and the per-run BEADS_TEST_ENV_ROOT temp dir (and, with
  BEADS_TEST_SHARED_SERVER=1, the shared dolt sql-server) is cleaned up
  instead of leaked/orphaned.
- SF-5: closed the five surviving mutations (cgo/nocgo swap between the
  Windows prebuilt twins, dropped -count=1, an unguarded twin in
  ci-gate.needs, a goreleaser compiler change, a PKGDIR change) with
  dedicated policy tests, and replaced the three-edits-per-job required/
  advisory toggle with a single committed WINDOWS_PREBUILT_REQUIRED flag
  (pr.yml top-level env) in the style of the existing BAZEL_RETIRES_LEGACY_*
  flags: both Windows pairs are now unconditionally in ci-gate.needs and
  always evaluated, and only which pair lands in CI_GATE_REQUIRED vs.
  CI_GATE_SKIPPED_OK is decided by the flag, in one place.
- SF-6: dropped the //cmd/bd:go_srcs data dep from scripts_test; the
  prebuilt-binary contract test now exercises ./scripts/ci (already a data
  dep of this target) instead of ./cmd/bd, since it never builds or runs the
  real package.
- Nits: removed dangling ~/beads-bazel-plan references and a nonexistent
  test name from committed comments; log the resolved mingw-w64 version
  when cross-compiling; removed a no-op shellcheck disable comment;
  documented why run-go-test-binary.sh's BEADS_TEST_REPO_ROOT re-export
  doesn't race beads_test_env_enter's unset; rewrote the pr.yml tombstone
  comment for the removed macOS PR job to state the actual, narrower
  tradeoff instead of an overclaiming "main.yml covers this" statement.

Verified: bazel --nohome_rc test //scripts:scripts_test passes; actionlint
clean on pr.yml/main.yml; shellcheck clean on all edited scripts (only
pre-existing, unrelated warnings remain elsewhere); make bazel-sync-check
and make ci-pr-policy both pass.

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

* fix(scripts): isolate prebuilt-binary contract test from ambient hermetic env

TestTestScriptPrebuiltTestBinaryContract's "cleans up BEADS_TEST_ENV_ROOT
after the binary exits" subtest (added for F4 review finding SF-4) passed
locally but failed in CI's scripts-go-checks/scripts-test leg.

scripts/ci/scripts-go-test.sh (the CI driver for this package's `go test
./scripts/...` run) calls beads_test_env_enter in its own shell before
invoking go test, so BEADS_TEST_ENV_ACTIVE=1 and an outer
BEADS_TEST_ENV_ROOT are already present in this test binary's own
os.Environ(). runTestScriptPrebuiltBinary built the scripts/test.sh
subprocess's env from os.Environ() (minus TEST_TIMEOUT), so that ambient
state leaked through. Inside the subprocess, scripts/test.sh's own
beads_test_env_enter call (test.sh:17) saw the already-active guard and
no-opped: no new root, no new EXIT trap armed in that process - so the
fake binary observed the outer, still-alive root, and the subtest's
"directory is gone after test.sh exits" assertion failed, even though the
SF-4 fix (run the prebuilt binary as a child instead of exec'ing it) is
correct.

Every real production caller of scripts/test.sh's prebuilt path (pr.yml's
Windows liveness/worktree-remove prebuilt steps) runs it as the first
command of a fresh GitHub Actions `run:` step, never nested under an
already-entered hermetic env, so this nesting is purely an artifact of
this test binary's own ambient environment under scripts-go-test.sh, not
a real CI behavior gap.

Strip BEADS_TEST_ENV_ACTIVE/_ROOT/_DISABLE/_KEEP (alongside the existing
TEST_TIMEOUT filter) from the child env in runTestScriptPrebuiltBinary so
the subtest deterministically exercises scripts/test.sh's real top-level,
non-nested invocation regardless of what ambient hermetic-env state this
test binary itself happens to be running under.

Verified: reproduced the CI failure locally by exporting
BEADS_TEST_ENV_ACTIVE=1/BEADS_TEST_ENV_ROOT before `go test ./scripts/...`;
confirmed the fix resolves it; re-ran bazel test //scripts:scripts_test
and scripts/ci/scripts-go-test.sh directly, both pass.

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

---------

Co-authored-by: Gas City Adopt-PR <adopt-pr@gascity.local>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-03 11:49:56 -07:00
Jim Wordelman
a4bf13f042
Fix: test suites fail closed instead of open on the ambient Dolt port when no test container is started (be-napos) (#5885)
* test(dolt): red — testdb_* leak onto production Dolt port when Docker absent (refs be-h2h25)

* feat: green — Test suites create testdb_* on the PRODUCTION dolt server: harness fails open on the ambient port when Docker is absent (refs be-h2h25)

* docs(release-gate): add be-napos gate — ambient Dolt port fail-open to fail-closed

Deploy bead be-napos (build be-h2h25, review be-7fym1, verdict pass round 2).
7/7 gate criteria PASS; full independent evidence in the gate doc.

refs be-napos, be-h2h25, be-7fym1

* docs(release-gate): record PR link for be-napos gate

refs be-napos

* test(testutil): make the fail-closed gate deterministic, not Docker-conditional

The regression test skipped itself on every host that has Docker, by calling
the real EnsureDoltContainerForTestMain and skipping when it succeeded. That
asserted nothing on CI -- the only lane where it matters -- and on a
Docker-having host it also started the shared singleton container purely to
decide to skip, with no TestMain in internal/testutil to terminate it.

Add checkDoltFn, a package-level seam over checkDolt, so the test can force a
not-ready state without a Docker daemon and without starting a container. Only
EnsureDoltContainerForTestMain routes through it; the neighbouring t.Skip call
sites gate a skip rather than the fail-closed behaviour, so they keep calling
checkDolt directly.

The gate now covers all four not-ready states rather than the one the old test
happened to hit, which also pins the intent that an explicit
BEADS_TEST_SKIP=dolt opt-out must fail closed exactly as a Docker-less host
does. Split into a platform-independent half (the helper's own contract, both
variables cleared, idempotent) and a !windows half (the wiring, via the seam).

Red/green: with the neutralizeAmbientDoltPort call removed from the not-ready
branch, 4 of 4 subtests fail and 0 pass; restored, 4 of 4 pass in 0.06s with
no Docker and no container. (refs be-napos)

* fix(testutil): clear the ambient Dolt port on the Windows stub too

The Windows EnsureDoltContainerForTestMain returned its error without touching
BEADS_DOLT_SERVER_PORT / BEADS_DOLT_PORT, so the fail-open this branch fixes
still shipped there -- unconditionally, since that stub never succeeds. Windows
is a real lane: .github/workflows/pr.yml runs windows-latest on four jobs plus
the cross-platform matrix.

Gating it needed one pre-existing repair. testdoltserver_env_test.go has no
build tag but calls checkDolt, which is !windows-only, so the internal/testutil
test binary has never compiled for Windows -- reproduced identically on
origin/main. Tagging that file !windows fixes the whole package's Windows test
lane; without it a new Windows gate would compile nowhere and assert nothing,
which is the same defect this branch is already correcting.

Verified GOOS=windows go vet ./internal/testutil/ clean (it fails on
origin/main), and GOOS=windows go build clean before and after. The Windows
gate itself is compile-verified only -- no Windows host here to execute it.
(refs be-napos)

* docs(testing): state that ambient BEADS_DOLT_*_PORT is never honored

The guard fires on every not-ready state, not only "Docker unavailable" -- a
missing or wrong-version image and an explicit BEADS_TEST_SKIP=dolt opt-out
clear the ambient port too. That is deliberate: the invariant is the absence of
a test container, not the reason for it. Say so where the next person will look
before investigating, and name the supported way to target a specific server.
(refs be-napos)

* chore: remove leaked internal release-gate doc from PR branch

  release-gates/be-napos-ambient-dolt-port-failclosed-gate.md

Tracked our internal gc-management/beads-rig release-gate checklist and
should never have been committed to this upstream branch -- it's process
residue from our deploy tooling, not part of the change itself.

Per maintainer bee-ghosttrack's request during review of PR #6571. The
root cause (our deploy tooling auto-committing this file) is already fixed
as of gm-qatxl1; this branch predates that fix, so this commit is cleanup
only -- no other content on this branch is touched.

Ref: be-lk7o3

* chore(bazel): enumerate the PR's new test files in BUILD.bazel

Base added BUILD.bazel to internal/testutil and internal/storage/dolt after
this PR was opened (#6881 made the Bazel lane real, and fork PRs always run
it). The four new test files this PR adds were therefore absent from the
go_test srcs lists, which the bazel lane's equivalence check reports as a
missing target.

Generated by 'make bazel-sync' (gazelle), not hand-edited, because the CI
drift step diffs against exactly what gazelle emits.

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

* fix(testutil): reconcile the shared-server harness with the fail-closed clear

Review iterations 1-2 (adopt-pr, PR #5885): every gating finding from both
review syntheses, plus their minors and nits.

Iteration 1, Major 1 (Change Impact / Blast Radius). scripts/test.sh's
BEADS_TEST_SHARED_SERVER=1 flow starts a dockerless `dolt sql-server` and
exports BEADS_DOLT_PORT for every package to reuse. checkDolt() has no notion
of an already-provisioned shared server, so on that flow's primary audience --
a host without Docker -- all 12 EnsureDoltContainerForTestMain callers erased
the harness's own sanctioned port before m.Run(), turning green dockerless runs
red, while engdocs/CI_TEST_SURFACE_AUDIT.md and the new TESTING.md paragraph
advertised the two mechanisms unreconciled.

Taken: a dedicated marker, BEADS_TEST_SHARED_DOLT_SERVER, exported by
scripts/test.sh beside the port it allocated, which the helper's failure paths
honor. Both docs state the reconciliation, including the precedence: a
container, where one can be started, still overwrites both variables. Not
taken: "skip the clear when BEADS_TEST_SHARED_SERVER=1 and a port var is
already set". That flag is overloaded (cmd/bd/shared_server_integration_test.go
reads it too), and the script starts no server when a port is already set, so
the flag beside a port is exactly the case where the port is ambient.

Iteration 2, blocker (Behavioral Correctness). Iteration 1 shipped that marker
as a boolean ("1") which spared BOTH port variables, while the script vouched
only for the BEADS_DOLT_PORT it exported and its entry guard never looked at
BEADS_DOLT_SERVER_PORT -- the variable applyConfigDefaults resolves first. The
runner's test environment (beads_test_env_enter) unsets both variables before
the flow runs, so the hole needed that isolation skipped, e.g. with the
documented BEADS_TEST_ENV_DISABLE=1; then an inherited BEADS_DOLT_SERVER_PORT
reached `go test` beside the marker and outranked the shared server --
gm-2g3g5r, re-opened by its own fix. Measured with a fake `go` that prints its
environment: SERVER_PORT=59999 PORT=<shared> MARKER=1 under the iteration-1
script. Now:

  - the marker's value is the port it vouches for, and the helper decides per
    variable (neutralizeUnvouchedDoltPorts): only a variable holding exactly
    that port survives, and says so on stderr; every other one is cleared,
    marker or not;
  - the flow starts only when neither port variable is set, and says on stderr
    when BEADS_TEST_SHARED_SERVER=1 is ignored for that reason.

Not taken: also exporting BEADS_DOLT_SERVER_PORT from the flow. The widened
guard means it is always unset there, so the export adds no safety, and five
sites read that variable alone (internal/doltserver/doltserver.go:796,
cmd/bd/init.go:773 and :1351, cmd/bd/bootstrap.go:857,
internal/testutil/testdoltbranch.go:164) -- consumers the flow has never fed.

Iteration 2, minor (Test Evidence Quality). The exception's second arm, a
container that would not start, was reached by no test with its guard live.
Both failure paths now share one clear, and the container start is a seam
(startSharedContainerFn, pinned to startSharedContainer by identity) so tests
reach that path without consuming doltServerOnce.
TestEnsureDoltContainerForTestMain_KeepsHarnessProvisionedPort runs its whole
table, marked_but_divergent_var included, through both paths.

Iteration 2, minor (Contract & Interface Fidelity). The marker prose in
TESTING.md, CI_TEST_SURFACE_AUDIT.md, test.sh and testdoltserver.go describes
the per-port behavior the code now implements.

Iteration 1, Major 2 (Contract & Interface Fidelity). neutralizeAmbientDoltPort's
doc comment claimed "With no port resolvable, applyConfigDefaults'
BEADS_TEST_MODE guard forces port 1". Clearing the env vars is not "no port
resolvable": resolution falls through to the file chain and derives a
directory from filepath.Dir(cfg.Path) when BeadsDir is empty
(store.go:1661-1664), so a reachable .beads/dolt-server.port still yields a
non-zero port and the ServerPort == 0 arm (store.go:1683-1687) never fires;
production-port detection is strictly narrower than resolution. Narrowed to
what the change actually guarantees -- no environment-named port is honored --
at all three sites carrying the claim: the helper doc, the TESTING.md
paragraph, and TestApplyConfigDefaults_NoResolvablePortFailsClosed's own
comment, whose fixture (an empty beadsDir) is what excludes the surviving
path. The residual stays tracked in be-rl6tm. That test's stale
cross-reference to a renamed test is corrected in the same pass.

Iteration 1, minor (Test Evidence Quality). The Windows gate's comment claimed
a CI lane it does not have; it now states the coverage exactly --
compile-checked, not CI-executed -- and lists the four windows-latest jobs'
named selectors.

Iteration 1, nits. doltServerErr is read under doltServerMu via
sharedContainerErr(); TestCheckDoltFn_DefaultsToRealProbe pins function
identity with reflect instead of asserting non-nil, which any leaked stub
satisfied.

Mutation ledger (scoped `go test ./internal/testutil/`, scrubbed env; every
mutant restored from a copy and verified byte-identical):

  a set marker spares every    marked_but_divergent_var, divergent_legacy_var,
  variable (the i2 blocker)    marker_names_neither_var and boolean_marker red
                               on BOTH failure paths
  the marker covers            marked_but_divergent_var, marker_names_neither_var
  BEADS_DOLT_PORT only         and boolean_marker red on both paths
  presence instead of value    the same red set as the first row
  no clear after a failed      the 5 container_start_failed cases that expect
  container start              a clear red; every not_ready case stays green
  start attempted before the   all four incumbent fail-closed subtests and
  probe                        every not_ready case red
  leak a wrapper into          StartSharedContainerFn_DefaultsToRealStart red
  startSharedContainerFn
  delete the hermetic          ClearsAmbientPortWhenNotReady red
  t.Setenv, marker ambient
  at the fixture's port

Full package green with Docker, including the real-container
EnsureDoltContainerForTestMain path (43 test and subtest passes, no skips);
`go test ./scripts/`, which drives test.sh, green; `GOOS=windows go vet
./internal/testutil/` clean; `tools/bazel/go_srcs.py --check` clean, and no
BUILD change is due (no new files, no new non-stdlib imports).

Deferred deliberately: the iteration-1 synthesis's optional windows-latest step
for ./internal/testutil/. It is newly feasible -- this branch is what made the
package's Windows test binary compile -- but it would also newly execute four
pre-existing test functions in this package that have never run on Windows, so
it belongs in its own change. RequireDoltContainer's unsynchronized
doltServerErr read is base-owned and left alone for the same reason.

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

---------

Co-authored-by: Julian Knutsen <julian@gastownhall.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Gas City Adopt-PR <adopt-pr@gascity.local>
2026-10-01 05:21:49 -07:00
ecuthiell
07d679ea51
fix: export the native prebuilt test binary path (#5512)
Derive the complete test-runner output with go env GOEXE before both
building and exporting it. Add a fast process regression for launchability
and caller precedence, maintained by the existing three-host preflight lane.

Fixes #5502

Agent-Signature: codex-gpt-5-unknown-reasoning on behalf of Ewen Cuthiell
2026-08-10 05:31:23 -07:00
Steve Yegge
48cbef2430
fix(test): prebuild bd for subprocess tests; fit cmd/bd inside the package deadline (wy-4mtr0) (#5067)
'./scripts/test.sh' with no flags could never produce a green full-suite
receipt: cmd/bd tripped the 3m per-package go test deadline (panic
'test timed out', one test running at 0s — the package alarm, not a
hang). Measured on the reporting machine class: ~494s of serial test
time across ~770 tests, dominated by (1) a dozen test helpers that each
'go build' the full cgo bd binary inside the test run and (2) subprocess
tests spawning bd + embedded Dolt per invocation.

Three-part fix, no naked timeout bump:

- scripts/test.sh now prebuilds bd once and exports BEADS_TEST_BD_BINARY
  — the same fast path CI has used all along (main.yml prebuilt
  artifact); the local runner just never got it. Binary lands in the
  test-env root so cleanup is inherited; caller-supplied values win;
  skipped when the requested packages can't include cmd/bd.
- Every in-test builder now honors BEADS_TEST_BD_BINARY (six sites
  built unconditionally before). The repo-root ./bd reuse in
  buildBDForInitTests and cli_fast_test is REMOVED: it silently ran
  subprocess tests against whatever stale binary sat in the checkout
  root — a two-day-old one produced phantom TestCreateDepsAtomicity
  failures during this investigation. Tests must exercise the
  checkout's source or an explicitly supplied binary, never an
  incidental artifact.
- Default TIMEOUT raised 3m -> 10m with the measurement recorded in the
  comment: it is cmd/bd's floor, not an arbitrary pick.


Claude-Session: https://claude.ai/code/session_01EF8QbCbF6JnTuoCKvu9xiG

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-27 15:10:21 -07:00
Julian Knutsen
9e8d411f71
Add PR CI wrapper command surface (#4211)
* ci: add PR wrapper command surface

* ci: collect wrapper timing in PR checks

* docs: record initial CI wrapper measurements

* ci: add manual measurement workflow

* ci: allow branch measurement dispatch

* ci: keep measuring independent commands after failures

* docs: record branch-dispatched CI measurement

* ci: keep measuring package suites after failures

* docs: record CI measurement batch

* fix: repair CI-measured test failures

* test: make local Go gates hermetic

* ci: add sharded integration measurement lane

* test: fix internal beads integration TestMain

* docs: record fixed integration shard measurement

* ci: add hybrid integration sharding measurement

* ci: speed up cmd/bd test shard discovery

* ci: add 16-way integration sharding measurement

* ci: measure prebuilt cmd bd sharding

* docs: record prebuilt sharding measurement

* docs: design CI build artifact stage

* docs: record repeat prebuilt integration measurement

* ci: add build artifact stage

* ci: reuse build artifact in linux test lane

* ci: promote main linux integration shards

* ci: gate legacy platform tests to main

* ci: satisfy workflow shell lint

* ci: ignore archived migrations in duplicate check

* ci: add package gate wrappers

* test: clean up testing short boundaries

* ci: allow unreleased version docs lag

* ci: gate releases on package checks

* ci: split workflow by tier

* ci: add aggregate PR gates
2026-05-29 18:52:53 -07:00
matt wilkie
2ade22e84c
chore(build): codify the gms_pure_go build-tag policy (GH#3303)
Converges the sprinkle of -tags=gms_pure_go fixes into a single source plus a source-time CI guard. .buildflags is now canonical (exports GOFLAGS, CGO_ENABLED), scripts source it, scripts/check-build-tags.sh runs in CI to catch bare go commands. Fixes 5 latent bugs the guard caught (regression.yml, Makefile bench/test-regression, devcontainer, embedded-test-shard fallback, smoke-test scripts).
2026-04-16 12:28:11 -07:00
matt wilkie
df25aa9229
Rename ICU-only test path to explicit opt-in workflow (bd-b18) (#3291) 2026-04-16 08:54:24 -07:00
matt wilkie
fda23dc8e1
Default test/install helpers to gms_pure_go (#3259) 2026-04-14 10:05:07 -07:00
beads/crew/emma
982164a481 feat(testutil): reuse existing Dolt server via BEADS_DOLT_PORT (L1)
StartTestDoltServer now checks BEADS_DOLT_PORT before spawning a new
server. If the env var is set and the server is reachable, it returns a
lightweight handle with no-op cleanup. Falls through with a warning if
the port is stale.

scripts/test.sh gains BEADS_TEST_SHARED_SERVER=1 mode that pre-starts
a single server and exports the port for all test packages.

Closes: bd--sxnz

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-24 16:16:56 -08:00
beads/crew/emma
2137693dad revert: restore embedded Dolt mode (was only supposed to be removed from Gas Town)
Revert commits e5330641 and 0df41523 which removed embedded Dolt mode
from the beads codebase. The embedded Dolt removal was only intended for
Gas Town, not for Beads.

Restores:
- dolthub/driver dependency and embedded connection path
- Advisory flock (AccessLock) for concurrent process protection
- Embedded connector lifecycle management in DoltStore
- All CGO build tags across ~45 files
- Vendored go-icu-regex library
- nocgo stub files for non-CGO builds
- Bootstrap and embedded_uow helpers
- factory_dolt_test.go and dolt_singleprocess_test.go

Merge conflict resolutions:
- store.go: TCP fail-fast check wrapped inside if cfg.ServerMode
- store.go: backtick-quoting for embedded CREATE DATABASE (prefix-based names)
- perf_dolt.go: port references updated from 3306 to 3307
- ci.yml: restored continue-on-error for Nix (dolthub/driver requires Go 1.25.6+)

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-07 21:21:24 -08:00
obsidian
e533064122 feat: remove embedded Dolt mode, keep server-only connections (bd-esqfe)
Remove the embedded Dolt driver (dolthub/driver) and all associated code,
keeping only server-mode connections via MySQL protocol to dolt sql-server.

Key changes:
- Remove dolthub/driver dependency and go-icu-regex vendored dep
- Remove embedded connection path, access locks, bootstrap, nocgo stubs
- Remove CGO build tags from all ~40 files
- Remove CGO/ICU settings from Makefile and scripts/test.sh
- Simplify configfile: Dolt is always server mode now
- Update doctor checks, factory, daemon guard for server-only
- Binary size reduced from ~120MB to ~44MB

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

Executed-By: beads/polecats/obsidian
Rig: beads
Role: polecats
2026-02-05 21:30:53 -08:00
mayor
fe8d7c1f14 fix: eliminate dolt split-brain root cause (B1+B2) and fix CGO build
B1: DatabasePath() now always resolves to .beads/dolt/ for dolt backend,
ignoring stale Database field values like town, wyvern, beads_rig
that caused bd to look in the wrong directory.

B2: bootstrapEmbeddedDolt() now blocks JSONL auto-import in dolt-native
sync mode. If the dolt DB does not exist, it returns an error instead of
silently creating a new database from stale JSONL backup.

B-build: Makefile and scripts/test.sh now detect Homebrew keg-only
icu4c and export CGO_CFLAGS/CGO_CPPFLAGS/CGO_LDFLAGS so dolt
go-icu-regex dependency can compile and link.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 20:29:34 -08:00
Steve Yegge
1611f16751 refactor: remove unused bd pin/unpin/hook commands (bd-x0zl)
Analysis found these commands are dead code:
- gt never calls `bd pin` - uses `bd update --status=pinned` instead
- Beads.Pin() wrapper exists but is never called
- bd hook functionality duplicated by gt mol status
- Code comment says "pinned field is cosmetic for bd hook visibility"

Removed:
- cmd/bd/pin.go
- cmd/bd/unpin.go
- cmd/bd/hook.go

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 16:02:15 -08:00
Steve Yegge
c8b912cbe6 bd sync: 2025-12-27 15:56:42 2025-12-27 15:56:42 -08:00
Jordan Hubbard
0b6ec57928 test: add cmd/bd helper coverage and stabilize test runner
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2025-12-26 17:55:51 -04:00
Jordan Hubbard
6c37a58148 test: report total coverage from make test
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2025-12-26 09:47:48 -04:00
Steve Yegge
0040e8029b feat: Add test infrastructure with automatic skip list
Overview: Added comprehensive test infrastructure to handle the large
test suite (41K LOC, 313 tests in cmd/bd alone) with automatic skipping
of known broken tests.

Changes:
- .test-skip: List of broken tests to skip (with GH issue references)
- scripts/test.sh: Smart test runner that auto-skips broken tests
- docs/TESTING.md: Comprehensive testing guide
- .claude/test-strategy.md: Quick reference for AI agents
- Updated Makefile to use new test script

Known Issues Filed:
- GH #355: TestFallbackToDirectModeEnablesFlush (database deadlock)
- GH #356: TestFindJSONLPathDefault (wrong JSONL filename)

Performance: 3min total (180s compilation, 3.8s execution)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 22:43:04 -05:00