Commit graph

6 commits

Author SHA1 Message Date
Robin Carswell
dfde51f9a8
fix: bd dolt pull fails when remote added without branch tracking (#3443)
* fix: fall back to DOLT_FETCH+DOLT_MERGE when DOLT_PULL fails on missing branch tracking

When a remote is added via bd dolt remote add (rather than bd bootstrap
or dolt clone), repo_state.json has an empty "branches" map. DOLT_PULL
then fails with "did not specify a branch" even when the branch is
passed explicitly, because Dolt checks upstream tracking config first.

This fix detects that specific error in pullWithAutoResolve and falls
back to the DOLT_FETCH + DOLT_MERGE approach already used by
versioncontrolops.Pull (GH#3144). The fallback preserves the existing
metadata conflict auto-resolution logic.

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

* test(dolt): add regression tests for GH#3144 branch-tracking fallback

pullWithAutoResolve_BranchTrackingFallback (no build tag) injects the
exact Dolt tracking-error text via a stored procedure SIGNAL, then
verifies pullWithAutoResolve enters the DOLT_FETCH + DOLT_MERGE fallback
path (confirmed by the 'fetch from' error when no remote is configured).
Covers lines A–D of the fallback block.

pullWithAutoResolve_BranchTrackingSuccess (//go:build integration)
reproduces the real failure scenario end-to-end: a remote is added via
DOLT_REMOTE('add', ...) rather than clone, leaving repo_state.json with
an empty 'branches' map, causing DOLT_PULL to fail with the tracking
error. The test then verifies pullWithAutoResolve succeeds via the
DOLT_FETCH + DOLT_MERGE fallback. Covers lines E–I of the fallback block.

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

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-24 10:15:36 -07:00
coffeegoddd☕️✨
1684130a26 /{cmd,docs,internal}: get bootstrap and init working correctly and remote agnostic 2026-04-10 14:37:49 -07:00
Bella-Giraffety
4e4d958baf
fix: prefer bootstrap for missing database recovery (#2940)
* fix: prefer bootstrap for missing database recovery

Executed-By: beads/crew/emma

* fix: align doctor recovery guidance with bootstrap

Executed-By: beads/crew/emma

* fix: let bootstrap recover missing server databases

Executed-By: beads/crew/emma

* fix: bootstrap missing server databases safely

Executed-By: beads/crew/emma

* fix: fail closed on bootstrap server probe errors

Executed-By: beads/crew/emma

* fix: honor runtime server config in bootstrap

Executed-By: beads/crew/emma

* docs: soften bootstrap-first recovery wording

Executed-By: beads/crew/emma

* fix: report resolved bootstrap server port

Executed-By: beads/crew/emma

* fix: repair test failures from build tag mismatch and mode detection

Three issues causing CI failures on macOS and Ubuntu:

1. detectBootstrapAction used isEmbeddedMode() (global state) to choose
   the database path, but tests set cfg.DoltMode without updating the
   global serverMode flag. Switch to cfg.GetDoltMode() so the detection
   logic respects the config object passed by the caller.

2. TestDetectBootstrapAction_NoneWhenDatabaseExists created a "dolt"
   directory but default (embedded) config looks for "embeddeddolt".
   Fix the test to create the correct directory.

3. embeddeddolt/slots.go and new_methods_test.go used //go:build
   embeddeddolt tag while all other files in the package use cgo,
   causing interface satisfaction failures. Also fix undefined
   isEmbeddedDolt reference (should be isEmbeddedMode()).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Executed-By: beads/crew/emma

---------

Co-authored-by: mayor <thalia.geraghty@fiserv.com>
Co-authored-by: beads/crew/emma <steve.yegge@gmail.com>
2026-04-02 19:52:58 -07:00
lydia
eae64cabcc fix: detect backup files on database-not-found and after bd init (GH#2327)
When switching git branches, the Dolt database does not travel with the
branch, causing database not found errors. Previously the error message
only mentioned server misconfiguration. Now it:

1. Checks for .beads/backup/*.jsonl files and suggests bd backup restore
2. Lists branch switching as a common cause
3. After bd init creates a fresh DB, warns if backup files exist

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 20:08:44 -07:00
Peter Chanthamynavong
1ca5e8ca01 feat(dolt): surface sync.git-remote in database-not-found errors
- Add SyncGitRemote field to Config and route it through construction site
- Extract databaseNotFoundError() with config-aware hint generation
- Hint suggests setup when remote is empty; names the remote when configured

Improves fresh clone discoverability by guiding users toward the correct
next step when the database is not found.
2026-03-05 13:48:04 -08:00
opal
06eff8af49 feat: centralize error handling in dolt storage layer (bd-bwk2)
Create internal/storage/dolt/errors.go with:
- Sentinel errors: ErrTransaction, ErrQuery, ErrScan, ErrExec
- Helper functions: wrapDBError, wrapTransactionError, wrapScanError,
  wrapQueryError, wrapExecError
- wrapDBError converts sql.ErrNoRows to storage.ErrNotFound

Apply centralized wrapping to bare `return err` patterns in:
- transaction.go: All CRUD operations now wrap with operation context
- queries.go: computeBlockedIDs, GetEpicsEligibleForClosure,
  getChildrenOfIssues, GetMoleculeProgress, GetNextChildID
- dependencies.go: GetBlockingInfoForIssues, IsBlocked,
  GetNewlyUnblockedByClose, scanIssueIDs, getIssuesByIDsDolt

This enables errors.Is() checks against sentinel types and provides
consistent operation context for debugging production issues.

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

Executed-By: beads/polecats/opal
Rig: beads
Role: polecats
2026-02-27 16:23:23 -08:00