-
Notifications
You must be signed in to change notification settings - Fork 24
replace the last use of the old apply client with the SSA client #499
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
replace the last use of the old apply client with the SSA client #499
Conversation
WalkthroughA new generic Changes
Sequence Diagram(s)sequenceDiagram
participant Ctrl as Controller
participant SSA as SSAApplyClient
participant ApplyAll as ApplyAll Generic
rect rgb(230, 245, 230)
Note over Ctrl,ApplyAll: Old Flow
Ctrl->>SSA: ApplyUnstructuredObjectsWithNewLabels(objs, labels)
SSA-->>Ctrl: error
end
rect rgb(245, 230, 230)
Note over Ctrl,ApplyAll: New Flow
Ctrl->>SSA: ApplyAll(ctx, objects)<br/>via EnsureLabels(labels)
SSA->>ApplyAll: ApplyAll[T](ctx, cl, objects)
loop for each object
ApplyAll->>SSA: ApplyObject(ctx, obj)
SSA-->>ApplyAll: error?
end
ApplyAll-->>SSA: error (first or none)
SSA-->>Ctrl: error
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #499 +/- ##
==========================================
+ Coverage 78.84% 78.86% +0.02%
==========================================
Files 53 53
Lines 2207 2210 +3
==========================================
+ Hits 1740 1743 +3
Misses 404 404
Partials 63 63
🚀 New features to boost your workflow:
|
There was a problem hiding this 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
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
controllers/toolchainclusterresources/toolchaincluster_resources_controller.go(3 hunks)controllers/toolchainclusterresources/toolchaincluster_resources_controller_test.go(1 hunks)pkg/client/ssa_client.go(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
controllers/toolchainclusterresources/toolchaincluster_resources_controller.go (1)
pkg/client/ssa_client.go (3)
NewSSAApplyClient(64-70)ApplyAll(245-252)EnsureLabels(116-120)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Verify Dependencies
🔇 Additional comments (2)
controllers/toolchainclusterresources/toolchaincluster_resources_controller_test.go (1)
113-114: Test field manager wired correctlyThanks for plumbing the test owner string through
prepareReconcile; this keeps the SSA client behavior exercised end-to-end.pkg/client/ssa_client.go (1)
241-252: ApplyAll refactor keeps semantics intactNice extraction—
ApplyAllcentralizes the iteration logic without changing howApplyObjectis invoked.
controllers/toolchainclusterresources/toolchaincluster_resources_controller.go
Show resolved
Hide resolved
rsoaresd
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
|
don't forget to update also member-operator https://github.com/codeready-toolchain/member-operator/blob/0d1ea44f4f94ff196b73d34d967e8d2043b3125d/cmd/main.go#L226-L230 |
|



This makes the
toolchainclusterresourcescontroller use the SSA client instead of the obsolete apply client.Summary by CodeRabbit