Repository navigation
fix(controller): align APPLICATIONS_NAMESPACE validation across reconcile paths - #81
Conversation
|
Warning Review limit reached
Next review available in: 48 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Central YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThe change adds Estimated code review effort: 3 (Moderate) | ~20 minutes 🚥 Pre-merge checks | ✅ 10✅ Passed checks (10 passed)
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. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #81 +/- ##
==========================================
+ Coverage 65.04% 65.14% +0.10%
==========================================
Files 21 21
Lines 2406 2413 +7
==========================================
+ Hits 1565 1572 +7
Misses 661 661
Partials 180 180
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@internal/controller/workbenches_controller_test.go`:
- Around line 443-446: The cleanup registered in the fallback test must not
unconditionally delete the shared applications namespace. Update the
DeferCleanup block around cleanupWorkbenches and cleanupNamespace so it only
removes namespaces created exclusively by this test, or isolate the test and
recreate the namespace for all dependent specs; preserve cleanup of test-owned
resources while keeping the suite-wide applicationsNamespace available.
In `@internal/controller/workbenches_controller.go`:
- Around line 679-685: Update ensureGeneratedNamespace calls in the Workbench
reconciliation flow, including the applications and legacy workbench namespace
paths, so namespaces created outside the resolved operand cleanup scope are not
labeled as generated. Separate namespace creation from generated-namespace
ownership, preserving the existing cleanup label only where
cleanupManagedResources and deletion permissions cover that namespace.
🪄 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 Plus
Run ID: 87c8b702-42ed-4419-bc9b-80757da2881c
📒 Files selected for processing (6)
cmd/main.gointernal/controller/platform_config_predicate_test.gointernal/controller/workbenches_controller.gointernal/controller/workbenches_controller_test.gointernal/platform/platform.gointernal/platform/suite_test.go
…cile paths Unify APPLICATIONS_NAMESPACE DNS-1123 validation across reconcile and ConfigMap watch paths, remove an unused ensureGeneratedNamespace parameter, and tighten envtest cleanup for invalid-namespace fallback tests. Co-authored-by: Cursor <cursoragent@cursor.com> Signed-off-by: Harshad Reddy Nalla <hnalla@redhat.com>
427a817 to
b040287
Compare
jstourac
left a comment
There was a problem hiding this comment.
/lgtm
/approve
thank you for this followup 💯 🎉
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: harshad16, jstourac The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Unify APPLICATIONS_NAMESPACE DNS-1123 validation across reconcile and ConfigMap watch paths, remove an unused ensureGeneratedNamespace parameter, and tighten envtest cleanup for invalid-namespace fallback tests.
Description
Follow-up to #77 addressing post-merge review feedback from @jstourac:
APPLICATIONS_NAMESPACEvalidation — introduceplatform.ValidApplicationsNamespace()andconfiguredApplicationsNamespace()soresolveOperandNamespace()andplatformConfigWatchNamespaces()apply the same DNS-1123 rules. Previously, an invalid env value caused reconcile to fall back to platform defaults while the ConfigMap watch still pointed at the bad namespace.Workbenchesargument fromensureGeneratedNamespace().ApplicationsNamespaceenvtest now also cleans up the fallbackopendatahubnamespace it labels during reconcile.Startup validation in
cmd/main.gonow uses the same shared helper.Related: opendatahub-io/opendatahub-operator#3890
JIRA: https://redhat.atlassian.net/browse/RHOAIENG-79812
How Has This Been Tested?
go test ./internal/platform/...go test ./cmd/... -run TestResolveApplicationsNamespacego test ./internal/controller/... -run TestPlatformConfigWatchNamespacesmake unit-testMerge criteria:
Summary by CodeRabbit