-
Notifications
You must be signed in to change notification settings - Fork 35
Description
Summary
The Go SDK works via go get github.com/github/copilot-sdk/go@latest, but users cannot pin to specific versions like v0.1.12. This is because Go submodules require path-prefixed tags (go/v0.1.12) rather than root-level tags (v0.1.12).
Current Behavior
# Works - but uses pseudo-version
$ go get github.com/github/copilot-sdk/go@latest
go: added github.com/github/copilot-sdk/go v0.0.0-20260115160841-b8a836b2c6a3
# Fails - can't pin to release version
$ go get github.com/github/copilot-sdk/go@v0.1.12
go: module github.com/github/copilot-sdk@v0.1.12 found, but does not contain package github.com/github/copilot-sdk/go
# No versions visible
$ go list -m -versions github.com/github/copilot-sdk/go
github.com/github/copilot-sdk/go # (empty - no versions)Expected Behavior
$ go get github.com/github/copilot-sdk/go@v0.1.12
go: added github.com/github/copilot-sdk/go v0.1.12
$ go list -m -versions github.com/github/copilot-sdk/go
github.com/github/copilot-sdk/go v0.1.10 v0.1.11 v0.1.12Root Cause
If a module is defined in a subdirectory within the repository, that is, the module subdirectory portion of the module path is not empty, then each tag name must be prefixed with the module subdirectory, followed by a slash.
The Go SDK module is at github.com/github/copilot-sdk/go (subdirectory), so tags must be go/v0.1.12 format.
Currently, publish.yml creates root-level tags:
gh release create "v${{ needs.version.outputs.version }}" \Suggested Fix
Add Go submodule tagging to the release workflow:
# In .github/workflows/publish.yml, add after github-release job or within it
- name: Tag Go SDK submodule
run: |
git tag "go/v${{ needs.version.outputs.version }}"
git push origin "go/v${{ needs.version.outputs.version }}"Or create a dedicated job similar to the npm/nuget/pypi publish jobs.
Impact
| Capability | Current | With Fix |
|---|---|---|
| Install latest | ✅ Works (pseudo-version) | ✅ Works |
| Pin specific version | ❌ Fails | ✅ Works |
| Reproducible builds | ✅ Semantic versions | |
go list -m -versions |
❌ Empty | ✅ Shows all versions |
Environment
- Go: 1.25.5
- macOS (also tested concept on Linux)
- Repo:
github/copilot-sdk
Validation
SDK compiles and runs fine with pseudo-version - this is purely about version tagging for reproducibility:
package main
import copilot "github.com/github/copilot-sdk/go"
func main() {
client := copilot.NewClient(&copilot.ClientOptions{LogLevel: "error"})
// Works! Client created: *copilot.Client
}Happy to submit a PR if this approach looks right! 🚀