Commit graph

4 commits

Author SHA1 Message Date
seanmartinsmith
f990135081
fix(export): add _type discriminator to JSONL issue lines (#3272)
* fix(export): add _type discriminator to JSONL issue lines (GH#3271)

bd export produces JSONL with mixed schemas: issue lines and memory lines.
Memory lines carry "_type":"memory" but issue lines had no _type field,
causing downstream consumers to crash when they encounter an unexpected
schema (e.g. json.loads(line)["status"] throws KeyError on memory lines).

Add "_type":"issue" to all exported issue records via an exportIssueRecord
wrapper struct. This makes every JSONL line self-describing without changing
the Issue or IssueWithCounts types used elsewhere.

Both export paths updated: manual (runExport) and auto (exportToFile).
Import already handles this gracefully - unknown fields are ignored during
json.Unmarshal into types.Issue.

* test(export): add _type discriminator assertion to embedded export tests

Verifies that every JSONL line from bd export carries a _type field
("issue" or "memory") and that each type has its expected key fields.
Addresses codecov 0% patch coverage flag on PR #3272.
2026-04-20 17:40:34 -07:00
matt wilkie
59b49c45f0 fix: add missing //go:build cgo tags to embedded test files and cmd
Several test files and one main.go that depend on CGO-only types
(EmbeddedDoltStore methods like Close, CreateIssue, GetIssue) were
missing //go:build cgo build tags, causing compilation failures when
building with CGO_ENABLED=0.

Files fixed:
- 67 cmd/bd/*_embedded_test.go files
- cmd/bd/metadata_filter_test.go (uses newTestStore from cgo-tagged helper)
- cmd/bd/doctor/federation_test.go (uses doctorTestServerPort/testSharedDB)
- cmd/bd/doctor/fix/migrate_import_test.go (uses fixTestServerPort)
- 6 internal/storage/embeddeddolt/*_test.go files
- internal/storage/embeddeddolt/cmd/main.go

Amp-Thread-ID: https://ampcode.com/threads/T-019d4938-40d4-73ae-89d1-1891a19a9a15
Co-authored-by: Amp <amp@ampcode.com>
2026-04-01 07:08:41 -07:00
coffeegoddd☕️✨
a35edfd28e /{internal,cmd,.goreleaser,.github}: embedded mode by default 2026-03-28 13:47:20 -07:00
coffeegoddd☕️✨
a2f5639b14 /{.github,cmd,internal}: sync and data integration tests 2026-03-24 16:49:44 -07:00