replace converter with a controller for each type, that should be converted #1889
replace converter with a controller for each type, that should be converted #1889AndrewChubatiuk wants to merge 2 commits intomasterfrom
Conversation
There was a problem hiding this comment.
6 issues found across 115 files
Note: This PR contains a large number of files. cubic only reviews up to 75 files per PR, so some files may not have been reviewed.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="internal/controller/operator/factory/reconcile/vmscrapeconfig.go">
<violation number="1" location="internal/controller/operator/factory/reconcile/vmscrapeconfig.go:32">
P3: %s formatting is used with types.NamespacedName, which is a struct. This causes incorrect log output (e.g., %!s(TYPE=...)). Use nsn.String() or %v for these log messages.</violation>
</file>
<file name="internal/controller/operator/promprobe_controller.go">
<violation number="1" location="internal/controller/operator/promprobe_controller.go:59">
P1: RBAC annotations use the wrong API group; Probe resources are in monitoring.coreos.com, so the controller will lack permissions and fail at runtime.</violation>
</file>
<file name="internal/controller/operator/prompodmonitor_controller.go">
<violation number="1" location="internal/controller/operator/prompodmonitor_controller.go:59">
P1: RBAC markers use the wrong apiGroup for PodMonitor. PodMonitor resources are under monitoring.coreos.com, so the generated role will not allow access, leading to RBAC errors when the controller tries to read PodMonitors.</violation>
</file>
<file name="internal/controller/operator/promservicemonitor_controller.go">
<violation number="1" location="internal/controller/operator/promservicemonitor_controller.go:59">
P1: RBAC group is set to operators.coreos.com, but ServiceMonitor CRDs are under monitoring.coreos.com. This will generate a Role/ClusterRole without permissions to read ServiceMonitors, so the controller may fail with RBAC errors.</violation>
</file>
<file name="internal/controller/operator/promalertmanagerconfig_controller.go">
<violation number="1" location="internal/controller/operator/promalertmanagerconfig_controller.go:36">
P3: The exported type comment is incorrect (mentions PodMonitor instead of AlertmanagerConfig), which makes the new public API misleading for readers and tooling. Update the GoDoc to match the reconciler’s purpose.
(Based on your team's feedback about documenting exported structs and public methods.) [FEEDBACK_USED]</violation>
</file>
<file name="internal/controller/operator/factory/reconcile/reconcile.go">
<violation number="1" location="internal/controller/operator/factory/reconcile/reconcile.go:43">
P3: Add a short comment explaining that the prefer strategies bypass the 3‑way merge. Right now the function comment still promises a 3‑way merge and preservation of third‑party labels, which no longer holds for the new prefer branches.
(Based on your team's feedback about adding comments for non-obvious logic.) [FEEDBACK_USED]</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
internal/controller/operator/factory/reconcile/vmscrapeconfig.go
Outdated
Show resolved
Hide resolved
internal/controller/operator/promalertmanagerconfig_controller.go
Outdated
Show resolved
Hide resolved
31aa021 to
2c9288e
Compare
|
@AndrewChubatiuk I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
1 issue found across 89 files
Note: This PR contains a large number of files. cubic only reviews up to 75 files per PR, so some files may not have been reviewed.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="internal/controller/operator/promservicemonitor_controller.go">
<violation number="1" location="internal/controller/operator/promservicemonitor_controller.go:59">
P1: RBAC rules target the wrong API group. ServiceMonitor resources are in the monitoring.coreos.com group, so using operators.coreos.com will prevent the controller from reading/updating ServiceMonitors.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
9129e16 to
041c978
Compare
041c978 to
1ac6b7a
Compare
|
@AndrewChubatiuk I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
2 issues found across 66 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="internal/config/config.go">
<violation number="1" location="internal/config/config.go:527">
P2: The ServiceMonitor flag is wired to the legacy SERVICESCRAPE env var, so operators using the new ServiceMonitor naming won’t be able to configure this controller via `VM_ENABLEDPROMETHEUSCONVERTER_SERVICEMONITOR`. Consider aligning the env tag with the new field name (or explicitly supporting both).</violation>
</file>
<file name="internal/manager/manager.go">
<violation number="1" location="internal/manager/manager.go:472">
P1: Prometheus conversion controllers are registered unconditionally; if the Prometheus CRDs are not installed, controller-runtime will fail to start (no matches for kind). Add a CRD discovery check (or skip setup when the GVK is missing) before registering these controllers.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
363800e to
cad2954
Compare
|
@AndrewChubatiuk I have started the AI code review. It will take a few minutes to complete. |
cad2954 to
778510d
Compare
…do not have any cleanup tasks
778510d to
1175ca6
Compare
replaced prometheus converter with controllers for each type
before resource watchers were added once respective prom CRD appears now controller checks presence of CRD on startup only and skips controller start if CRD is absent