Repository navigation
fix(aws): report EC2 reservation platform, tenancy and scope so dedupe can match them - #465
Conversation
|
Warning Review limit reached
This review includes 3 billable files and costs up to $0.75.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 59 minutes for your next included review. View limit details
Comment |
450ce4f to
ebf82c6
Compare
|
@coderabbitai review |
|
Independent adversarial review: CLEAN at
|
|
CI is green on head |
ebf82c6 to
cb58ee6
Compare
|
Rebased onto
Both commits are identical, so the CLEAN verdict for |
Bump pkg from v0.0.0-20261015085730-498b74f31f01 to v0.0.0-20261016194019-89772cf80f67 so the AWS module sees the Commitment Platform/Tenancy/Scope/AvailabilityZone fields and the recfilter matching on them. pkg commits in the range touching packages providers/aws imports: - 89772cf fix(recfilter): match EC2 commitments on platform, tenancy and scope - 9260573 feat(common): add EC2 platform, tenancy and scope dimensions - b69a17e fix(recfilter): treat a date-only commitment start as any time that day - 551be56 feat(exchange)!: pass the source RI's availability zone to LookupOffering - 25bffb5 fix(exchange): send the RI exchange accept once and halt on an unknown outcome 11200ee (reccontract) and the insurance commits are not imported by providers/aws. Build and race tests pass on the bumped pin. Refs #323 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e can match them GetExistingCommitments filled none of Commitment.Platform, Tenancy, Scope or AvailabilityZone, so the recfilter matching on those dimensions was inert. Pass the raw SDK ProductDescription, InstanceTenancy, Scope and AvailabilityZone values; pkg/common normalizes them, so there is no second mapping table. Account stays unset, as before. Tests cover the listing (regional Linux default, zonal Windows dedicated, nil fields) and the listing through DuplicateChecker with parser-shaped recommendations: a Windows RI no longer suppresses a Linux rec, a zonal RI does not suppress a regional rec, a regional RI suppresses a zonal rec and a matching Linux regional RI suppresses. Follow-ups outside this change: RDS size-flex, the ElastiCache empty-description wildcard, MemoryDB engine and account keying. Refs #323 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cb58ee6 to
efaaa72
Compare
|
Rebased again onto
Both commits are identical, so the CLEAN verdict for |
|
Merged by squash at reviewed head |
Summary
This is PR 2 of the first #323 slice, and it makes the EC2 dedupe fix live.
#458 added
Commitment.Platform/Tenancy/Scope/AvailabilityZoneand their normalizers. #460 made the recfilter duplicate check match AWS EC2 commitments on them: an empty value is a wildcard, scope coverage is asymmetric, and accounts are not keyed. The EC2 listing filled none of these fields, so the matching was inert. Two commits fix that.build(aws)bumps the awspkgpin fromv0.0.0-20261015085730-498b74f31f01tov0.0.0-20261016194019-89772cf80f67. Of the pkg commits in between, these touch packages providers/aws imports: 89772cf, 9260573, b69a17e (recfilter/common), and 551be56 and 25bffb5 (exchange). Nothing in providers/aws references the changedLookupOfferingFunc. The full aws build and race suite passed on the bumped pin before any code change.fix(aws)makesGetExistingCommitments(providers/aws/services/ec2/client.go) set the raw SDK values:ProductDescription,InstanceTenancy,Scope, and the AZ only when the SDK returns one. pkg normalizes them, so there is no second mapping table.Accountstays unset, as before.Effect: a recent Windows, dedicated or zonal reservation no longer suppresses a matching Linux, default-tenancy or regional EC2 recommendation, so that recommendation is no longer silently dropped. A regional reservation still covers zonal usage, and a commitment in another linked account still suppresses.
Follow-ups, still open on #323: RDS size-flexibility, the ElastiCache empty-description wildcard, the MemoryDB engine, and account keying. Account keying needs an RI-sharing signal; see the design note on the issue.
Refs #323 (this completes the EC2 part of the first slice; the issue stays open for the follow-ups below)
Verification (macOS, Go 1.26.9)
(cd providers/aws && GOWORK=off go test -race -short ./...)passes.make buildandmake vetpass. golangci-lint v2.10.1 (the CI pin) reports 0 issues.GOWORK=off go build ./...passes inproviders/awsandci_cd_sanity_tests.TestGetExistingCommitments_ReportsPlatformTenancyScopeuses an SDK-shapedDescribeReservedInstancesfake. It covers a regional Linux default RI, a zonal Windows dedicated RI, and an RI with nil fields. The nil case yields empty fields, which act as wildcards.TestListingFeedsDuplicateCheckerruns listed commitments throughrecfilter.NewDuplicateChecker(0), which uses the 24h default lookback, andAdjustRecommendationsForExisting. The recs are built in the shapeparseEC2Detailsproduces. It checks four cases:0b6cb12(azure-only) and re-tested.Fixtures only; no AWS call.
🤖 Generated with Claude Code