feat: add vsphere-component annotation to CredentialsRequest CR (story #39)#4
feat: add vsphere-component annotation to CredentialsRequest CR (story #39)#4splatypus-bot wants to merge 2 commits into
Conversation
Add cloudcredential.openshift.io/vsphere-component: machineAPI annotation to the openshift-machine-api-vsphere CredentialsRequest so CCO can route per-component credentials in PerComponent mode (story openshift#39). Add manifest annotation unit tests (test/manifest/). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, 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 have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR adds a metadata annotation to the vSphere CredentialsRequest manifest and validates it with three test cases covering annotation presence, value correctness, and absence on non-vSphere credential requests. ChangesvSphere CredentialsRequest Annotation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Poem
🚥 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. ✨ 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 |
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 `@test/manifest/credentials_request_annotation_test.go`:
- Around line 82-85: The test currently masks missing expected
CredentialsRequests by continuing when findCR(crs, name) returns ok==false;
instead fail fast: replace the continue with a test failure (e.g., call t.Fatalf
or t.Fatalf-like helper) that reports the missing CredentialsRequest name so the
test fails if a non-vSphere CR was deleted/renamed; update the block around cr,
ok := findCR(crs, name) to assert ok and include the variable name in the error
message.
🪄 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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: be7a5955-8767-4b43-9292-4f7a92887b27
📒 Files selected for processing (2)
install/0000_30_machine-api-operator_00_credentials-request.yamltest/manifest/credentials_request_annotation_test.go
…missing Replacing 'continue' with t.Fatalf ensures the test fails immediately if an expected non-vSphere CR (aws, azure, gcp, openstack) is absent from the manifest. Using 'continue' silently hid regressions where a renamed or deleted CR would cause the annotation check to be skipped entirely. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
💻 dev — 2026-05-11T14:30:22ZFixed the CodeRabbit finding (commit 0bf1b1f): Fixed:
|
💻 dev — 2026-05-11T14:51:33ZAgentic Review Summary — CodeRabbit Feedback Pass (0bf1b1f)Change reviewed: Assumptions surfaced:
Adversarial cases verified:
Delete Test result: ✓ Deleting this test would allow non-vSphere CRs to carry the vsphere-component annotation without detection Risk surface gaps: None — this is a pure test quality improvement with no production code impact Verdict: APPROVE — the continue→Fatalf change correctly closes a false-positive gap in the test suite |
💻 dev — 2026-05-12T19:34:12Z✅ All PR feedback addressedVerified that all review feedback has been resolved: CodeRabbit inline comment (2026-05-09T02:34:34Z):
Resolution verified in agentic review (2026-05-11T14:51:33Z):
No further action required. Story openshift#39 closed. |
Summary
cloudcredential.openshift.io/vsphere-component: machineAPIannotation to theopenshift-machine-api-vsphereCredentialsRequest CRtest/manifest/Test plan
All 3 tests pass:
TestMAOVSphereCredentialsRequestAnnotation✅TestNonVSphereCredentialsRequestsUnmodified✅TestAnnotationValueIsNotEmpty✅References
🤖 Generated with Claude Code
Summary by CodeRabbit
Tests
Chores