beads/.github/workflows
Julian Knutsen 4e4ebdb443
feat(backup): proxied auto-backup on managed-local, serialized with bd backup sync (#6879)
* feat(backup): run opted-in auto-backup on a managed-local proxied server

#6584 routed the five `bd backup` verbs over the proxied provider on
managed-local, and #6694 made `bd backup status` admit the remaining gap:
the proxied arm of PersistentPostRunE never called runPostRunAutoBackup,
so backup.enabled=true was inert on every proxied workspace. Close it.

The proxied arm now calls the auto-backup hook before it closes the
provider, under the direct arm's maintenance gate (strict --readonly,
`bd serve`, a migration freeze) plus previews. maybeAutoBackup picks a
backend for the command: the direct store as before, or the proxied
provider's RunNonTx seam, which `bd backup sync` already uses.

The proxied backend is honored exactly where `bd backup sync` is: the
"backup sync" capability row's rule for this workspace's topology, so
managed-local only. Auto-backup registers a server-side backup remote,
which on a server bd does not own is global to every client; an implicit
trigger must not get further than the explicit verb. It never opens a
provider of its own: a command that opened none (`bd dolt stop`) or
closed it (restore) backs nothing up rather than relaunching the server.
The default stays OFF, as on every server-mode workspace.

The register/sync-to-a-local-dir sequence that DoltStore and
EmbeddedDoltStore each carried a copy of moves to
versioncontrolops.BackupToDir (and HEAD lookup to CurrentCommit), so the
proxied backend reuses it instead of adding a third copy.

Tests: TestManagedLocalProxiedAutoBackup (default off, opt-in writes a
restorable backup, change detection, `bd dolt stop` stays quiescent,
restore round trip with issue-set equality; fails against origin/main);
TestManagedLocalProxiedBackupRestoreRefusedWhileAttached pins the restore
design (refused while another bd client holds the workspace, serving
child untouched, succeeds once it detaches); unit tests for the backend
locality gate, the post-run wiring, the status note and BackupToDir.
Both managed-local tests, and the existing round trip, are added to the
proxied-local smoke lane's compiled-in list.

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

* fix(backup): serialize auto-backup and bd backup sync with a workspace backup lock

Review follow-up on #6879. Auto-backup and an explicit bd backup sync
both run under the command's SHARED workspace gate, so nothing stopped
them overlapping, and auto-backup's remove -> add -> sync on one fixed
remote name races a concurrent copy of itself.

A per-workspace flock (.beads/backup.lock, already gitignored by
*.lock) now serializes them in every mode. Auto-backup takes it
non-blocking and skips when held (the throttle is left alone, so a
later command retries). bd backup sync waits up to exclusiveGateWait -
the bound restore's exclusive gate acquisition uses - then fails with
"another backup is running for this workspace" before touching the
store. Restore needs no part in it: its exclusive workspace gate
already excludes every command that could hold the lock.

Tests: lock semantics (refusal while held, bounded wait, release),
auto-backup skipping while held and running once released, and sync
failing loudly without reaching the store.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 02:45:58 -07:00
..
bazel.yml ci(bazel): PR-gate parity lanes (docker, pure-Go, js/wasm) + bd artifact (#6887) 2026-09-28 02:03:51 -07:00
ci-measurements.yml Merge release/1.3.0 into main (post-tag forward-port) 2026-09-15 22:09:13 +00:00
close-stale-needs.yml ci: add needs-triage inbox labeling (mirrors gastownhall/gascity) (#6622) 2026-09-19 14:37:19 -07:00
conformance.yml release: prep v1.3.0 — version bump, changelog rollup, release process docs, formula fixes (#6038) 2026-08-30 22:19:35 -07:00
cross-version-smoke.yml release: prep v1.3.0 — version bump, changelog rollup, release process docs, formula fixes (#6038) 2026-08-30 22:19:35 -07:00
deploy-pages-redirect.yml build(deps): bump actions/checkout from 7.0.0 to 7.0.1 (#5016) 2026-07-25 08:52:22 -07:00
docs-autofix.yml build(deps): bump actions/checkout from 7.0.0 to 7.0.1 (#5016) 2026-07-25 08:52:22 -07:00
docs-mintlify.yml build(deps): bump the actions group across 1 directory with 3 updates (#5059) 2026-07-25 19:05:02 -07:00
main.yml fix(prime): honor shared-server mode consistently across bd prime's store resolution paths (#6589) 2026-09-27 10:32:56 -07:00
migration-test.yml test(migration): wisp-plane upgrade corpus — seed and assert the ignored-plane classes the 1.3.0 chain depends on (#6049) 2026-08-28 23:24:39 -07:00
nightly.yml ci(bazel): advisory Bazel workflow + go test/Bazel equivalence check (#6881) 2026-09-27 23:05:21 -07:00
nix-build.yml chore(deps): bump DeterminateSystems/determinate-nix-action (#6042) 2026-09-02 17:41:12 -07:00
pr-risk.yml Accept uutils coreutils timeout in generated hooks, and check the shims against real implementations (#6561) 2026-09-27 03:38:45 -07:00
pr.yml fix(prime): honor shared-server mode consistently across bd prime's store resolution paths (#6589) 2026-09-27 10:32:56 -07:00
proxied-local-smoke.yml feat(backup): proxied auto-backup on managed-local, serialized with bd backup sync (#6879) 2026-09-28 02:45:58 -07:00
regression.yml release: prep v1.3.0 — version bump, changelog rollup, release process docs, formula fixes (#6038) 2026-08-30 22:19:35 -07:00
release.yml fix: bound and retry apt-get calls in CI to avoid unbounded 15-minute job timeout (#5810) 2026-08-19 11:47:22 -07:00
remove-needs-info.yml ci: add needs-triage inbox labeling (mirrors gastownhall/gascity) (#6622) 2026-09-19 14:37:19 -07:00
remove-needs-triage.yml ci: add needs-triage inbox labeling (mirrors gastownhall/gascity) (#6622) 2026-09-19 14:37:19 -07:00
request-needs-info.yml ci: add needs-triage inbox labeling (mirrors gastownhall/gascity) (#6622) 2026-09-19 14:37:19 -07:00
test-pypi.yml build(deps): bump the actions group across 1 directory with 3 updates (#5059) 2026-07-25 19:05:02 -07:00
triage-label.yml ci: add needs-triage inbox labeling (mirrors gastownhall/gascity) (#6622) 2026-09-19 14:37:19 -07:00
update-flake-lock.yml chore(deps): bump DeterminateSystems/determinate-nix-action (#6042) 2026-09-02 17:41:12 -07:00
update-vendor-hash.yml chore(deps): bump DeterminateSystems/determinate-nix-action (#6042) 2026-09-02 17:41:12 -07:00