You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor(gcp): cloudsql, cloudstorage and memorystore clients are near-verbatim copies #95
extractGCPResourceType, extractGCPSavings, termYearsFromLabel, the SKU/tier matcher, extractPriceFromSKU, the savings-percentage helper, fill*Pricing, getOrCreateBillingService, realBillingService.ListSKUs and convertGCPRecommendation are byte-identical modulo the receiver type and one identifier across providers/gcp/services/{cloudsql,cloudstorage,memorystore}. Every defect found in one of them exists three times, and a fix landed in one package leaves the other two wrong. That drift has already happened: the payment-option default reported as audit finding A08b-013 survives identically in all three while the Azure siblings were fixed, because Azure lifted its shared helpers into providers/azure/internal/{pricing,recommendations}.
Location
providers/gcp/services/memorystore/client.go:428-500 at 3c0f8ac94048a2c36fce5ccddee54e6c4849a5cd
A maintainer fixes a pricing or term-parsing bug in cloudsql/client.go with a regression test in that package. The identical code in cloudstorage and memorystore keeps the bug, their tests stay green, and the next audit reports the same finding twice more. #15 already documents this for termYearsFromLabel alone, and LeanerCloud/cloud-commitments-cli#1035 item D5 documents it for the savings-percentage formula across providers.
Lift the shared helpers into one providers/gcp/internal/recommendations package and have the three clients import it, mirroring the Azure layout. Fold the termYearsFromLabel consolidation from #15 into the same move rather than doing it separately.
Found by the 2026-09-02 codebase audit, finding A08b-039, reported by one reviewer and independently confirmed by a second. Full report: docs/audits/codebase-audit-2026-09-02.md.
Checked against main: the calculate*SavingsPercentage and tier-matcher helpers are still triplicated across the cloudsql, cloudstorage and memorystore clients. Open PRs #433, #471 and #493 edit those client.go files, and a shared package with no callers yet would be dead code. Blocked on #433, #471 and #493.
Activity
cristim commentedon Oct 17, 2026
Checked against main: the calculate*SavingsPercentage and tier-matcher helpers are still triplicated across the cloudsql, cloudstorage and memorystore clients. Open PRs #433, #471 and #493 edit those client.go files, and a shared package with no callers yet would be dead code. Blocked on #433, #471 and #493.
refactor(gcp): share the savings, tier-matching and billing helpers (#…