fix(release): bump examples/go and track go.work.sum on release - #43
Merged
Merged
Conversation
The v0.1.4 release left examples/go/go.mod on v0.1.3 while go-cobra/go.mod moved to v0.1.4. The workspace then had to resolve two versions of the same dependency, so every go command rewrote go.work.sum to the higher one and the file was permanently dirty. prepare-release.mjs only knew about go-cobra/go.mod, so the drift would reappear on the next release. It now bumps both modules through the same replaceOne, and carries go.work.sum in changedFiles: make check runs before git add and rewrites that file, so leaving it out reopened the same gap. Deleting go.work.sum and letting the toolchain regenerate it reproduces the committed line exactly, and a full check.mjs run no longer leaves it dirty. Signed-off-by: samzong <samzong.lu@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
go.work.sumwas permanently dirty: everygocommand rewrote it, so any local build left an unrelated modification in the worktree.Root cause is a version skew introduced by the v0.1.4 release.
go-cobra/go.modmoved tov0.1.4butexamples/go/go.modstayed onv0.1.3, and both modules are in the workspace:github.com/lathe-cli/kitup/gogo-cobra/go.modv0.1.4examples/go/go.modv0.1.3(before this PR)Minimal version selection picks the higher of the two, so
gokept rewriting the trackedv0.1.3line tov0.1.4.scripts/prepare-release.mjsonly knew aboutgo-cobra/go.mod, so the skew would reappear on the next release. Both modules now go through the samereplaceOne.go.work.sumis also added tochangedFiles. The script runsmake checkbeforegit add, and that run rewrites the file, so leaving it out of the commit list would have reopened the same gap one release later.Verification beyond
make check:go.work.sumand letting the toolchain regenerate it reproduces the committed line byte for byte, so the committed content is the tool's steady state rather than a hand-written guess.check.mjsrun no longer leaves the file dirty.prepare-release.mjs patch --dry-runexits 0, which also proves the version regex matches exactly once in bothgo.modfiles —replaceOnefails when the match count is not 1../golocally. A release run therefore does not need its own version published first.Scope Check
spec/hosts.jsonchanges. (spec/hosts.jsonuntouched.)Verification
make check