Skip to content

fix(cmd): respect LifecycleSupportEndDate in extended-support check#1234

Open
cristim wants to merge 3 commits into
mainfrom
fix/cor-08-fix
Open

fix(cmd): respect LifecycleSupportEndDate in extended-support check#1234
cristim wants to merge 3 commits into
mainfrom
fix/cor-08-fix

Conversation

@cristim

@cristim cristim commented Jun 11, 2026

Copy link
Copy Markdown
Member

Problem

isInExtendedSupport (cmd/multi_service_engine_versions.go) parsed both LifecycleSupportStartDate and LifecycleSupportEndDate from the RDS DescribeDBMajorEngineVersions response, but only ever compared the start date. Any engine version whose extended-support window had already ended was still classified as in-extended-support, so adjustRecommendationForExcludedVersions kept decrementing rec.Count for 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 now is 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 constant rdstypes.LifecycleSupportNameOpenSourceRdsExtendedSupport per the project's typed-enum convention.

Test evidence

Added two table cases to TestIsInExtendedSupport:

  • "Extended support already ended" (start 3y ago, end 6mo ago, expect false): confirmed FAILING pre-fix (expected: false, actual: true) and passing post-fix.
  • "Zero end date treated as open-ended" (expect true): guards the open-ended semantics.

Verification: go build ./... clean; go test ./cmd/... 752 passed in 7 packages.

Closes #1182

@cristim cristim added triaged Item has been triaged priority/p3 Polish / idea / may never ship severity/low Minor harm urgency/eventually No deadline impact/few Limited audience effort/xs Trivial / one-liner type/bug Defect labels Jun 11, 2026
@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@cristim, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 28b1d134-dcb5-4503-9713-2f493ee2df86

📥 Commits

Reviewing files that changed from the base of the PR and between 451a70f and c238e9b.

📒 Files selected for processing (5)
  • cmd/multi_service_coverage_test.go
  • cmd/multi_service_engine_versions.go
  • cmd/multi_service_engine_versions_paginate_test.go
  • cmd/multi_service_engine_versions_test.go
  • cmd/multi_service_test.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/cor-08-fix

Comment @coderabbitai help to get the list of available commands.

@cristim

cristim commented Jun 11, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

cristim added 2 commits June 19, 2026 23:52
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.
@cristim

cristim commented Jun 19, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Rate Limit Exceeded

@cristim have exceeded the limit for the number of chat messages per hour. Please wait 0 minutes and 23 seconds before sending another message.

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/...`).
@cristim

cristim commented Jun 26, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Full review finished.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/xs Trivial / one-liner impact/few Limited audience priority/p3 Polish / idea / may never ship severity/low Minor harm triaged Item has been triaged type/bug Defect urgency/eventually No deadline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

COR-08: isInExtendedSupport never checks LifecycleSupportEndDate; past-end versions stay excluded from RI sizing

1 participant