Commit graph

19 commits

Author SHA1 Message Date
Jozef Izso
42064c46fe
Sync Linear milestones as local epics (#3528) 2026-05-05 07:45:30 -07:00
matt wilkie
3e56f0b214
Document Linear external_ref pre-linking (#3517)
* Document Linear external ref prelinking (bd-ly3)
* Fix Linear sync dependency graph handling
* Fix init remote clone routing
* Fix stale gate help text
* Fix init remote cherry-pick integration
* Fix init remote flag handling
* Fix Linear prelink hydration blockers
* Fix Linear relation dependency gating
* Fix ready list parent filtering
* Deduplicate dry-run dependency previews by stored identity
2026-04-27 06:05:30 -07:00
matt wilkie
2f60a10fc5
Import Linear relations as dependencies (#3519)
* Fix gate and cook regressions (bd-r2l)

* Import Linear relations as dependencies (bd-ly3)
2026-04-26 20:30:02 -07:00
Steven Syrek
f0057c7828
ci: install dolt binary on Linux and macOS test runners (#3440)
* ci: install dolt binary on Linux and macOS test runners

Install dolt via the official install.sh on Linux and via Homebrew on
macOS so the main test job can exercise the ~24 test gates that
previously silently skipped on every PR when dolt was absent from PATH.

Matches the installation pattern already used by nightly.yml.
Docker-testcontainer gates (testDoltServerPort == 0 skips) remain
skipped — a known GitHub Actions hang documented in
scripts/repro-dolt-hang/INCIDENT-REPORT.md and nightly.yml:37-41
prevents enabling testcontainers here.

* test: require dolt binary under GITHUB_ACTIONS

Add testutil.RequireDoltBinary: skips when the dolt CLI is absent
locally but fails the test under GITHUB_ACTIONS. Replace bare
exec.LookPath("dolt") skip-gates with the helper so ~24 tests that
previously fell through silently in CI now run — and hard-fail if
the CI workflow ever drops the dolt install step.

tests/regression/regression_test.go uses an inline variant because
its gate lives in TestMain, and internal/remotecache/cache_test.go
duplicates the helper inline to avoid an import cycle
(testutil -> doltutil -> remotecache).
2026-04-24 06:58:40 -07:00
matt wilkie
c446a2ef09
fix(linear): harden push against data clobbering (#3328)
Closes #3289, #3309, #3252, #3253 — hardens Linear push: requires explicit linear.state_map.* config, rejects ambiguous state resolution, narrows push dedup to pushable fields, blocks unscoped project-filtered push from creating unlinked beads, and adds regression test for the orphan-ownership rule (parent-filtered push must not update external issues Beads hasn't claimed via external_ref).
2026-04-18 08:36:13 -07:00
Harry
11d366cf5d tests: add coverage for explain logic, cycle detection, and engine warnings
Extract BuildReadyExplanation into types package as a pure function,
enabling unit tests without Dolt dependency. Add 8 test cases covering:
empty input, ready with/without deps, resolved blockers, parent links,
blocked issues with missing blockers, cycles, and full scenario.

Add 7 Dolt integration tests for cycle detection:
- conditional-blocks cycles (prevented by AddDependency)
- mixed blocks + conditional-blocks cycles
- waits-for intentionally excluded from cycle detection
- self-dependency rejected for all dependency types
- ready work respects conditional-blocks
- blocked issues include blocker details

Add 4 engine tests:
- createDependencies with valid deps
- createDependencies with unresolvable external refs (warns)
- createDependencies with empty input
- warn() collects messages and triggers OnWarning callback

Types package coverage: 89.6% → 91.0%

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-30 09:15:52 -07:00
Harry
2efa094bc5 Add integration test coverage for partial failures, warnings, and self-deps
- Enhance mockTracker with createFailAfter/createCount for partial
  failure simulation (previously only supported all-or-nothing errors)
- TestEnginePushPartialFailure: 3 issues, fail after 2 creates,
  asserts Created=2, Errors=1, warnings collected
- TestEngineSyncCollectsWarnings: verifies result.Warnings is populated
  from push failures (tests the bd-5cx warning collection fix)
- TestAddDependency_SelfDependencyRejected: verifies self-dependency
  check returns error (tests the bd-2qr self-dep guard)

Fixes: bd-3jd

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-30 09:15:24 -07:00
emma
083181e1ea feat: reimplement Notion sync on REST data sources (fix-merge PR #2759)
Adds internal/notion/ package with direct REST API client, field mapping,
and tracker adapter. Adds bd notion init/connect/status/sync commands.
Enhances tracker engine: conflict detection before pull, label sync,
no-op skip, batch push interface, RFC3339Nano timestamps. Removed dead
matchesFetchOptions function, added gosec nolint for Notion API client.

Co-Authored-By: Osamu Okano <okano.osamu@gmail.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-27 19:20:40 -07:00
gregorycollins-usmobile
5297286bb2
feat(linear): add --parent flag to limit sync push to a ticket tree (PR #2853)
* feat(linear): add --parent flag to limit sync push to a ticket tree

Adds --parent=TICKET to bd linear sync --push, restricting the push
to the named beads ticket and all its transitive descendants via
parent-child dependencies.

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

* test(tracker): add tests for ParentID push filter

Six cases: basic parent+children, deep transitive descendants,
leaf with no children, non-parent-child edges not followed,
empty ParentID pushes all, dry-run with parent filter.

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

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 19:30:42 -07:00
lizzy
9dc875a98e feat: add --list and --doc flags to bd help for CLI doc generation (GH#2527)
Cherry-pick Go code from community PR #2527 (maphew): adds --list flag to
enumerate all commands, --doc flag to generate per-command Docusaurus markdown,
and sidebar position mapping. Also includes lazy getGitContext() in hooks dir
resolution and test skip improvements for missing Dolt server.

Co-authored-by: matt wilkie <maphew@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 18:25:40 -07:00
beads/crew/emma
11f5f432ed feat(testutil): branch-per-test isolation for dolt, tracker, molecules (L2)
Replace database-per-test with Dolt branch-per-test using COW snapshots
for three internal packages. Each TestMain creates one shared database
with committed schema; each test branches from main via DOLT_CHECKOUT
with MaxOpenConns=1 for session-level isolation.

New infrastructure:
- testutil.StartTestBranch / CleanTestBranches / SetupSharedTestDB
- dolt.Config.MaxOpenConns field wired into openServerConnection
- dolt.CreateIgnoredTables for wisps tables (not in commits)

cmd/bd and doctor packages stay on database-per-test because they
reopen stores from metadata.json via NewFromConfig, which creates new
connections on main branch.

Closes: bd--6tf4

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-24 16:16:56 -08:00
beads/crew/collins
6219b8692d fix: CI formatting, lint, and test failures blocking release
1. FORMATTING: gofmt 14 files.

2. LINT:
   - Delete dead code cmd/bd/bootstrap.go (unused bootstrapEmbeddedDolt)
   - Prefix unused 'actor' param in wisps.go updateWisp with _
   - Prefix unused 'ctx' param in telemetry.go buildTraceProvider with _

3. TESTS: Add skipIfNoDolt to test helpers that call dolt.New() without
   a running test server. In CI (no dolt installed), these tests now skip
   instead of failing with "server unreachable at 127.0.0.1:3307".
   Delete TestOpenFromConfig_Embedded and TestOpenFromConfig_DefaultsToEmbedded
   which tested removed embedded Dolt functionality.

   Fixed packages: beads_test, cmd/bd, cmd/bd/doctor, cmd/bd/doctor/fix,
   internal/tracker, internal/utils

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 18:53:35 -08:00
Steven Syrek
634bf5d4a0 refactor(storage): define Storage interface, decouple from concrete DoltStore (bd-l3o)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 10:11:08 +01:00
beads/crew/emma
dd01a655b9 fix: repair test suite for Dolt-only backend (bd-h0zvj.4)
Fix pre-existing test failures from Dolt-Native Pruning phases 1-8.
All internal/* packages and cmd/bd/doctor now pass. Remaining 19
failures in cmd/bd are routing (9), init path checks (7), and tips (3).

Key fixes:
- Remove type assertions on concrete *dolt.DoltStore (not an interface)
- Fix DATETIME timezone bug: normalize timestamps to UTC before storage
- Replace SQLite datetime() syntax with MySQL DATE_SUB() in stale tests
- Remove --backend flag from init test invocations (flag removed)
- Update doctor tests for Dolt-only backend behavior
- Skip/remove tests for removed features (CompactableStorage,
  FederatedStorage, ExportToMultiRepo, merge driver, no-db mode)
- Add issue_prefix config in test stores that create issues
- Fix export_hashes → interactions table reference in schema test

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-15 18:17:16 -08:00
beads/crew/emma
a5da57e39b refactor: remove storage factory, memory backend, and provider abstraction (Phase 7)
Strip out the multi-backend storage layer: factory pattern, memory/in-memory
provider, connection string parsing, local provider, and associated tests.
Inline Dolt as the sole storage backend. Part of Dolt-Native Beads v2 epic.

WIP - SQLite removal in progress, more cleanup phases to follow.

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-15 11:27:39 -08:00
beads/crew/emma
7de76f36ac fix: wire FormatDescription hook in doPush, add GenerateID/FormatDescription tests
Self-review found two issues:
1. FormatDescription was declared in PushHooks but never called in doPush.
   Now applied to a shallow copy before CreateIssue/UpdateIssue to avoid
   mutating local data.
2. GenerateID hook had no test coverage. Added tests for both success and
   error (collision) cases, plus FormatDescription test that verifies
   local issue is not mutated.

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-14 17:00:44 -08:00
beads/crew/emma
3728ac1f08 feat: add PullHooks/PushHooks to SyncEngine for battle-tested CLI behaviors
Phase 3 of tracker refactor (dolt-y60t.3). Adds optional hook callbacks
to the Engine so tracker adapters can opt into proven CLI patterns:

PullHooks: ShouldImport (filter before conversion), TransformIssue
(description formatting/normalization), GenerateID (hash-based IDs).

PushHooks: ShouldPush (custom filtering), ContentEqual (content-hash
dedup to skip unnecessary API calls), FormatDescription (tracker-specific
rendering), BuildStateCache/ResolveState (batch workflow state resolution).

Also adds ExcludeEphemeral to SyncOptions for wisp filtering on push.

Dropped from original plan: tombstone filtering (Dolt handles natively),
UseImporter delegation (importer package tied to dying JSONL/SQLite infra).

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-14 16:47:07 -08:00
mayor
8319a85141 fix: gofmt tracker adapter files
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 14:26:19 -08:00
beads/crew/emma
9d29ffd236 feat: add plugin-based issue tracker framework (GH#1150)
Implements shared interfaces and sync engine for external tracker
integrations (Linear, GitLab, Jira, etc.), eliminating duplication
between adapters. Design from PRs #1564-#1567, updated for Dolt-only.

- IssueTracker: 14-method plugin interface for tracker adapters
- FieldMapper: bidirectional field conversion between beads and trackers
- Engine: Pull→Detect→Resolve→Push sync with conflict resolution
- Registry: thread-safe plugin registration via init() functions

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-14 14:09:40 -08:00