fix(gcp): reject CPU and memory amounts that target different resources - #256
Merged
Merged
Conversation
The converter paired the VCPU and MEMORY amounts without checking that their operations name the same resource, so a payload with amounts for two commitments became one recommendation. Fail the conversion as a structural error instead; same-resource payloads are unchanged. Closes #165
Contributor
|
Warning Review limit reached
This review includes 2 billable files and costs up to $0.50.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 43 minutes for your next included review. View limit detailsLimit details: You’ve used the included review currently available. Your 63 included PR review attempts over the past 7 days set your current allowance at 1 review per hour. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (2)
Comment |
… path Pin that an empty memory resource next to a populated VCPU resource is rejected, that two empty resources are still accepted, and that GetRecommendations surfaces the cross-resource error.
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 #165
The Compute Engine converter picked the VCPU and MEMORY amounts independently, so a payload whose two operations name different commitment resources became one recommendation with mismatched amounts. It now returns a structural error (not errBadAmount, so it fails the batch like other structural payload problems). Same-resource payloads are unchanged. Covers operations in one group and across groups.
Tests: TestConvertGCPRecommendationRejectsCrossResourceAmounts fails on main (no error returned) and passes here.
🤖 Generated with Claude Code