fix(beads): detect embeddeddolt/ directory in database discovery#2909
Merged
Conversation
findDatabaseInBeadsDir() only checked for .beads/dolt/ when looking for an existing database. In embedded mode (now the default), the database lives under .beads/embeddeddolt/ and .beads/dolt/ is no longer created during init (GH#2903). This caused all commands to fail with 'no beads database found' because the discovery function couldn't find the DB. Fix: check for .beads/embeddeddolt/ in addition to .beads/dolt/ in both findDatabaseInBeadsDir() and hasBeadsProjectFiles(). The embedded path is checked first since it's the default mode. Fixes all 20 Embedded Dolt Cmd CI shards that were failing on main. Amp-Thread-ID: https://ampcode.com/threads/T-019d3efe-8243-72ab-b800-7e5fa900af83 Co-authored-by: Amp <amp@ampcode.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
All 20 "Embedded Dolt Cmd" CI test shards fail on main with:
This was introduced by #2906 (GH#2903 fix) which correctly stopped creating the empty
.beads/dolt/directory in embedded mode. However,findDatabaseInBeadsDir()ininternal/beads/beads.gostill only checked for.beads/dolt/— it didn't know about.beads/embeddeddolt/where the embedded engine actually stores data.Root Cause
findDatabaseInBeadsDir()callscfg.DatabasePath(beadsDir)which returns.beads/dolt, then checks if that directory exists. Since embedded mode (now the default) stores data in.beads/embeddeddolt/<prefix>/and no longer creates the.beads/dolt/marker directory, the check fails and every command exits with "no beads database found".Fix
.beads/embeddeddolt/before.beads/dolt/infindDatabaseInBeadsDir()(embedded is now the default mode)hasBeadsProjectFiles()to recognizeembeddeddolt/as a valid project directoryTesting
TestEmbeddedConfig,TestEmbeddedKV,TestEmbeddedReadyTestEmbeddedInit(22 subtests) all pass