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
Commit ee2b597
Browse filesBrowse the repository at this point in the historyBrowse files
chore(cli): delete the unused legacy processService purchase path (#2254)
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#2110Closes#2053
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
// processService processes a single service and returns recommendations and results.
964
-
// Used by legacy callers; new code should use fetchAllRecs + executePurchasePipeline.
965
-
funcprocessService(ctx context.Context, awsCfg aws.Config, recClient provider.RecommendationsClient, accountCache*AccountAliasCache, service common.ServiceType, isDryRunbool, cfgConfig, engineDataengineVersionData) ([]common.Recommendation, []common.PurchaseResult) { //nolint:unparam // engineData always nil at current callsites but param is part of the API
@@ -458,118 +451,6 @@ func requireRegionInventory(recs []common.Recommendation, cfg Config, data engin
458
451
returnfmt.Errorf("extended-support exclusion cannot be applied: RDS inventory unavailable in %s (re-run, or pass --include-extended-support to skip the check)", describeFailedRegions(affected))
459
452
}
460
453
461
-
// regionRecommendations holds the processed recommendations for a single region.
462
-
typeregionRecommendationsstruct {
463
-
recommendations []common.Recommendation
464
-
results []common.PurchaseResult
465
-
auditErrerror// errAuditTrailLost: stop buying
466
-
}
467
-
468
-
// processRegionRecommendations fetches and processes recommendations for a single region.
// --max-instances is a run-wide cap, and this legacy per-region entry point
528
-
// has no view of the other services and regions in the run, so it cannot
529
-
// evaluate the cap. Refuse to spend rather than purchase uncapped: an
530
-
// over-purchase of reserved capacity is not reversible. Dry runs continue
531
-
// so the recommendations are still reported.
532
-
//
533
-
// This is deliberately the first thing after the recommendations are
534
-
// recorded, ahead of building the service client and of the duplicate
535
-
// check. The decision depends only on cfg.MaxInstances and isDryRun, both
536
-
// already known, so reaching it through a cloud API call would be work
537
-
// done to arrive at an answer that was already determined -- and it would
538
-
// make the refusal path fail differently depending on whether the describe
539
-
// call happened to succeed.
540
-
ifcfg.MaxInstances>0&&!isDryRun {
541
-
log.Printf("❌ Refusing to purchase %s/%s: --max-instances is a run-wide cap and cannot be enforced on the per-region path. Use the multi-service pipeline (the default entry point).",
0 commit comments