Skip to content

fix(module): rename to /v2 import path for semantic import versioning#6

Merged
lfstokols merged 1 commit into
mainfrom
fix/v2-module-path
May 25, 2026
Merged

fix(module): rename to /v2 import path for semantic import versioning#6
lfstokols merged 1 commit into
mainfrom
fix/v2-module-path

Conversation

@lfstokols
Copy link
Copy Markdown
Contributor

Background

v2.0.0 was tagged from main while go.mod still declared the module path as github.com/benedoc-inc/pdfer (no /v2 suffix). Go's semantic import versioning requires major version ≥ 2 to encode the version in the import path. The proxy refused the release with module path must match major version; the tag has since been rolled back.

This PR fixes the module path and adds a CI guard so the next attempt can't repeat the same mistake.

What changed

Module rename (go.mod + ~140 files):

  • go.mod module path → github.com/benedoc-inc/pdfer/v2
  • All internal imports rewritten
  • README install command and badges updated
  • CLAUDE.md example import updated
  • pdfer.go modulePath constant (used by Version() to find itself in runtime/debug.BuildInfo) updated

Release-workflow guard (.github/workflows/release.yml):
A new Enforce semantic import versioning step refuses to tag:

  • vN.x.x (N ≥ 2) when go.mod's module path does not end in /vN
  • v1.x.x when go.mod's module path does carry a /vN suffix

Fails before the tag is created, so a misconfigured release stops cleanly instead of producing a broken artifact.

Test plan

  • go build ./... passes
  • go vet ./... passes
  • go test ./... passes
  • gofmt -l . clean
  • CI green on this PR
  • After merge: re-cut v2.0.0 via the Release workflow and confirm the guard passes; a v1.x dry-run should still pass too

Note

The orphaned v2.0.0 tag has already been deleted; re-cutting from this commit produces a clean release.

🤖 Generated with Claude Code

v2.0.0 was tagged with the v1-style module path
'github.com/benedoc-inc/pdfer', so the Go proxy rejects it with
"module path must match major version". Rename go.mod to
'github.com/benedoc-inc/pdfer/v2' and rewrite all internal imports,
README badges, install commands, and the modulePath constant used
by Version().

Add a semantic-import-versioning guard to release.yml that refuses
to tag vN.x.x (N>=2) when go.mod's module path doesn't end in /vN,
and refuses v1.x.x when it does. This prevents repeating the
broken-release situation.

The orphaned v2.0.0 tag and release will be removed separately
before re-cutting v2.0.0 from this commit.
@lfstokols lfstokols merged commit ce3f4c9 into main May 25, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants