Repository navigation
fix(providers): mark reported costs as known and stop inventing Azure inventory region and state - #713
Open
cristim wants to merge 10 commits into
Open
fix(providers): mark reported costs as known and stop inventing Azure inventory region and state#713cristim wants to merge 10 commits into
cristim wants to merge 10 commits into
Conversation
riToCommitment and spToCommitment compute Cost from provider data, so set CostKnown. A zero cost is now distinguishable from unknown. EC2 listing stays unknown, pinned by a test. Refs #74 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
convertSavingsPlan assigns Cost from Commitment.Amount, so set CostKnown in that branch. A reported 0 is now distinguishable from an absent amount. Refs #74 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The consumption ReservationDetail API reports neither, so the cache inventory converter left them to the client region and a hardcoded active. Leave them empty (unknown). Adds a shared RequireUnknownInventory test helper. Refs #74 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Same as the cache converter: ReservationDetail reports neither, so leave Region and State empty instead of the client region and active. Refs #74 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Same as the cache converter: leave Region and State empty because ReservationDetail does not report them. Refs #74 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
riHourlyCost skips upfront amortization without a Duration, so an RI with missing pricing data got a partial cost yet claimed CostKnown. Gate the marker on Duration > 0 and replace the misleading zero-cost test. Refs #74 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tory The helper uses assert, so it does not stop the test; name it accordingly. Refs #74 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drops the go.sum lines for the old pkg, aws-sdk-go-v2 and smithy-go versions that the rebased pin no longer needs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 26 minutes. View limit details
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #74. This is PR 2. PR 1 (#689) added
common.Commitment.CostKnowntopkg.What
providers/awsandproviders/azurenow pinpkgat 8d06fde (feat(common): add Commitment.CostKnown #689).pkg/provider.go.sum.riToCommitmentsetsCostKnownonly when the RI has a Duration. Without one,riHourlyCostcan't amortize the upfront part, and the listing maps missing price pointers to 0.spToCommitmentsetsCostKnown: true, because the SP amount comes straight from the API, and a real 0 counts as known.Commitment.Amount, including 0, is marked known. A nil amount stays unknown.Region: c.regionandState: Active. ConsumptionReservationDetailcarries neither field, so both are now""(unknown). managedredis already reads real data since fix(azure): dedupe Redis recommendations against held reservations #706.inventory.gocomment now says Cost is unknown andCostKnownstays false, so a zero must not be read as free.Behaviour notes
recfilter.isRecentActiveCommitmentexcludes them, before and after this change.State. The plan's change to silence it was dropped: fix(azure): dedupe Redis recommendations against held reservations #706's strict inventory path relies on""meaning an unknown provisioning state. feat(common): add Commitment.CostKnown #689's squash message, which says empty State is "counted without logging", is inaccurate. No recfilter change has landed.FixedPricecan't be told apart from a no-upfront RI.Commitmenthas no currency field, so non-USD amounts aren't flagged.Verification
AssertUnknownInventoryhelper, reused by the 5 converter tests, run for both eastus and westeurope client regions.CostKnownunconditionally fails the RI and savings plan tests.go test -p 2 -short ./...gives 15 ok;🤖 Generated with Claude Code