Skip to content

Use x/cli for PSBs - #826

Merged
nolag merged 1 commit into
mainfrom
rtinianov_flags
Oct 15, 2026
Merged

nolag merged 1 commit into
mainfrom
rtinianov_flags

Conversation

@nolag

@nolag nolag commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The new binder rejects existing kebab-case TOML keys, preventing affected binaries from starting.

1 open finding
What changed in this PR

Migrates PSB configuration binding from the local Viper implementation to the shared x/config/cli package.

Changes:

  • Replaces local flag binding with shared namespace registration.
  • Generates flag help from configuration field comments.
  • Updates configuration types, tests, and dependencies.
File Description
libs/​go.sum Updates dependency checksums.
libs/​go.mod Adds shared configuration dependency; removes Viper.
libs/​capability/​webserver.go Converts flag help to field comments.
libs/​capability/​telemetry.go Documents telemetry configuration fields.
libs/​capability/​telemetry_test.go Adapts binding tests and checks documentation coverage.
libs/​capability/​settings.go Exports and documents settings configuration.
libs/​capability/​settings_test.go Uses the exported configuration type.
libs/​capability/​run.go Delegates configuration flag registration to the binder.
libs/​capability/​registry.go Uses exported configuration types.
libs/​capability/​registry_test.go Updates configuration type references.
libs/​capability/​pyroscope.go Converts flag help to field comments.
libs/​capability/​observability.go Removes local namespace enumeration.
libs/​capability/​internal/​docgen/​main.go Adds configuration documentation generator.
libs/​capability/​flags.go Removes the local Viper binder.
libs/​capability/​doccomments_gen.go Adds generated configuration documentation.
libs/​capability/​config.go Registers configuration with the shared binder.
libs/​capability/​capability.go Exports and documents capability configuration.
Files not reviewed (1)
  • libs/capability/doccomments_gen.go: Generated file

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread libs/capability/config.go
// bind binds every config to root, each under the namespace that owns it. Each is settable by
// flag, CRE_/CL_ env var, or config file, in that order of precedence, over its defaults.
func (c *config) bind(root *cobra.Command) (*cli.Binder, error) {
b, err := cli.New(cli.Options{Markup: tomlmarkup.New(), Prefixes: []string{"CRE", "CL"}})

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Nothing used this, I don't care about preservation.

@cl-sonarqube-production

Copy link
Copy Markdown

@nolag
nolag marked this pull request as ready for review October 15, 2026 20:23
@nolag
nolag requested review from a team as code owners October 15, 2026 20:23
@nolag
nolag enabled auto-merge October 15, 2026 20:24
@nolag
nolag added this pull request to the merge queue Oct 15, 2026
Merged via the queue into main with commit cc4be91 Oct 15, 2026
20 checks passed
@nolag
nolag deleted the rtinianov_flags branch October 15, 2026 20:48
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.

4 participants