feat: remove suspend state from release binding#2706
Conversation
Signed-off-by: Chalindu Kodikara <chalindumkodikara@gmail.com>
📝 WalkthroughFile Changes Breakdown3 files changed across 2 top-level directories:
Lines changed: -18 total
API/CRD Surface ChangesCompatibility Risk: Medium ReleaseState enum simplified from 3 to 2 valid values:
API Request Validation:
Test CoverageTest case removed:
Scope AssessmentProperly scoped - cleanup of unused enum value: Controller reconciliation logic verified:
Other files referencing ReleaseState do not require changes:
Risk Assessment
WalkthroughThe changes remove the "Suspend" release state option from the ReleaseState enum. The valid states are reduced from {Active, Suspend, Undeploy} to {Active, Undeploy}, with corresponding updates to validation logic and test expectations across the codebase. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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 the current code and only fix it if needed.
Inline comments:
In `@internal/openchoreo-api/models/request_test.go`:
- Around line 157-161: Add a dedicated table-driven test case asserting that the
removed "Suspend" value is rejected: in the tests slice in request_test.go (the
table that uses fields releaseState, wantErr, errMsg) add an entry with name
"Suspend invalid", releaseState: "Suspend", wantErr: true and errMsg matching
the existing message (e.g., "releaseState must be one of: Active, Undeploy");
ensure this new case is executed by the same Test... function that iterates the
tests slice so the regression is covered.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 3533f89d-b2e5-4e59-a688-5007b6bd48a2
📒 Files selected for processing (3)
api/v1alpha1/types.gointernal/openchoreo-api/models/request.gointernal/openchoreo-api/models/request_test.go
💤 Files with no reviewable changes (1)
- api/v1alpha1/types.go
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Purpose
$subject
Approach
Related Issues
#1458
Checklist
Remarks