fix: removed duplicate code in KubeConfigUpdate. Added tests#309
fix: removed duplicate code in KubeConfigUpdate. Added tests#309adietish wants to merge 0 commit into
Conversation
|
Warning Review limit reached
More reviews will be available in 3 minutes and 53 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughCentralizes kubeconfig write and context-entry construction in KubeConfigUpdate: new saveConfigs/saveConfig persistence helpers and shared unique-name/context creation utilities. UpdateToken/UpdateClientCert now mutate users and set current context, and CreateContext/CreateContextWithClientCert reuse the base helpers. Tests add client-certificate creation and persistence assertions. ChangesKubeconfig context creation refactoring
🎯 4 (Complex) | ⏱️ ~45 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ 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. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #309 +/- ##
==========================================
+ Coverage 0.00% 23.10% +23.10%
==========================================
Files 4 99 +95
Lines 26 4176 +4150
Branches 0 770 +770
==========================================
+ Hits 0 965 +965
- Misses 26 3087 +3061
- Partials 0 124 +124 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
f49bf42 to
1c42bdb
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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
`@src/test/kotlin/com/redhat/devtools/gateway/kubeconfig/KubeConfigUpdateTest.kt`:
- Line 1013: The test helper setupUpdateExistingContextMocks currently stubs
KubeConfigUtils.getAllConfigFiles() to always return listOf(tempKubeConfigFile),
which hides multi-file behavior; update the helper so it derives the returned
list from the kubeconfig files passed into the helper (or add an explicit
parameter for the expected file list) and have
KubeConfigUtils.getAllConfigFiles() return that derived/explicit list instead of
the fixed tempKubeConfigFile, ensuring tests that use multiple distinct files
exercise the real path-selection and save-splitting logic.
🪄 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: Organization UI
Review profile: CHILL
Plan: Enterprise
Run ID: a0758978-6824-4911-b6b2-9228fdb618d2
📒 Files selected for processing (3)
src/main/kotlin/com/redhat/devtools/gateway/kubeconfig/KubeConfigEntries.ktsrc/main/kotlin/com/redhat/devtools/gateway/kubeconfig/KubeConfigUpdate.ktsrc/test/kotlin/com/redhat/devtools/gateway/kubeconfig/KubeConfigUpdateTest.kt
7f7542d to
c40fe65
Compare
c40fe65 to
9f7b425
Compare
No description provided.