Repository navigation
Conversation
…atches Cloud Storage's skuMatchesStorageClass still treated a nil ServiceRegions as "every region" while an empty slice matched none. It now uses the shared skumatch.InRegion rule: named regions match only themselves, and a SKU with no regions matches only when GeoTaxonomy.Type is GLOBAL. The Cloud SQL, Memorystore and Cloud Storage extractors kept whichever matching SKU came last for each price slot, so catalog order decided the price. They now collect through skumatch.SlotPrices, which accepts agreeing duplicates and returns an "ambiguous catalog" error when two matching SKUs feed the same slot at different prices, the same rule computeengine's rateSlot already applies. Closes LeanerCloud#97 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reached
This review includes 10 billable files and costs up to $2.50. Or wait 59 minutes for your next included review. View limit details
Comment |
Independent review verdict: CLEAN at c99bd7fReviewer: fresh Claude agent (Sonnet, high effort), not the author, cold brief. The PR body was treated as a claim. Coordinator: claude-cc-reviewer. Blocking findings: none. Matching rules:
Scope of the error:
Caveat (non-blocking, disclosed as #254): the extractors don't filter by term. Where a catalog has both 1yr and 3yr SKUs for one tier, commitment pricing for that tier now errors (fail-closed) instead of taking the last price seen. On live data that could drop commitment pricing for some Cloud Storage tiers until #254 lands. What was attacked and how (providers/gcp,
Gate:
|
Independent adversarial review: CLEAN at
|
|
Merge driver status: blocked on an owner decision. The independent review is CLEAN at |
What
Finishes #97. #244 (merged,
Refs #97) moved Cloud SQL, Memorystore and Compute Engine onto the sharedskumatch.InRegion/skumatch.HasTokenrules. It deliberately left two pieces open:skuMatchesStorageClassstill returnedtruefor a nilServiceRegions(prices every region) while an empty non-nil slice matched none. It now callsskumatch.InRegion, the same rule as the other services.extractSQLPricingFromSKUs, memorystoreextractPricingFromSKUsandextractStoragePricingFromSKUsassignedonDemand = price/commitment = priceon every match, so whichever matching SKU came last in the catalog set the price thatCommitmentPrice,OnDemandPriceandSavingsPercentageare computed from. They now collect through a newskumatch.SlotPrices. Agreeing duplicates are accepted. Two matching SKUs that feed the same slot at different prices return anambiguous catalog: ...error, and the caller gets no pricing. This is the rulecomputeengine'srateSlot.setalready applies.Matching rules after this PR
ServiceRegionslists the region (case-insensitive)ServiceRegionslists other regions onlyServiceRegionsnil, no / non-GLOBALGeoTaxonomyServiceRegionsempty[], no / non-GLOBALGeoTaxonomyServiceRegionsnil or empty,GeoTaxonomy.Type == "GLOBAL"STANDARDvsStandard-HA Storage ...,REGIONALvsMulti-Regional Storage ..."<class> storage ")ambiguous catalog: <slot> SKU <id> ... but matching SKU <id> prices ...Commit1YrandCommit3Yrat different pricesTier and machine-type tokens were already made whole-token by #244 (
HasToken). This PR adds extractor-level tests showing that adb-n1-standard-16/STANDARD_HAdecoy SKU no longer affects thedb-n1-standard-1/STANDARDprice in either order.Behaviour change
GLOBALtaxonomy no longer prices the requested region.Verification (local, macOS, fixtures only, no GCP calls)
client.gofiles reverted toorigin/mainand the new tests kept, 3 subtests fail in cloudsql, 3 in memorystore and 6 in cloudstorage (nil-region match, ambiguous on-demand in both orders, 1Yr/3Yr conflict, GLOBAL empty slice). All pass with the fix.SlotCommitmenttoSlotNone: 4 packages fail.len(ServiceRegions)==0 ||short-circuit: cloudstorage fails.return true: cloudstorage fails.providers/gcp:go build ./...,go vet ./...,go test ./...,GOWORK=off go test -race -short ./...all pass.golangci-lintv2.10.1run --allow-parallel-runners ./...reports 0 issues.gocyclo -over 10on every changed non-test.gofile reports nothing. git-secrets (--register-aws, isolated HOME, fresh repo) is clean on all changed files. Tests ran withAWS_CONFIG_FILE=/dev/null AWS_SHARED_CREDENTIALS_FILE=/dev/null.Out of scope / overlap
pricing.goc2 / c4d): untouched. Compute Engine already usesInRegionand fails closed on conflicting rates.extract*PriceFromSKUand appends toskumatch.go. It does not overlap: the new type lives inskumatch/slotprices.go.currency = "USD"inextractStoragePricingFromSKUs. This PR adds avar pricesline directly above it, so whichever lands second gets a trivial one-line textual conflict.Labels
Please mirror the issue's labels:
priority/p2,severity/medium,urgency/this-quarter,impact/few,effort/s,type/bug,triaged.Closes #97
🤖 Generated with Claude Code