Summary
isComponentEnabled at line 1284 uses any with a type switch over known component types. If a new component type is added but not included in the switch, the function silently returns false — disabling the component with no compile-time warning. This is a maintenance footgun.
Detailed Requirements
Define an enableable interface (e.g., type enableable interface { IsEnabled() bool }) and implement it on all component spec types. Replace the any parameter with the typed interface so that new components that forget to implement IsEnabled() cause a compile error rather than silent misbehavior.
Location
internal/controller/axonopsserver_controller.go:1284
Acceptance Criteria
isComponentEnabled uses a typed interface parameter, not any
- New component types that do not implement the interface cause a compile error
- All existing callers updated to use the interface
- No behavioral change for existing components
Testing Requirements
- Unit test: verify each component type satisfies the interface
- Compile-time verification: adding a new component type without
IsEnabled() fails to compile
Documentation Requirements
- Add godoc to the
enableable interface
- Comment on
isComponentEnabled explaining the design choice
Dependencies
Summary
isComponentEnabledat line 1284 usesanywith a type switch over known component types. If a new component type is added but not included in the switch, the function silently returnsfalse— disabling the component with no compile-time warning. This is a maintenance footgun.Detailed Requirements
Define an
enableableinterface (e.g.,type enableable interface { IsEnabled() bool }) and implement it on all component spec types. Replace theanyparameter with the typed interface so that new components that forget to implementIsEnabled()cause a compile error rather than silent misbehavior.Location
internal/controller/axonopsserver_controller.go:1284Acceptance Criteria
isComponentEnableduses a typed interface parameter, notanyTesting Requirements
IsEnabled()fails to compileDocumentation Requirements
enableableinterfaceisComponentEnabledexplaining the design choiceDependencies