You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Test: add Go module workspace (go.work) fixture for vg build #243
Multi-module Go repos use go.work. A pinned offline fixture keeps vg build edges deterministic for workspace layouts (CONTRIBUTING: same input → same graph.json). Complements Cargo (#232) and Yarn Berry (#237) fixtures without overlapping them.
What to do
Add a minimal go.work + two-module fixture (checked-in; tests offline).
Assert stable graph edges across workspace modules.
Keep the fixture small enough for CI.
Acceptance
Fixture checked in; tests run offline
Failure if workspace edges regress or order drifts
Two things in the current code change what this fixture can assert:
Nothing reads go.work.vg build walks every go.mod it finds (ingestGoMod in src/engine/manifests.ts), so a two-module layout already gives two package nodes with or without go.work.
A require of the sibling module becomes an external node. For example, example.com/b v0.0.0 in a/go.mod, with replace example.com/b => ../b or use ./b in go.work, produces an import edge from module a to an external node named example.com/b. It does not point at module b's own package node. replace lines are skipped.
So the useful fixture pins today's behaviour:
layout test/fixtures/go-work/{go.work, a/go.mod, a/main.go, b/go.mod, b/b.go}. No go.sum and no network. test/fixtures/go-unpinned-require/ is an existing Go fixture to copy the pattern from.
assert the two package nodes, the a → example.com/b edge, and each module's third-party requires, all sorted, with graph.json identical across two builds
assert that deleting go.work leaves graph.json unchanged. That is the regression worth guarding.
Linking a workspace require to the in-repo package node instead of an external would be a behaviour change and is out of scope here. If you think it should happen, open a separate issue and use this fixture as the repro.
Activity
vibgrate-team commentedon Oct 5, 2026
Two things in the current code change what this fixture can assert:
go.work.vg buildwalks everygo.modit finds (ingestGoModinsrc/engine/manifests.ts), so a two-module layout already gives twopackagenodes with or withoutgo.work.externalnode. For example,example.com/b v0.0.0ina/go.mod, withreplace example.com/b => ../boruse ./bingo.work, produces animportedge from module a to anexternalnode namedexample.com/b. It does not point at module b's ownpackagenode.replacelines are skipped.So the useful fixture pins today's behaviour:
test/fixtures/go-work/{go.work, a/go.mod, a/main.go, b/go.mod, b/b.go}. Nogo.sumand no network.test/fixtures/go-unpinned-require/is an existing Go fixture to copy the pattern from.example.com/bedge, and each module's third-party requires, all sorted, withgraph.jsonidentical across two buildsgo.workleavesgraph.jsonunchanged. That is the regression worth guarding.Linking a workspace require to the in-repo package node instead of an external would be a behaviour change and is out of scope here. If you think it should happen, open a separate issue and use this fixture as the repro.
vibgrate-team commentedon Oct 29, 2026
Folding this into #512, which covers this lockfile with the exact functions, fixtures and acceptance tests. Please pick it up there!