feat(go): tag-based release workflow, making the Go SDK an installable versioned package - #4
Merged
Merged
Conversation
The Go module has never been tagged: consumers (channel-go included) can only pin it by pseudo-version, a 40-char commit hash dressed up as a version. Go has no registry to publish to — a release is a git tag, and proxy.golang.org picks it up on first request. Since this module lives in go/ (a subdirectory of a multi-module repo), the tag must be prefixed go/ (go.dev/ref/mod#vcs-version); the module path carries no /v2 suffix, so only v0.x.x/v1.x.x can ever resolve here (Semantic Import Versioning). Documented in go/README.md#versioning, enforced by the release workflow. go-release.yml: workflow_dispatch, runs go vet + go test -race before tagging, refuses to re-tag an existing version, tags go/vX.Y.Z, and cuts a GitHub Release with notes scoped since the previous go/ tag. go-ci.yml: go vet + go test -race on every push/PR touching go/**. There was previously no CI running the Go test suite at all outside of a release — regressions in go/ could land on main unnoticed until someone ran the tests by hand.
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.
Right now the Go module has never been tagged.
channel-go(and anyone else) can only pin it viago get .../go@main, which resolves to a pseudo-version — a 40-char commit hash dressed up asv0.0.0-20260729191540-5d924496dffb. That's what prompted this: it should be a normalgo get .../go@v1.2.3package.Why
go/vX.Y.Zand notvX.Y.ZThis is a multi-module repo (
go/,js/,php/,java/). Go's own spec for a module living in a subdirectory requires the tag to be prefixed with that subdirectory (go.dev/ref/mod#vcs-version) — plainvX.Y.Ztags (which this repo already has, e.g.v2.7.2) are not visible to the Go module resolver forgo/at all. Verified locally with a throwaway module + a filesystem Go proxy: ago/v1.0.0tag resolves viago get module@v1.0.0, a barev1.0.0tag on the same commit does not.Also worth knowing before picking a first version: those existing root
vX.Y.Ztags don't track anything reliably — I diffed each one against whatjs/package.jsonsaid at that commit and they don't match (e.g. tagv2.7.2→ package.json2.4.0, non-monotonically). So there's no existing "shared version line" to continue; Go starting its own independent count is not a regression, it's the status quo made explicit for a fourth package.Why only v0/v1
The module path is
github.com/smartpricing/traceflow-sdk/go— no/v2suffix. Per Semantic Import Versioning, Go refuses to resolve any v2+ tag against a path that doesn't end in/v2. Reproduced this too: tagginggo/v2.0.0and requesting it givesinvalid version: should be v0 or v1, not v2. So this is enforced both in the workflow (rejects a version input with major ≥ 2) and documented ingo/README.md#versioning, so nobody tags a v2 by hand and ships something no consumer cango get.What's in this PR
go-release.yml—workflow_dispatch, inputversion(e.g.1.0.0). Runsgo vet+go test -racefirst, refuses to re-tag an existing version, tagsgo/vX.Y.Z, cuts a GitHub Release with notes scoped since the previousgo/tag (first release has none to scope against, handled). There's no build/publish step beyond the tag — that's how Go modules work,proxy.golang.orgfetches directly from the tag on first request.go-ci.yml—go vet+go test -raceon every push/PR touchinggo/**. There was no CI at all running the Go suite outside of this new release gate — a regression ingo/could land onmainunnoticed until someone happened to run the tests locally (which is exactly how the recentsanitize()/omitemptybug went unnoticed for as long as it did).go/README.md— new Versioning section covering the above so it's not just in a PR description.Rollout, once merged
Dispatch the workflow with
version: 1.0.0for the currentmain(5d92449, which already has theomitemptyfix). That gives every consumer, starting withchannel-go, a real tag to pin instead of a commit hash. Not doing that dispatch as part of this PR on purpose — cutting the first tag is a one-way door for anyone who fetches it, so leaving that as an explicit separate action.