fix(go): make released modules self-contained - #28
Conversation
Signed-off-by: Spencer Cai <jiahao.cai@dynamia.ai>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bb49f11136
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| cd "$tmp/modules/go-cobra" | ||
| GOWORK=off go test ./... |
There was a problem hiding this comment.
Test Cobra without requiring the unreleased core tag
When preparing any new version, prepare-release.mjs updates go-cobra/go.mod to require that same, not-yet-published core version and then runs make check; this standalone go test therefore attempts to download the new core module before .github/workflows/release.yml creates its go/vX.Y.Z tag, blocking release preparation. Use the copied core module for this pre-release test, or defer the standalone resolution check until after the core tag is published.
Useful? React with 👍 / 👎.
| [ | ||
| "source", | ||
| "go-test-fixtures", | ||
| "node", | ||
| ["scripts/sync-go-testdata.mjs", "--check"], |
There was a problem hiding this comment.
Record the new parity owner in the architecture map
Adding sync-go-testdata.mjs to the parity gate introduces a new generated Go-fixture synchronization owner, but docs/architecture.mmd still lists only check.mjs · sync-hosts.mjs and does not show the generated Go testdata artifact. Update the canonical map alongside this enforcement change so it continues to document the actual source-to-artifact boundary.
AGENTS.md reference: AGENTS.md:L140-L148
Useful? React with 👍 / 👎.
Summary
go-cobramodule's repository-local replacementProblem
The released Go modules were not fully representative of standalone consumers:
go-cobracarried a local../goreplacement, and tests reached outside their module directories. That could let repository-local state hide an incomplete release.The source-tree Cobra check now copies both modules to a temporary directory and adds a one-off replacement only to that temporary copy. No
go.workfile or workspace dependency is committed.Validation
node scripts/check.mjsgo list,go test, and build a minimal Cobra program withGOWORK=offStack
This is PR 1 of 3 and is based on
main. It is followed by #29 and #30.