Skip to content

First stab from claude - #820

Closed
nolag wants to merge 1 commit into
mainfrom
rtinianov_di
Closed

nolag wants to merge 1 commit into
mainfrom
rtinianov_di

Conversation

@nolag

@nolag nolag commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@cl-sonarqube-production

Copy link
Copy Markdown

Quality Gate failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 75%)

See analysis details on SonarQube

Comment thread libs/capability/run.go
// duplicate registration raises into an error - here it is the operator's binary, not init, that
// would be crashing.
func registerAll[T any](name string, config ConfigProvider[T]) (err error) {
defer func() {

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.

Why do we have a recover here?

Comment thread libs/capability/run.go
// TODO: pass in constructors here for our runnable/embeddable dependencies?
// Something else here
return run(cmd.Context(), lggr, cmd.Root().Name(), cfg, c)
cfg := embedRegistrations.configs[""].value.(*embedConfig)

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.

Not sure what this is

Comment thread libs/capability/runner.go
mux := http.NewServeMux()

httpCfg := cfg.http
httpCfg.Port += uint16(instance.ID)

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.

This should default to 0 and we'll just grab an open port


func (f *fakeBroadcaster) Subscribe(context.Context) (<-chan core.SettingsUpdate, error) {
// Subscribe hands out a stream that, like a real one, ends when the subscription's ctx does.
func (f *fakeBroadcaster) Subscribe(ctx context.Context) (<-chan core.SettingsUpdate, error) {

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.

There's a lot of extra complexity here -- why?

@@ -0,0 +1,19 @@
// Command docgen is a capability binary run only for its docs command: it generates the

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.

Not needed? Generating doc comments for struct provides nothing.

Comment thread libs/capability/config.go
// registerSettings registers the run's own settings, as any dependency registers its config, for
// RunErr to bind and start to resolve. capabilities differs between the commands: embed's has no
// proxy to dial and defaults the DON, and capabilityConfig is built from it.
func registerSettings() {

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.

rename settings -> config -- settings refers to cre settings specifically

Comment thread libs/capability/embed.go
// embeddedCapabilityConfig is capabilityConfig as an embed run registers it, replacing run's under
// the same namespace. It keeps the DON ID and drops the proxy URL: there is no node behind an
// embedded run to dial, so only what this binary hosts resolves.
type embeddedCapabilityConfig struct {

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.

?? it's this hard-coded to the same value every time? Do we need it?

telemetry TelemetryConfig
tracing TracingConfig
chipIngress ChipIngressConfig
pyroscope PyroscopeConfig

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.

Why was this removed?

Comment thread libs/capability/run.go
root.AddCommand(&cobra.Command{
// serve starts total instances from r and blocks until ctx is done. Only run hands the process
// to a go-plugin host: a host supervises one plugin, and an embed run is not one.
serve := func(cmd *cobra.Command, r *registrations, total int, pluginHost bool) error {

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.

pluginHost doesn’t need to be a boolean, can just check underPluginHost it's harmless and fast

@nolag nolag closed this Oct 15, 2026
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