Repository navigation
chore(cli): delete the unused legacy processService purchase path - #2254
Conversation
processService and processRegionRecommendations (plus the regionRecommendations type) had no production caller; only tests drove them. Since #2105 moved confirmation to confirmPurchaseRun they would purchase without confirmation if anything called them again. Delete them and the tests that only exercised them. Also drop the test-only applyCommonCoverage wrapper (its assertions now call ApplyCoverage directly) and the never-read Config.Providers field. The override-count assertion moves to a test of applyCoverageAndOverrides, which the live pipeline shares. processPurchaseLoop stays: the live pipeline and --input-csv use it. Closes #2110 Closes #2053 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reached
This review includes 6 billable files and costs up to $1.50.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 50 minutes for your next included review. View limit details
Comment |
Independent review verdict: CLEAN at 58c16b3The reviewer was a fresh Claude agent (Sonnet 5.5, high effort), not the author, with a cold brief. The PR body and issues were treated as claims. Coordinator: claude-cc-reviewer. Blocking findings: none. The deleted code was dead:
No safety check is lost from the live path:
Other edits:
Local verification (tests only, no cloud calls):
Gate:
|
Closes #2110
Closes #2053
Summary
This PR deletes the legacy per-region purchase path. Only tests called it. It also carried its own purchase logic, so if anything called it again, it would buy without the up-front
confirmPurchaseRunconfirmation (#2110).Removed:
processService(cmd/multi_service.go).processRegionRecommendationsand theregionRecommendationstype (cmd/multi_service_helpers.go). This includes its per-region--max-instancesrefusal, which only made sense on that path.applyCommonCoveragewrapper and the unreadConfig.Providersfield (chore(cli): unread Config.Providers field and the test-only legacy processService path #2053). The field had no flag, no setter and no reader.Kept:
processPurchaseLoop, which the live pipeline uses (cmd/multi_service.go:873).Two pieces of coverage moved instead of disappearing:
TestProcessService_WithOverrideCountwas the only test of the override branch inapplyCoverageAndOverrides. It is replaced byTestApplyCoverageAndOverrides_OverrideCount, so the function is back to 100%.TestApplyCommonCoveragenow callsApplyCoveragedirectly, renamedTestApplyCoverage_FloorsPerRecommendationCounts.Evidence (local, macOS,
GOTOOLCHAIN=go1.26.9)git grepfinds no reference anywhere in the repo to any deleted identifier:processService,processRegionRecommendations,regionRecommendations,applyCommonCoverage,.Providers/Providers:.cmd/has no build tags.cmdcoverage went from 82.94% to 82.96%. The shared code the deleted tests touched is still at 100%:processPurchaseLoop,checkDuplicates,adjustRecsForDuplicatesandpopulateRecommendationAccountNames. The--max-instanceslive path keeps its own test files.make buildandgo vet ./...pass.go test -race ./cmd/passes 1581 tests.scripts/test-git-secrets-allowlist.shpasses 44/44.🤖 Generated with Claude Code