Skip to content

fix(aws): aggregate RI coverage across time buckets - #167

Merged
cristim merged 1 commit into
mainfrom
fix/51-ri-coverage-buckets
Sep 30, 2026
Merged

cristim merged 1 commit into
mainfrom
fix/51-ri-coverage-buckets

Conversation

@cristim

@cristim cristim commented Sep 30, 2026

Copy link
Copy Markdown
Member

RI coverage previously retained only the last Cost Explorer time bucket while dividing its hours by the entire lookback window. A 40-instance pool split into 28-day and 2-day buckets became 2.67 instances/hour, and recommendation enrichment propagated that undercount.

Aggregate all buckets and pages within each service/engine/region fetch, then weight coverage percentages by running hours. Preserve RDS deployment separation and percentage-only fallback behavior. Refs #51; the appended Savings Plans contract finding is handled separately, so this PR does not close the issue.

Verification: real AWS SDK against a loopback HTTP fixture, including public recommendation enrichment, unequal/reversed buckets, RDS pool separation, repeated regions, missing-hour groups and late-page failures. The original production code fails the regression; the fix reports 40 instances/hour and 71.6667% weighted coverage. Recommendations and ladder race suites, AWS build/vet, pinned lint2.10.1 and normal pre-commit checks passed. No live AWS calls or purchases.

Independent gpt-6-astra review approved exact commit 7ce5060d50c59376d756f0c4aeafacbf9d01c7fd: full diff reread and matching clean checkout, fresh focused recommendations/ladder race tests, and public SDK consumer result of 40 instances/hour at 71.6667% coverage. The reviewer independently reproduced the original failure before verifying the fix. This is the user-authorized independent review path; CodeRabbit is optional.

Sum running-hour averages across every page within each coverage scope
and weight percentages by those hours before enriching recommendations.

Verify unequal and reversed buckets through the real SDK on loopback,
including recommendation sizing, RDS separation, and late-page errors.

Refs #51
@cristim cristim added triaged Item has been triaged urgency/this-sprint Within the current sprint priority/p1 Next up; this sprint severity/high Significant harm impact/many Affects most users effort/m Days type/bug Defect labels Sep 30, 2026
@coderabbitai

coderabbitai Bot commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

  • Run on-demand review

This review includes 2 billable files and costs up to $0.50.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 50 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 70 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository: LeanerCloud/cloud-commitments-go/.coderabbit.yaml

Review profile: CHILL

Plan: Essentials

Run ID: 14a05baf-7a2d-4c9c-9c3d-fe8b7b14a6a9

📥 Commits

Reviewing files that changed from the base of the PR and between 5fb4663 and 7ce5060.

📒 Files selected for processing (2)
  • providers/aws/recommendations/coverage.go
  • providers/aws/recommendations/coverage_aggregation_test.go

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

@cristim
cristim merged commit 6ce98fb into main Sep 30, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/m Days impact/many Affects most users priority/p1 Next up; this sprint severity/high Significant harm triaged Item has been triaged type/bug Defect urgency/this-sprint Within the current sprint

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant