Repository navigation
fix(purchase): suppress every variant when a legacy EC2 recommendation has no details - #1411
Conversation
…n has no details A failed execution saved before Details existed (#453) is retried from its persisted recs without re-matching. BuildSuppressions read the empty Details as the known variant {az, "", ""}, so the actually-bought platform/tenancy stayed unsuppressed. Treat an EC2 rec with no platform or tenancy as an unknown variant, which writes the existing NULL-variant wildcard row and over-suppresses rather than risk a double buy. Part of #1232 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
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 25 minutes for your next included review. View limit details
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Build and verify wildcard suppressions internal/config/suppressions_build.go, internal/config/suppressions_build_test.go, internal/scheduler/suppression_variant_integration_test.go |
suppressionBucketOf marks EC2 records with empty platform and tenancy as variant-unknown. Unit tests cover missing and uninformative Details, as well as variant-scoped records. The Postgres integration test verifies that a legacy suppression removes the matching recommendation from the listing. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Low
Suggested labels: type/bug, priority/p2, severity/low, impact/few, urgency/this-quarter, effort/xs, triaged
Suggested reviewers: iamjsd
Merge Risk: 
Minimal · up to bd044
-
The legacy retry path has no identified issue blocking merge.
Pre-merge checks: 
5
Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
|
VERDICT: APPROVE bd044dd PR #1411 (Part of #1232 item 2), 1 commit, 3 files, +64/-1. Fix is the one #1232 itself proposes ("treat empty EC2 Details as unknown, which means suppressing every variant"). Findings (none blocking):
Attacked:
|
AWS recs can carry the canonical "compute" service slug as well as "ec2". The legacy wildcard (no platform/tenancy) only matched "ec2", so compute-slug recs kept a narrow empty variant and could be double-bought (#1232). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Independent review 2 (claude-fleet, cold): APPROVE bd044dd Findings (none blocking):
Attacked:
Verified locally, with GOTOOLCHAIN=go1.26.10 and no cloud credentials, under the heavy lock:
Reviewed by an independent agent with no author context (second reviewer). Review only: nothing was pushed, and the GitHub review state is unchanged. |
|
VERDICT: APPROVE b16fbbf PR #1411, delta bd044dd..b16fbbf reviewed together with the full PR diff (2ded648..b16fbbf: suppressions_build.go, suppressions_build_test.go, scheduler/suppression_variant_integration_test.go). Findings
No blocking findings. What I attacked and how
Mutation probes (scratch copy, reverted after each, diff confirmed identical)
Test evidence (macOS, scratch extract of b16fbbf, GOWORK=off)
|
|
Independent review 2 (claude-fleet, cold), re-review: APPROVE b16fbbf This is a delta from my APPROVE at bd044dd, which covers one commit, b16fbbf (+33/-3). The change: internal/config/suppressions_build.go:46-48 now treats a rec as AWS EC2 when
Probes on a scratch copy, each restored and confirmed identical with
Follow-up (non-blocking): no test pins the new provider condition.
Unchanged: the separate, older gap remains. The suppression 6-tuple keys on service, so a "compute" suppression still does not match an "ec2"-spelled rec, or the reverse. This PR does not change that. Verified locally on a
Same reviewer as the earlier review, re-reviewing the new head. Review only: nothing was pushed, and the GitHub review state is unchanged. |
|
Local verification at
|
Part of #1232 (item 2). Item 1 is handled separately in #1237, so this PR intentionally does not close the issue.
Problem: a failed EC2 execution saved before recommendation Details existed (#453) is retried from its persisted recs without re-matching.
suppressionBucketOf(internal/config/suppressions_build.go) read such a rec, with empty Details, as the known variant{az, "", ""}, so the suppression it wrote didn't cover the variant actually bought (e.g. Linux/UNIX). A later recommendation for that variant could then be bought again.Change: an AWS EC2 rec (service
ec2or the canonicalcomputeslug) whose Details carry no platform or tenancy (nil, empty,nullor{}) is markedunknownVariant. It writes a NULL-variant suppression, whichAppliesToalready treats as a wildcard over the 6-tuple (the same fallback used for unreadable Details since #1110). It over-suppresses (under-buys) rather than risking a double buy, and adds no store lookup to the purchase path. Non-EC2 recs and EC2 recs with platform or tenancy are unchanged. The wildcard also drops the known AZ, so legacy recs for different AZs of one configuration share a bucket and their counts add up; that errs toward under-buying too.Tests:
TestBuildSuppressions_LegacyEC2WithoutDetailsIsWildcardcovers the four empty forms plus a fully detailed rec staying unchanged.TestLegacyEC2RetrySuppressesBoughtVariant_RealPostgreswrites a legacy suppression and checks the later Linux/UNIX recommendation is filtered out.TestBuildSuppressions_ComputeSlugEC2covers thecomputeslug with empty Details (wildcard) and platform-only or tenancy-only Details (narrow variant kept).computeslug, or requiring only one of platform/tenancy to be empty, fails the new test.Local:
go build ./...passes, and-racepasses on config, purchase and api.-tags integrationpasses on scheduler and config.golangci-lintreports 0 issues,go vet -tags integration ./...is clean, and pre-commit passes.🤖 Generated with Claude Code
Summary by CodeRabbit