Commit graph

22 commits

Author SHA1 Message Date
coffeegoddd☕️✨
84d8796ae5 /{cmd,internal}: wip, removing ignored table code 2026-05-12 09:53:56 -07:00
GGPrompts
75963699e0 fix(embeddeddolt): pass DOLT_REMOTE_USER to push/pull/fetch
Embedded-mode push/pull route through versioncontrolops.{Push,Pull,
ForcePush,Fetch}, which always invoked CALL DOLT_PUSH/PULL/FETCH
without --user. The non-embedded DoltStore path has the
'if s.remoteUser != ""' branch that fires CALL DOLT_PUSH('--user',
?, ?, ?), but the embedded path bypasses it entirely.

Result: against a Dolt remotesapi server that requires CLONE_ADMIN
authentication, bd dolt push/pull from embedded mode fails with
"unauthenticated user does not have privilege CLONE_ADMIN", even when
DOLT_REMOTE_USER and DOLT_REMOTE_PASSWORD are set in the environment.
The shell-level workaround was to bypass bd: cd into the embedded
database dir and run 'dolt push --user beads origin main' directly.

Fix: extend versioncontrolops.{Push,Pull,ForcePush,Fetch} with a
trailing 'user string' (empty preserves prior behavior). When non-empty,
the SQL stored procedures get '--user' appended. EmbeddedDoltStore
reads DOLT_REMOTE_USER from the environment at call time and threads
it through; DOLT_REMOTE_PASSWORD is read by the in-process Dolt
server from the same env, matching the existing contract documented
on bd dolt push/pull.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 18:17:43 -04:00
matt wilkie
bc74f7e897
fix(fetch): run GC after failed DOLT_FETCH to prevent tmp_pack_* accumulation (#3326)
When DOLT_FETCH fails (network error, timeout, authentication), Dolt
leaves orphaned tmp_pack_* files in .dolt/git-remote-cache/. These
accumulate unboundedly across repeated failures and are never cleaned
up automatically.

Observed impact: 194 GB of tmp_pack_* debris on a single machine after
months of failed federation syncs.

Call DoltGC best-effort after a failed fetch so orphaned pack
temporaries are reclaimed before the error propagates. DoltGC requires
a non-transactional connection; if db is a transaction the GC will
fail silently, which is acceptable — the original fetch error is still
returned correctly.

Cherry-picked from #3308 by @athosmartins. The original PR bundled an
unrelated Gas Town schema migration (re-adding the `crystallizes`
column that migration 012 explicitly dropped) and accidentally deleted
a working #nosec directive in rules.go, so this pulls out just the
valuable fix.

Closes bd-fst

Co-authored-by: Athos Bernardes <athosmartins@gmail.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-17 16:01:11 -07:00
matt wilkie
d46a84be37
fix: avoid nil-pointer panic in bd dolt pull (embedded mode) (#3148)
Replace DOLT_PULL(remote, branch) with DOLT_FETCH + DOLT_MERGE to work
around a nil-pointer dereference in Dolt's doDoltPull when branch
tracking is not configured in repo_state.json.

Fixes GH#3144

Amp-Thread-ID: https://ampcode.com/threads/T-019d7329-1065-71ab-9fca-e4df3f7370c3

Co-authored-by: Amp <amp@ampcode.com>
2026-04-09 11:24:15 -07:00
Scott Parrish
cace7c52b7
fix(dolt): pass branch to DOLT_PULL to match DOLT_PUSH behavior (#3137)
DOLT_PULL('origin') with only the remote name causes a nil pointer
dereference in the embedded Dolt driver when resolving the branch from
tracking config. DOLT_PUSH already passes both remote and branch.

This aligns Pull() with Push() by passing the branch parameter:
  DOLT_PULL('origin')       → DOLT_PULL('origin', 'main')

Tested with GCS, file, and git+ssh remotes in embedded mode.

Fixes #2118 (related)
2026-04-08 12:50:48 -07:00
coffeegoddd☕️✨
40e5eb11a9 /internal/storage/schema: use shared schema package 2026-04-06 15:03:20 -07:00
coffeegoddd☕️✨
b4284a29be /internal/storage: shared ensure ignored 2026-04-06 14:21:23 -07:00
Robin Carswell
a097723f28
fix: suppress auto-backup address conflict warning (#2927)
* fix: suppress auto-backup address conflict warning when default backup is configured

When a user runs `bd backup init <path>` it registers a Dolt backup named
"default". The auto-backup system also calls BackupDatabase() which registers
its own remote named "backup_export" pointing to the same .beads/backup/
directory. Dolt returns "Error 1105: address conflict with a remote: 'default'"
because two remotes cannot share a URL, causing a noisy warning on every write:

  Warning: auto-backup failed: register backup remote: add backup backup_export: \
  Error 1105: address conflict with a remote: 'default' -> file://.../backup

Fix: when BackupAdd fails with an address conflict, extract the name of the
already-registered remote from the error message and sync using that name
instead. The backup still runs — it just reuses the existing remote.

Adds ExtractAddressConflictName() to versioncontrolops for parsing the
conflicting name out of the Dolt error. Applies the fix to both the
EmbeddedDoltStore and DoltStore implementations of BackupDatabase().

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

* test: add table-driven tests for ExtractAddressConflictName

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02 20:28:47 -07:00
coffeegoddd☕️✨
9b30a7f911 /{cmd,internal}: fix restore 2026-03-28 13:47:20 -07:00
coffeegoddd☕️✨
fb0bdbc60a /{cmd,internal}: update backup command 2026-03-28 13:47:20 -07:00
coffeegoddd☕️✨
8e95849371 /internal/storage: pr feedback 2026-03-26 11:17:39 -07:00
coffeegoddd☕️✨
979d4f7052 /{cmd,internal}: bootstrap, compact, migrate 2026-03-26 10:59:57 -07:00
coffeegoddd☕️✨
dd83e2a03c /{cmd,internal}: pr feedback 2026-03-25 15:09:54 -07:00
coffeegoddd☕️✨
6e22db5c88 /{cmd,internal}: add maintenance tests 2026-03-25 14:22:58 -07:00
coffeegoddd☕️✨
ec6b65d2e1 /{cmd,internal}: fix commands 2026-03-25 13:48:13 -07:00
coffeegoddd☕️✨
40cc4d2fb4 /{.github,cmd,internal}: pr feedback, ci fix 2026-03-25 12:58:46 -07:00
coffeegoddd☕️✨
f06e587434 /internal/storage: refactor RunInTransaction 2026-03-25 10:15:26 -07:00
coffeegoddd☕️✨
a2f5639b14 /{.github,cmd,internal}: sync and data integration tests 2026-03-24 16:49:44 -07:00
coffeegoddd☕️✨
fb29c90a66 /internal/storage: pr feedback 2026-03-24 12:56:10 -07:00
coffeegoddd☕️✨
880d657411 /{cmd,internal}: fix comments 2026-03-24 12:29:05 -07:00
coffeegoddd☕️✨
9016f248d4 /{cmd,internal}: remove dead code 2026-03-24 12:01:16 -07:00
coffeegoddd☕️✨
219d1a509b /{cmd,internal}: wip sync and data EmbeddedDoltStore methods 2026-03-24 12:01:16 -07:00