auto_version: skip non-publishable go.mod modules#202
Merged
Conversation
The script tagged every directory containing a go.mod, which incorrectly published linter testdata fixtures (e.g. linters/isolint/testdata/v0.1.1) as releasable modules. Those fixtures are required to be standalone modules by analysistest, but they declare placeholder paths like "module example" and are not meant for consumption. Now each go.mod's declared module path must equal github.com/wego/pkg/<relative-dir>; mismatches are skipped with a reason. This is the truthful semantic test for "is this a publishable wego/pkg module?", and it scales to any future auxiliary go.mod (more linter fixtures, examples, benchmarks) without needing path filters or marker files. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
kates-wego
approved these changes
Apr 27, 2026
enzo-wego
approved these changes
May 4, 2026
lei-wego
approved these changes
May 4, 2026
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
auto_versionnow reads themodule …line from eachgo.modand only tags directories whose declared path equalsgithub.com/wego/pkg/<relative-dir>. Anything else is skipped with a reason.linters/isolint/testdata/v0.1.0,linters/isolint/testdata/v0.1.1, andlinters/stringlint/testdata/v0.1.0. Those directories are standalone Go modules only becausegolang.org/x/tools/go/analysis/analysistestrequires fixtures to be a self-contained module, and they declaremodule example— they are not meant for consumption.git push :refs/tags/...is reviewed on its own.Why module-path matching (and not the alternatives)
*/testdata/*find … -not -path '*/testdata/*'go.mod—examples/,benchmarks/,cmd/playground/, etc. Hardcodes one naming convention into the release tooling..no-release/.tagignore)go.mod'smodule …line to equalgithub.com/wego/pkg/<dir>; skip with a logged reason otherwiseWhy this is cleaner and scales
go.moddeclare itself as part ofgithub.com/wego/pkg?" Module path matching answers that directly; every other option is a proxy.moduledirective thatgo.modfiles already have. Nothing new for contributors to remember.github.com/wego/pkg/...module path.skipping <pkg> (module path "X" is not "Y"). If a real package is misconfigured, the mismatch is loud and immediately diagnosable.module_root + relative dir, soiso/site,http/middleware,linters/isolint, and any futurea/b/cresolve identically — no special casing.Verification
Dry-run against every
go.modin the repo classified all 33 publishable modules asTAGand both lintertestdatafixtures asSKIPwith the expected reason.linters/isolint/testdata/v0.1.0,linters/isolint/testdata/v0.1.1,linters/stringlint/testdata/v0.1.0.🤖 Generated with Claude Code