Repository navigation
fix(gcp/cloudstorage): apply the currency unification to the Cloud Storage extractor - #424
Conversation
…of seeding USD Cloud Storage pricing seeded currency to USD and let each later priced SKU overwrite it, so a catalog result with mixed or missing currencies reported a currency that did not match the prices it summed. The currency now comes from the priced SKUs via billingcurrency.Unify, as Cloud SQL and Memorystore do since LeanerCloud#239, and a missing or conflicting one is an error. Closes LeanerCloud#243 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. Or wait 42 minutes for your next included review. View limit details
Comment |
|
Independent review verdict: CLEAN at
Remaining merge gates: CI has not run (the fork workflows are awaiting maintainer approval). The PR is a draft. Labels still need mirroring from #243. CR has not reviewed this head because the PR is a draft. |
|
@IAmJSD The independent review is CLEAN at |
|
Done: I merged 🤖 Generated with Claude Code |
|
@IAmJSD Thanks for the update. CI is green, the diff is identical to the reviewed one, and the local checks pass. While CI was running, |
|
@IAmJSD Still fully gated here: CLEAN verdict, CI green, diff identical to the reviewed one. The only blocker is that main has moved since your last update, so the PR shows BEHIND. Could you merge |
|
Merged |
|
Merge gate record at
Squash-merging with |
Root cause
extractStoragePricingFromSKUs(providers/gcp/services/cloudstorage/client.go) seededcurrency = "USD"and then overwrote it with the currency of whichever priced SKU came last. A catalog result with mixed currencies, or SKUs with no currency code, therefore reported a currency that did not match the prices it summed. This is the Cloud Storage slice of #102 that #239 left out because #205 (now merged) touched the same file.Fix
Mirrors #239 exactly for Cloud Storage: the USD seed is removed and each priced SKU's currency is folded in with
billingcurrency.Unify(currency, curr, sku.SkuId), returning its error. A missing or conflicting currency now fails pricing instead of mislabelling it. No hardcoded"USD"remains inclient.go.The regression test
providers/gcp/services/cloudstorage/pricing_currency_test.gouses the same table ascloudsql/pricing_currency_test.goand goes throughgetStoragePricingwith a mocked billing service: consistent EUR, consistent USD, mixed USD/EUR, and a missing commitment or on-demand currency.Closes #243
Verification
All of this ran locally on macOS against mocked Cloud Billing Catalog responses. No real GCP APIs were called.
Fail before the fix (test added,
client.gounchanged):Pass after the fix:
AWS_CONFIG_FILE=/dev/null AWS_SHARED_CREDENTIALS_FILE=/dev/nullwas set because of an invalid default AWS profile on the author's machine. It has no effect on this GCP-only change.Gap: this was not checked against a live Cloud Billing Catalog response in a non-USD billing account.
Out of scope: #412 added
CommitmentCurrencyfor Cloud SQL, Memorystore and Compute Engine. Cloud Storage does not produce recommendations (GetRecommendationsis not supported), so that part was not applied here.Labels
The author lacks label permissions. Could a maintainer please mirror the issue's triage labels onto this PR:
priority/p2,severity/medium,urgency/this-sprint,impact/few,effort/xs,type/bug,triaged.🤖 Generated with Claude Code