Move type validation from CLI-level (update.go) to storage layer
(UpdateIssueInTx), matching the create path. The CLI-level validation
failed when GetCustomTypes() was unavailable (subprocess context,
circuit breaker) and config.yaml lacked types.custom (because bd config
set only writes to Dolt). The storage layer reads custom types within
the same transaction, so it always works.
Co-authored-by: mayor <rastislav.marko@panzarobotics.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(update): set status=deferred when --defer is provided (GH#3233)
`bd update --defer <date>` only set defer_until, leaving status=open,
so the ❄ icon (driven by status) was missing in `bd list`. `bd defer`
already sets both fields; align `bd update --defer` with that behavior.
Explicit --status wins if provided in the same invocation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(update): handle past-date and clear cases for --defer (GH#3233)
Address review feedback on the previous commit:
- Past-date --defer no longer flips status to deferred. The warning at
this path promises the issue "will appear in bd ready immediately",
which requires status to stay open.
- --defer="" now restores status=open (only when the issue was actually
deferred), so the help text "show in bd ready immediately" holds.
Non-deferred statuses like in_progress are preserved.
Explicit --status continues to win in both directions.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: resolve remaining 11 CI test failures (#2982)
Two categories of fixes:
1. Flock contention in test setup helpers: bdCreate, bdCreateSilent,
bdUpdate, bdDelete, bdClose, and bdDepAdd now retry up to 5 times
with exponential backoff when they encounter "one writer at a time"
flock errors. This handles transient contention when parallel tests
within the same CI shard compete for the embedded Dolt lock during
their setup phase.
2. macOS path symlink mismatch: TestContext* tests in
explicit_db_nodb_test.go now use filepath.EvalSymlinks() when
comparing beads_dir paths, fixing failures where macOS resolves
/var/folders to /private/var/folders.
Fixes#2982
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: increase flock retry budget and add retry to read helpers
The initial 5-retry/100ms-base backoff was insufficient for CI
contention. Refactored to a shared bdRunWithFlockRetry helper with
10 retries and 500ms base backoff (~30s total budget).
Also added flock retry to bdDiff, bdDiffJSON, bdShowRaw, and
bdShowDetails which were also failing on CI due to flock contention
during parallel test execution.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: close store before subprocess to release flock
The root cause of the persistent flock failures was openStore()
deferring Close() to t.Cleanup, keeping the exclusive flock held
while bd subprocess commands tried to acquire it. No amount of
retry can help when the same test holds the lock.
- getCommitHash: open/close store inline instead of via openStore
- show_json_includes_comments: close store after AddIssueComment
- show_as_of: close store after GetCurrentCommit
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: resolve CI failures from flock, version bump, and lint
Three categories of CI failure on main after the v1.0.0 release:
1. rules.go lint/format: Fix gofmt alignment, errcheck on tw.Flush(),
gosec G304 (add nosec comment), gosec G306 (use 0o600 perms).
2. doctor_test.go version tracking: The 'slightly outdated version'
test used 0.55.0 which now has a major version diff from 1.0.0,
correctly triggering a warning. Update expected status to match.
3. Embedded Dolt concurrent tests: The exclusive flock from #2571
causes concurrent bd processes to fail with 'one writer at a time'.
Update 58 concurrent test files to tolerate this expected error
while still failing on unexpected errors and panics.
Amp-Thread-ID: https://ampcode.com/threads/T-019d5386-b41e-7138-bc81-6ea331b80760
Co-authored-by: Amp <amp@ampcode.com>
* fix: concurrent test post-conditions tolerate flock contention
With exclusive flock (commit 543e1943), only some workers can acquire
the lock in concurrent tests. Update post-conditions in 5 tests to:
- Only verify side effects from workers that succeeded (r.err == nil)
- Require at least 1 worker succeeds (fail if all hit flock)
- Log success/failure counts for visibility
- Still verify correct behavior for successful operations
Tests fixed:
- TestEmbeddedCloseConcurrent: remove Fatalf on failures, skip total count check
- TestEmbeddedDeferConcurrent: only check deferred status for successful workers
- TestEmbeddedUndeferConcurrent: only check open status for successful workers
- TestEmbeddedReopenConcurrent: only check open status for successful workers
- TestEmbeddedPromoteCLIConcurrent: only check permanent for successful workers
Amp-Thread-ID: https://ampcode.com/threads/T-019d5386-b41e-7138-bc81-6ea331b80760
Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019d5386-b41e-7138-bc81-6ea331b80760
Co-authored-by: Amp <amp@ampcode.com>
---------
Co-authored-by: Amp <amp@ampcode.com>