fix(cmd): respect LifecycleSupportEndDate in extended-support check#1234
fix(cmd): respect LifecycleSupportEndDate in extended-support check#1234cristim wants to merge 3 commits into
Conversation
|
Warning Review limit reached
More reviews will be available in 25 minutes. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?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 credits. 🚦 How do rate 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 see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
isInExtendedSupport parsed both lifecycle dates but only compared the start date, so engine versions past the official end of extended support stayed classified as in-extended-support and remained excluded from RI count sizing, causing systematic under-purchase for those instance types. Now a version counts as in extended support only when the current time is on or after the start date and before the end date; a zero end date is treated as open-ended. Also replaces the bare lifecycle-name string literal with the SDK enum constant. Adds regression test cases for a past end date (failing before this fix) and for the open-ended zero end date. Closes #1182
Replace bare string literals with typed rdstypes.LifecycleSupportNameOpenSourceRdsExtendedSupport and rdstypes.LifecycleSupportNameOpenSourceRdsStandardSupport constants so test data cannot drift from the SDK enum values.
|
@coderabbitai review |
Rate Limit Exceeded
|
The previous commit migrated multi_service_engine_versions_test.go to use rdstypes.LifecycleSupportNameOpenSourceRdsExtendedSupport instead of the bare "open-source-rds-extended-support" string literal. Three sibling test files in cmd/ still hard-coded the same strings, so a future SDK enum rename would have left them out of sync. Migrate all remaining occurrences in: - cmd/multi_service_coverage_test.go (3 sites) - cmd/multi_service_test.go (3 sites) - cmd/multi_service_engine_versions_paginate_test.go (1 site, typed directly because the SDK struct exposes the enum type, not string) No production behaviour changes; tests still pass (`go test ./cmd/...`).
|
@coderabbitai full review |
✅ Action performedFull review finished. |
Problem
isInExtendedSupport(cmd/multi_service_engine_versions.go) parsed bothLifecycleSupportStartDateandLifecycleSupportEndDatefrom the RDSDescribeDBMajorEngineVersionsresponse, but only ever compared the start date. Any engine version whose extended-support window had already ended was still classified as in-extended-support, soadjustRecommendationForExcludedVersionskept decrementingrec.Countfor those instances, systematically under-sizing RI purchases for the affected instance types. (COR-08 from docs/reviews/codebase-review-2026-06-10.md)Fix
A version is now in extended support only when
nowis on or after the lifecycle start date AND before the end date; a zero end date is treated as open-ended (field absent in the API response). The bare"open-source-rds-extended-support"string literal is also replaced with the SDK enum constantrdstypes.LifecycleSupportNameOpenSourceRdsExtendedSupportper the project's typed-enum convention.Test evidence
Added two table cases to
TestIsInExtendedSupport:false): confirmed FAILING pre-fix (expected: false, actual: true) and passing post-fix.true): guards the open-ended semantics.Verification:
go build ./...clean;go test ./cmd/...752 passed in 7 packages.Closes #1182