Skip to content

chore(x): remove the unused x/release helper - #722

Merged
Benehiko merged 1 commit into
mainfrom
chore/drop-cobra-from-x
Oct 29, 2026
Merged

Benehiko merged 1 commit into
mainfrom
chore/drop-cobra-from-x

Conversation

@Benehiko

@Benehiko Benehiko commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Releases are no longer cut with the x/release helper, but it kept spf13/cobra and spf13/pflag in the go.mod of the x library module that every other module depends on.

This removes:

  • x/release (the helper and its tests)
  • docs/releasing.md, which only documented that helper
  • the make bump target that ran it

Drops cobra, pflag and mousetrap from x/go.mod, and the vendored golang.org/x/mod/modfile, module and internal/lazyregexp packages that only the helper used. golang.org/x/mod stays in x only for the semver differential test in x/api added by #719. cobra stays in vendor/modules.txt because plugins/pass still uses it.

Builds for all workspace modules, go test ./x/... and golangci-lint on ./x/... pass. Tidied and vendored with make mod.

@Benehiko
Benehiko requested a review from a team as a code owner October 29, 2026 15:46
@Benehiko
Benehiko force-pushed the chore/drop-cobra-from-x branch from df10575 to e78ddc3 Compare October 29, 2026 15:49
@Benehiko Benehiko changed the title chore(x): drop spf13/cobra and spf13/pflag dependencies chore(x): remove the unused x/release helper Oct 29, 2026
@Benehiko
Benehiko force-pushed the chore/drop-cobra-from-x branch from e78ddc3 to e2ab79b Compare October 29, 2026 15:51

@docker-agent docker-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: 🟡 NEEDS ATTENTION

Two behavioral regressions introduced by replacing cobra with the standard flag package:

  1. --help fails outside a git repository: the .git existence check runs before the flag.FlagSet is set up, so any invocation from a non-repo directory returns a misleading error instead of printing usage.
  2. Flag-parse errors print twice: with flag.ContinueOnError, the flag package writes the error internally before returning it, and main prints it a second time. Suppressing the internal output with flags.SetOutput(io.Discard) would fix this.

The core rewrite (interspersed parsing, Level as flag.Value, go.mod cleanup) looks correct.

Comment thread x/release/command.go Outdated
Comment thread x/release/command.go Outdated
Releases are no longer cut with x/release, yet it kept spf13/cobra and spf13/pflag in the go.mod of the x library module. Remove the helper, its docs/releasing.md, and the make bump target that ran it. This drops cobra, pflag, and mousetrap from x.

Signed-off-by: Alano Terblanche <18033717+Benehiko@users.noreply.github.com>
@Benehiko
Benehiko force-pushed the chore/drop-cobra-from-x branch from e2ab79b to 33cc0d8 Compare October 29, 2026 15:51
@Benehiko
Benehiko enabled auto-merge October 29, 2026 15:52
@Benehiko
Benehiko merged commit 187b407 into main Oct 29, 2026
15 checks passed
@Benehiko
Benehiko deleted the chore/drop-cobra-from-x branch October 29, 2026 15:53
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.

3 participants