Skip to content

replace converter with a controller for each type, that should be converted #1889

Open
AndrewChubatiuk wants to merge 2 commits intomasterfrom
updates
Open

replace converter with a controller for each type, that should be converted #1889
AndrewChubatiuk wants to merge 2 commits intomasterfrom
updates

Conversation

@AndrewChubatiuk
Copy link
Contributor

@AndrewChubatiuk AndrewChubatiuk commented Feb 26, 2026

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

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

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.

@AndrewChubatiuk AndrewChubatiuk force-pushed the updates branch 4 times, most recently from 31aa021 to 2c9288e Compare February 26, 2026 14:52
@AndrewChubatiuk
Copy link
Contributor Author

@cubic-dev-ai

@cubic-dev-ai
Copy link
Contributor

cubic-dev-ai bot commented Feb 26, 2026

@cubic-dev-ai

@AndrewChubatiuk I have started the AI code review. It will take a few minutes to complete.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

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.

@AndrewChubatiuk AndrewChubatiuk force-pushed the updates branch 3 times, most recently from 9129e16 to 041c978 Compare February 26, 2026 20:06
@AndrewChubatiuk AndrewChubatiuk changed the title replace converter with a reconcilers for each type, that should be converted replace converter with a controller for each type, that should be converted Feb 26, 2026
@AndrewChubatiuk
Copy link
Contributor Author

@cubic-dev-ai

@cubic-dev-ai
Copy link
Contributor

cubic-dev-ai bot commented Feb 27, 2026

@cubic-dev-ai

@AndrewChubatiuk I have started the AI code review. It will take a few minutes to complete.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

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.

@AndrewChubatiuk AndrewChubatiuk force-pushed the updates branch 4 times, most recently from 363800e to cad2954 Compare February 27, 2026 12:45
@AndrewChubatiuk
Copy link
Contributor Author

@cubic-dev-ai

@cubic-dev-ai
Copy link
Contributor

cubic-dev-ai bot commented Feb 27, 2026

@cubic-dev-ai

@AndrewChubatiuk I have started the AI code review. It will take a few minutes to complete.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 65 files

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.

1 participant