Skip to content

watch only known configmaps for WVA#49

Open
Gregory-Pereira wants to merge 7 commits intoopendatahub-io:mainfrom
Gregory-Pereira:watch-known-configmaps
Open

watch only known configmaps for WVA#49
Gregory-Pereira wants to merge 7 commits intoopendatahub-io:mainfrom
Gregory-Pereira:watch-known-configmaps

Conversation

@Gregory-Pereira
Copy link
Copy Markdown
Member

@Gregory-Pereira Gregory-Pereira commented Mar 30, 2026

Watching all the configmaps is creating resource issues. Now the cache filters by label so only a handful of ConfigMaps are stored in memory instead of every one in the cluster.

cc @vivekk16 @pierDipi

Summary by CodeRabbit

  • Refactor

    • Controller watch behavior refined to monitor only specific configuration resources via targeted informers, reducing unnecessary reconciles and event noise.
    • Informers now start in a non-leader runnable group and ensure cache synchronization before controllers process events, improving stability of config updates.
    • Predicate logic updated so one legacy config name no longer triggers automatic reconciliation.
  • Style

    • Minor formatting, comment and whitespace cleanups across configuration, engine, and test code; no behavioral changes.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 30, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR makes small non-functional whitespace and formatting edits in several files and a behavioral change to controller wiring. It adjusts an inline struct tag comment in internal/config/saturation_scaling.go, removes a trailing blank line in internal/engines/pipeline/enforcer.go, tweaks test struct literal spacing in internal/engines/pipeline/greedy_score_optimizer_test.go, and re-indents a comment in internal/engines/saturation/engine_v2.go. In internal/controller/predicates.go the wellKnownNames allowlist no longer includes config.ConfigMapName(). In internal/controller/configmap_reconciler.go the reconciler replaces a global For(&corev1.ConfigMap{}) watch with per-name client-go SharedIndexInformers (server-side metadata.name selectors), adds an informerRunnable registered as a non-leader runnable, and wires the controller to those informers via WatchesRawSource while retaining ConfigMapPredicate.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Issues

internal/controller/configmap_reconciler.go — Informer set may diverge from predicate (missing watches)

  • Risk: Hardcoded informer name list can differ from ConfigMapPredicate, causing some predicate-allowed ConfigMaps to be unwatched and never trigger reconciles.
  • Actionable: Consolidate the canonical name list into a single source referenced by both informer setup and ConfigMapPredicate, or derive informer names from the predicate; add tests asserting set equality.
  • Security/CWE: Improper Input Validation — CWE-20.

internal/controller/configmap_reconciler.go — Informer lifecycle and cache sync ordering (race)

  • Risk: Informers are registered as independent non-leader runnables and may start or sync at different times, risking missed events or inconsistent reconciles if the controller processes events before caches are synced.
  • Actionable: Ensure informers are started and their caches are fully synced before the controller begins reconciling (use a coordinated runnable that starts all informers and waits for HasSynced, or a sync barrier); add tests asserting cache sync ordering.
  • Security/CWE: Race Condition — CWE-362.

internal/controller/predicates.go — Behavioral change from removing a well-known name

  • Risk: Removing config.ConfigMapName() changes which ConfigMap events are accepted; callers or operational expectations that relied on prior behavior will stop receiving reconciles.
  • Actionable: Audit call sites, documentation, and tests that expected reconciles for that ConfigMap; either restore the name, document the behavioral change, or provide a migration path. Add tests verifying intended acceptance semantics.
  • Impact: Availability/Integrity.
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'watch only known configmaps for WVA' directly reflects the main change: restricting the controller to watch only known/labeled ConfigMaps instead of all ConfigMaps in the cluster.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/user-guide/namespace-management.md (1)

296-306: ⚠️ Potential issue | 🟡 Minor

Scenario 3 example missing required label.

This inline ConfigMap example lacks wva.llmd.ai/config: "true". Per the "Required Label" section at lines 179-182, this ConfigMap would be invisible to the controller.

📝 Proposed fix
 # 3. Create namespace-local saturation config
 kubectl apply -f - <<EOF
 apiVersion: v1
 kind: ConfigMap
 metadata:
   name: wva-saturation-config
   namespace: my-app
+  labels:
+    wva.llmd.ai/config: "true"
 data:
   default: |
     kvCacheThreshold: 0.80
     queueLengthThreshold: 10
 EOF
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/user-guide/namespace-management.md` around lines 296 - 306, The
ConfigMap example for "wva-saturation-config" is missing the required label so
the controller will ignore it; update the example's metadata to include the
required label key wva.llmd.ai/config set to "true" (add a metadata.labels block
under the ConfigMap's metadata for name: wva-saturation-config in namespace:
my-app) so the controller can discover this resource.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@docs/user-guide/namespace-management.md`:
- Around line 296-306: The ConfigMap example for "wva-saturation-config" is
missing the required label so the controller will ignore it; update the
example's metadata to include the required label key wva.llmd.ai/config set to
"true" (add a metadata.labels block under the ConfigMap's metadata for name:
wva-saturation-config in namespace: my-app) so the controller can discover this
resource.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: b2e3d99a-e496-4351-84f6-7bf7168ab698

📥 Commits

Reviewing files that changed from the base of the PR and between 1504007 and 0a490b4.

📒 Files selected for processing (7)
  • cmd/main.go
  • config/manager/configmap-saturation-scaling.yaml
  • config/manager/configmap.yaml
  • config/openshift/configmap-patch.yaml
  • config/samples/model-scale-to-zero-config.yaml
  • docs/user-guide/namespace-management.md
  • internal/constants/labels.go

@zdtsw
Copy link
Copy Markdown
Member

zdtsw commented Mar 31, 2026

two questions:

  1. should this be add to upstream first?
  2. is this for 3.4EA2 or 3.4 stable?

Comment thread docs/user-guide/namespace-management.md Outdated
@pierDipi
Copy link
Copy Markdown
Member

  1. should this be add to upstream first?

+1 on doing it upstream first

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@internal/controller/configmap_reconciler.go`:
- Around line 114-119: The list wellKnownNames currently includes
config.ConfigMapName() but Reconcile's switch (in the Reconcile method) has no
case to handle that name and falls to the default "Ignoring unrecognized
ConfigMap"; either remove config.ConfigMapName() from wellKnownNames if no
handling is required, or add a new case in Reconcile's switch to handle
config.ConfigMapName() (implement the desired handling logic similar to the
existing cases for config.SaturationConfigMapName,
config.DefaultScaleToZeroConfigMapName, or config.QMAnalyzerConfigMapName) so
events for config.ConfigMapName() are processed rather than ignored.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: c310f5cc-e638-455f-9e32-7445f85d0e0d

📥 Commits

Reviewing files that changed from the base of the PR and between 0a490b4 and 99eb618.

📒 Files selected for processing (5)
  • internal/config/saturation_scaling.go
  • internal/controller/configmap_reconciler.go
  • internal/engines/pipeline/enforcer.go
  • internal/engines/pipeline/greedy_score_optimizer_test.go
  • internal/engines/saturation/engine_v2.go
💤 Files with no reviewable changes (1)
  • internal/engines/pipeline/enforcer.go
✅ Files skipped from review due to trivial changes (3)
  • internal/config/saturation_scaling.go
  • internal/engines/saturation/engine_v2.go
  • internal/engines/pipeline/greedy_score_optimizer_test.go

Comment thread internal/controller/configmap_reconciler.go
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
internal/controller/configmap_reconciler.go (1)

135-140: Resync period of zero disables periodic resync.

Setting resyncPeriod to 0 means the informer relies exclusively on watch events. If a watch disconnects and misses events before reconnection, state could drift until the next full relist (triggered only by watch errors, not timer).

If this is intentional for reducing API server load, document it. Otherwise, consider a non-zero resync interval (e.g., 30*time.Minute) as a safety net.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@internal/controller/configmap_reconciler.go` around lines 135 - 140, The
informer created by toolscache.NewSharedIndexInformer currently passes a
resyncPeriod of 0 which disables periodic resync; change the resyncPeriod
argument in the informer creation (the NewSharedIndexInformer call that
constructs informer for &corev1.ConfigMap{}) to a non-zero duration such as
30*time.Minute (or make the interval configurable) so periodic relists act as a
safety net, or if zero is intentional add a clear comment and/or configuration
flag documenting the deliberate choice.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@internal/controller/configmap_reconciler.go`:
- Around line 142-152: The informer is being added as an "Others" runnable
(mgr.Add(manager.RunnableFunc(...)) with informer.Run) which can start after
controllers block on cache sync; replace this by using the manager's cache so
the informer is part of the Caches phase: either implement the manager Caches
group interface (add GetCache() returning cache.Cache) and return the cache used
to build the informer, or simply call mgr.GetCache() and create the informer
from that cache instead of registering informer.Run; then remove the custom
runnable and keep bldr.WatchesRawSource(&source.Informer{Informer: informer,
Handler: &handler.EnqueueRequestForObject{}}) so WaitForCacheSync is satisfied
before controllers start.

---

Nitpick comments:
In `@internal/controller/configmap_reconciler.go`:
- Around line 135-140: The informer created by toolscache.NewSharedIndexInformer
currently passes a resyncPeriod of 0 which disables periodic resync; change the
resyncPeriod argument in the informer creation (the NewSharedIndexInformer call
that constructs informer for &corev1.ConfigMap{}) to a non-zero duration such as
30*time.Minute (or make the interval configurable) so periodic relists act as a
safety net, or if zero is intentional add a clear comment and/or configuration
flag documenting the deliberate choice.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 90ec3ddd-41e4-4fa7-b262-d0c9162f3469

📥 Commits

Reviewing files that changed from the base of the PR and between 99eb618 and 3d4748e.

📒 Files selected for processing (2)
  • internal/controller/configmap_reconciler.go
  • internal/controller/predicates.go

Comment on lines +142 to +152
if err := mgr.Add(manager.RunnableFunc(func(ctx context.Context) error {
informer.Run(ctx.Done())
return nil
})); err != nil {
return fmt.Errorf("registering informer for ConfigMap %q: %w", cmName, err)
}

bldr.WatchesRawSource(&source.Informer{
Informer: informer,
Handler: &handler.EnqueueRequestForObject{},
})
Copy link
Copy Markdown

@coderabbitai coderabbitai bot Mar 31, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

Does controller-runtime manager.Add() guarantee runnables start before controller sources call WaitForCacheSync?

💡 Result:

No—Manager.Add() by itself does not guarantee that an arbitrary runnable has started before a controller’s sources call WaitForCacheSync.

What is guaranteed (by the manager’s start sequencing) is:

  • The manager starts runnable groups in this order: HTTPServers → Webhooks → Caches → Others → Warmup → (then) LeaderElection runnables (after election / or immediately if leader election is disabled). Controllers run in the LeaderElection group, so they start after the cache group has been started (and its “ready” checks have completed). [1]
  • If your runnable is classified into the Caches group (i.e., it matches hasCache), controller-runtime wires its “ready check” to runnable.GetCache().WaitForCacheSync(ctx), and the group’s Start() waits for those ready checks for items queued before Start() completes. [2][3]

But if your runnable ends up in Others or LeaderElection:

  • It may start concurrently with (or after) controllers, and there is no ordering guarantee that it will run before a controller’s sources execute their own WaitForCacheSync logic. Also, runnables added after a group has already started are just enqueued and started asynchronously, without any global ordering barrier against controllers. [2]

Practical takeaway: the only reliable “starts-before-controllers-wait-for-cache-sync” relationship is achieved by being in the Caches group (implementing hasCache) so the manager blocks on WaitForCacheSync before starting controllers; otherwise, Add() does not provide that guarantee. [1][2]

References:
[1] controller-runtime manager start order (internal.go, controllerManager.Start) (raw.githubusercontent.com)
[2] runnable grouping + “added after Start are started directly” (runnable_group.go) (raw.githubusercontent.com)
[3] cache sync semantics (Informers.WaitForCacheSync) (pkg.go.dev)

Citations:


Confirmed startup race: informer runnable may start after controller's WaitForCacheSync blocks.

mgr.Add(manager.RunnableFunc(...)) registers the informer in the "Others" runnable group. Controller-runtime manager startup order is: Caches group (blocks on sync) → LeaderElection group (controllers). Since controllers run in LeaderElection and start after the Caches group completes, and your informer runnable is in "Others", the informer may start concurrently with or after the controller. When source.Informer.Start() calls WaitForCacheSync, if informer.Run() hasn't populated the cache yet, it will block indefinitely or timeout.

Fix: Implement the Caches group interface (add a GetCache() method returning a cache.Cache) so the manager blocks on WaitForCacheSync before starting controllers, or use mgr.GetCache() directly instead of a custom informer runnable.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@internal/controller/configmap_reconciler.go` around lines 142 - 152, The
informer is being added as an "Others" runnable
(mgr.Add(manager.RunnableFunc(...)) with informer.Run) which can start after
controllers block on cache sync; replace this by using the manager's cache so
the informer is part of the Caches phase: either implement the manager Caches
group interface (add GetCache() returning cache.Cache) and return the cache used
to build the informer, or simply call mgr.GetCache() and create the informer
from that cache instead of registering informer.Run; then remove the custom
runnable and keep bldr.WatchesRawSource(&source.Informer{Informer: informer,
Handler: &handler.EnqueueRequestForObject{}}) so WaitForCacheSync is satisfied
before controllers start.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this is worth fixing

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Find go.mod for controller-runtime version
cat go.mod | grep controller-runtime

# Find main.go
fd -e go -g 'main.go' --exec cat {}

# Check controller-runtime cache options usage
rg -n "cache.Options\|ByObject\|NewManager\|ctrl.Options" --type=go -C3

Length of output: 20729


@pierDipi — confirmed. The root cause in v0.22.5: manager.RunnableFunc does not implement LeaderElectionRunnable, so controller-runtime places it in the LeaderElection group — the same group as controllers. Both informer.Run() and the controller's source.Informer.Start() (which calls WaitForCacheSync) launch concurrently, creating the race.

The minimal fix is a small dedicated struct that implements NeedLeaderElection() bool { return false }, which moves the informer runnable to the Others group — guaranteed to start before the LeaderElection group:

// informerRunnable wraps a SharedIndexInformer so it starts in the "Others"
// runnable group (NeedLeaderElection=false), which the manager starts before
// the LeaderElection group where controllers live. This ensures informer.Run()
// is called before source.Informer.Start() calls WaitForCacheSync.
type informerRunnable struct {
	informer toolscache.SharedIndexInformer
}

func (ir *informerRunnable) Start(ctx context.Context) error {
	ir.informer.Run(ctx.Done())
	return nil
}

// NeedLeaderElection returns false so the manager places this runnable in the
// "Others" group, which starts before the LeaderElection group (controllers).
func (ir *informerRunnable) NeedLeaderElection() bool {
	return false
}

Then replace the mgr.Add(manager.RunnableFunc(...)) call in the loop:

// Before (races with controller start — RunnableFunc → LeaderElection group):
if err := mgr.Add(manager.RunnableFunc(func(ctx context.Context) error {
    informer.Run(ctx.Done())
    return nil
})); err != nil {
    return fmt.Errorf("registering informer for ConfigMap %q: %w", cmName, err)
}

// After (informerRunnable → Others group, starts before controllers):
if err := mgr.Add(&informerRunnable{informer: informer}); err != nil {
    return fmt.Errorf("registering informer for ConfigMap %q: %w", cmName, err)
}

The informerRunnable type can live at the bottom of configmap_reconciler.go (or a shared file if more controllers need it). No changes to main.go or the source.Informer wiring are required.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I have attempted to solve this in 47f141dbf0ee907fd550b4082bc9354abfec466b, can we confirm this is no longer an issue coderrabitai?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

Copy link
Copy Markdown
Member

@pierDipi pierDipi left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

Signed-off-by: greg pereira <grpereir@redhat.com>
Signed-off-by: greg pereira <grpereir@redhat.com>
Signed-off-by: greg pereira <grpereir@redhat.com>
…where controllers start) to the Others group

Signed-off-by: greg pereira <grpereir@redhat.com>
@Gregory-Pereira
Copy link
Copy Markdown
Member Author

Gregory-Pereira commented Apr 3, 2026

@coderabbitai can you do another review please?

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 3, 2026

@Gregory-Pereira Sure! Kicking off a fresh review of PR #49 now.

✅ Actions performed

Full review triggered.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@internal/controller/configmap_reconciler.go`:
- Around line 125-130: The ListWatch is hard-coded to metav1.NamespaceAll;
change it to use the reconciler's configured watch namespace (the same namespace
variable used by shouldWatchNamespaceLocalConfigMap, e.g., r.watchNamespace or
cfg.WatchNamespace) so the call to toolscache.NewFilteredListWatchFromClient
uses that namespace instead of NamespaceAll, and preserve the existing behavior
for cluster-wide mode (fall back to metav1.NamespaceAll only when the configured
watch namespace is empty/explicitly set to all). Ensure the reference to cmName
and the FieldSelector logic stays unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 022cd3be-3562-4f0d-86c8-d71777e2a598

📥 Commits

Reviewing files that changed from the base of the PR and between 1504007 and 47f141d.

📒 Files selected for processing (6)
  • internal/config/saturation_scaling.go
  • internal/controller/configmap_reconciler.go
  • internal/controller/predicates.go
  • internal/engines/pipeline/enforcer.go
  • internal/engines/pipeline/greedy_score_optimizer_test.go
  • internal/engines/saturation/engine_v2.go
💤 Files with no reviewable changes (1)
  • internal/engines/pipeline/enforcer.go

Comment thread internal/controller/configmap_reconciler.go Outdated
Signed-off-by: greg pereira <grpereir@redhat.com>
@Gregory-Pereira Gregory-Pereira force-pushed the watch-known-configmaps branch from 47f141d to c265bbd Compare April 3, 2026 17:01
@Gregory-Pereira Gregory-Pereira changed the title watch only known configmaps for WVA based on label watch only known configmaps for WVA Apr 3, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@internal/controller/configmap_reconciler.go`:
- Around line 119-134: The controller currently only creates a ListWatch scoped
to r.Config.WatchNamespace(), which drops global ConfigMaps from
config.SystemNamespace() when WatchNamespace is set; update the loop that builds
the list watches (where NewFilteredListWatchFromClient is used for each cmName
in wellKnownNames) to also register a second ListWatch for
config.SystemNamespace() whenever watchNS != metav1.NamespaceAll and watchNS !=
config.SystemNamespace() (avoid duplicates when they match); ensure you capture
loop variables (cmName) as now, attach both watches to the controller so
ConfigMapPredicate and Reconcile will observe global config, and keep the
existing event filter (ConfigMapPredicate) unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 00e8a16f-fd7e-41f9-b42f-623431aad04a

📥 Commits

Reviewing files that changed from the base of the PR and between 47f141d and c265bbd.

📒 Files selected for processing (6)
  • internal/config/saturation_scaling.go
  • internal/controller/configmap_reconciler.go
  • internal/controller/predicates.go
  • internal/engines/pipeline/enforcer.go
  • internal/engines/pipeline/greedy_score_optimizer_test.go
  • internal/engines/saturation/engine_v2.go
💤 Files with no reviewable changes (1)
  • internal/engines/pipeline/enforcer.go
✅ Files skipped from review due to trivial changes (3)
  • internal/engines/saturation/engine_v2.go
  • internal/config/saturation_scaling.go
  • internal/engines/pipeline/greedy_score_optimizer_test.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • internal/controller/predicates.go

Comment thread internal/controller/configmap_reconciler.go Outdated
Signed-off-by: greg pereira <grpereir@redhat.com>
@Gregory-Pereira
Copy link
Copy Markdown
Member Author

Gregory-Pereira commented Apr 3, 2026

@coderabbitai please review

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 3, 2026

@Gregory-Pereira Sure! Kicking off a full review of PR #49 now.

✅ Actions performed

Full review triggered.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@internal/controller/configmap_reconciler.go`:
- Around line 131-133: The ConfigMapPredicate passed to WithEventFilter on the
builder is not applied to WatchesRawSource calls, so update each
WatchesRawSource(...) call to attach the predicate directly to the underlying
informer (use source.Informer(...).WithPredicates(...) or equivalent) so
namespace/tracking filters run before enqueue; locate the WatchesRawSource
usages in the configmap controller (references: bldr, WatchesRawSource,
ConfigMapPredicate, WithEventFilter) and replace or augment them so each raw
source/informer is created with ConfigMapPredicate instead of relying solely on
WithEventFilter.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 301c19fc-68ee-4ba7-8e54-7ea8fe8cb34d

📥 Commits

Reviewing files that changed from the base of the PR and between 242b310 and ba3d882.

📒 Files selected for processing (6)
  • internal/config/saturation_scaling.go
  • internal/controller/configmap_reconciler.go
  • internal/controller/predicates.go
  • internal/engines/pipeline/enforcer.go
  • internal/engines/pipeline/greedy_score_optimizer_test.go
  • internal/engines/saturation/engine_v2.go
💤 Files with no reviewable changes (1)
  • internal/engines/pipeline/enforcer.go

Comment thread internal/controller/configmap_reconciler.go Outdated
…w sources) into each source.Informer's Predicates field directly

Signed-off-by: greg pereira <grpereir@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants