Skip to content

feat: add JSONL bulk dep add#3530

Merged
maphew merged 3 commits into
gastownhall:mainfrom
maphew:codex/bd-wjl-jsonl-dep-add
Apr 27, 2026
Merged

feat: add JSONL bulk dep add#3530
maphew merged 3 commits into
gastownhall:mainfrom
maphew:codex/bd-wjl-jsonl-dep-add

Conversation

@maphew

@maphew maphew commented Apr 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes #3408.

Adds a machine-friendly bulk form for bd dep add:

  • bd dep add --file <path> reads newline-delimited JSON dependency edges from a file
  • bd dep add --file - reads the same JSONL format from stdin
  • each edge is { "from": "bd-2", "to": "bd-1", "type": "blocks" }, with type defaulting to --type
  • issue_id / depends_on_id aliases are accepted for machine-generated records
  • file parse errors and resolution/validation errors are reported together before mutation
  • mutation runs through one transaction for one coherent Dolt commit

The transaction dependency path now exposes DependencyAddOptions so bulk --no-cycle-check skips the per-edge recursive cycle check as well as the post-add warning. Normal transaction adds still use the shared issueops.AddDependencyInTx validation path.

Coordination

Preflight found and reviewed overlapping PRs before updating this PR:

I updated this existing PR instead of opening a duplicate PR.

Tests

  • BEADS_TEST_EMBEDDED_DOLT=1 go test -tags gms_pure_go ./cmd/bd -run '^TestEmbeddedDepBulkNoCycleCheckSkipsPerEdgeCycleValidation$|^TestEmbeddedDep$|^TestEmbeddedDepNoCycleCheck$' -count=1
  • go test -tags gms_pure_go ./cmd/bd -run '^TestDepAddFlagAliases$|^TestDepBlocksFlag$|^TestDepCommandFlags$' -count=1
  • go test -tags gms_pure_go ./internal/storage/issueops ./internal/storage/dolt ./internal/storage/embeddeddolt
  • make test with TMPDIR=/var/tmp/beads-test-bd-wjl-review GOTMPDIR=/var/tmp/beads-test-bd-wjl-review

@codecov-commenter

codecov-commenter commented Apr 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 1.46341% with 202 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
cmd/bd/dep.go 1.70% 173 Missing ⚠️
internal/storage/dolt/transaction.go 0.00% 19 Missing ⚠️
internal/storage/embeddeddolt/transaction.go 0.00% 6 Missing ⚠️
internal/storage/hook_decorator.go 0.00% 3 Missing ⚠️
internal/storage/issueops/dependencies.go 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

rjc123 and others added 2 commits April 26, 2026 18:16
On large dependency graphs (230+ edges), bd dep add performs a full
DetectCycles traversal after every insertion — O(V+E) per call. This
causes individual dep add calls to hang for 3+ minutes as the graph
grows beyond ~150 edges.

Add --no-cycle-check to both `dep add` and the `dep --blocks`
shorthand. When set, the post-insert warnIfCyclesExist call is skipped.
Callers doing bulk wiring can run `bd dep cycles` once at the end to
verify the complete graph.

The flag is intentionally not the default: single-edge interactive use
keeps cycle detection on. Bulk callers opt in explicitly.
@maphew maphew force-pushed the codex/bd-wjl-jsonl-dep-add branch from 94368de to 51aad4e Compare April 27, 2026 03:19
@maphew maphew marked this pull request as draft April 27, 2026 03:19
@maphew maphew marked this pull request as ready for review April 27, 2026 11:51
@maphew maphew merged commit 0bc4c72 into gastownhall:main Apr 27, 2026
39 checks passed
@maphew maphew deleted the codex/bd-wjl-jsonl-dep-add branch April 27, 2026 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature: bulk/batch form for bd dep add (N edges in one call)

3 participants