bd-6xd: Standardize on issues.jsonl as canonical filename
- Change default JSONL filename from beads.jsonl to issues.jsonl - Add bd doctor check and fix to auto-migrate legacy beads.jsonl configs - Update FindJSONLPath to prefer issues.jsonl over beads.jsonl - Add CheckLegacyJSONLConfig and CheckLegacyJSONLFilename checks - Add LegacyJSONLConfig fix to rename files and update config - Update .gitattributes to reference issues.jsonl - Fix tests to expect new canonical filename - Add bd-6xd to v0.25.1 release notes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -259,7 +259,7 @@ func FindBeadsDir() string {
|
||||
|
||||
// FindJSONLPath returns the expected JSONL file path for the given database path.
|
||||
// It searches for existing *.jsonl files in the database directory and returns
|
||||
// the first one found, preferring beads.jsonl over issues.jsonl (bd-afd).
|
||||
// the first one found, preferring issues.jsonl over beads.jsonl (bd-6xd).
|
||||
//
|
||||
// This function does not create directories or files - it only discovers paths.
|
||||
// Use this when you need to know where bd stores its JSONL export.
|
||||
@@ -275,18 +275,18 @@ func FindJSONLPath(dbPath string) string {
|
||||
pattern := filepath.Join(dbDir, "*.jsonl")
|
||||
matches, err := filepath.Glob(pattern)
|
||||
if err == nil && len(matches) > 0 {
|
||||
// bd-afd: Prefer beads.jsonl over issues.jsonl (canonical name)
|
||||
// bd-6xd: Prefer issues.jsonl over beads.jsonl (canonical name)
|
||||
for _, match := range matches {
|
||||
if filepath.Base(match) == "beads.jsonl" {
|
||||
if filepath.Base(match) == "issues.jsonl" {
|
||||
return match
|
||||
}
|
||||
}
|
||||
// Return the first .jsonl file found if beads.jsonl not present
|
||||
// Return the first .jsonl file found if issues.jsonl not present
|
||||
return matches[0]
|
||||
}
|
||||
|
||||
// bd-afd: Default to beads.jsonl (was issues.jsonl)
|
||||
return filepath.Join(dbDir, "beads.jsonl")
|
||||
// bd-6xd: Default to issues.jsonl (canonical name)
|
||||
return filepath.Join(dbDir, "issues.jsonl")
|
||||
}
|
||||
|
||||
// DatabaseInfo contains information about a discovered beads database
|
||||
|
||||
@@ -168,9 +168,9 @@ func TestFindJSONLPathDefault(t *testing.T) {
|
||||
// Create a fake database path (no .jsonl files exist)
|
||||
dbPath := filepath.Join(tmpDir, "test.db")
|
||||
|
||||
// Should return default beads.jsonl
|
||||
// bd-6xd: Should return default issues.jsonl (canonical name)
|
||||
result := FindJSONLPath(dbPath)
|
||||
expected := filepath.Join(tmpDir, "beads.jsonl")
|
||||
expected := filepath.Join(tmpDir, "issues.jsonl")
|
||||
if result != expected {
|
||||
t.Errorf("Expected '%s', got '%s'", expected, result)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user