* feat(gate): add 'bd gate create' for ad-hoc blocking gates
Add a 'create' subcommand to 'bd gate' that creates ad-hoc gate issues
which block other issues from appearing in 'bd ready'.
Previously, blocking gates could only be created through the formula/
molecule system (via [steps.gate] in .formula.toml files). This left no
CLI path to create a blocking gate on an arbitrary issue outside the
formula system.
The new command supports all gate types (human, timer, gh:run, gh:pr)
and creates a DepBlocks dependency between the gate and the target issue.
Usage:
bd gate create --blocks <issue-id> [--type=human] [--reason=...] [--timeout=2h]
The gate is resolved with the existing 'bd gate resolve' command.
* test(gate): add comprehensive tests for 'bd gate create'
Add TestEmbeddedGateCreate with 9 subtests covering:
- Default human gate creation with text and JSON output
- Timer gate with timeout and reason
- gh:pr gate with await-id
- Gate blocks issue from bd ready
- Resolving gate unblocks issue in bd ready
- Missing --blocks flag error
- Nonexistent target issue error
- Gate appears in bd gate list
All tests use the embedded Dolt test pattern with isolated databases.
* 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>