Skip to content

Commit 15a1361

Browse files
Patel230claude
andcommitted
build(go.mod): retract the hawk-era v0.1.0–v0.2.0 tags
proxy.golang.org serves v0.1.0, v0.1.1 and v0.2.0 for github.com/GrayCodeAI/rho, but those tags were cut before the rename: their go.mod declares module github.com/GrayCodeAI/hawk and they contain no cmd/rho, so `go install .../cmd/rho@latest` fails with "does not contain package" and tooling (pkg.go.dev, dependabot) lists them as rho versions. The proxy keeps them forever, so retract the range with a rationale; retractions take effect from the first release that carries this go.mod (v0.3.0), after which @latest is v0.3.0 and the old versions are marked retracted. `go mod tidy -diff`, `go mod verify` and the replace-directive guard pass; a testaudit test keeps the range retracted and ensures VERSION is never inside it. Refs: F025 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 72bddcc commit 15a1361

2 files changed

Lines changed: 33 additions & 0 deletions

File tree

‎go.mod‎

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎internal/testaudit/release_version_test.go‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"strings"
77
"testing"
88

9+
"golang.org/x/mod/modfile"
910
"golang.org/x/mod/semver"
1011
)
1112

@@ -36,3 +37,30 @@ func TestVersionFileIsSemVer(t *testing.T) {
3637
t.Fatalf("VERSION = %q is below 0.3.0, the first rho-named release", v)
3738
}
3839
}
40+
41+
// The hawk-era tags v0.1.0, v0.1.1 and v0.2.0 are on the Go module proxy under
42+
// this module path but declare module github.com/GrayCodeAI/hawk; go.mod must
43+
// keep retracting them so `go list -m -versions` and tooling skip them.
44+
func TestGoModRetractsHawkEraVersions(t *testing.T) {
45+
f, err := modfile.Parse("go.mod", readRepoFile(t, "go.mod"), nil)
46+
if err != nil {
47+
t.Fatalf("parse go.mod: %v", err)
48+
}
49+
for _, v := range []string{"v0.1.0", "v0.1.1", "v0.2.0"} {
50+
retracted := false
51+
for _, r := range f.Retract {
52+
if semver.Compare(r.Low, v) <= 0 && semver.Compare(v, r.High) <= 0 {
53+
retracted = true
54+
}
55+
}
56+
if !retracted {
57+
t.Errorf("go.mod does not retract hawk-era %s", v)
58+
}
59+
}
60+
current := "v" + repoVersion(t)
61+
for _, r := range f.Retract {
62+
if semver.Compare(r.Low, current) <= 0 && semver.Compare(current, r.High) <= 0 {
63+
t.Errorf("go.mod retracts the current VERSION %s", current)
64+
}
65+
}
66+
}

0 commit comments

Comments
 (0)