Repository navigation
feat(purchase): refuse a recent duplicate ElastiCache reservation before submission - #1893
Conversation
…ore submission preSubmitChecks now runs the ElastiCache recent-reservation check for AWS cache recommendations, before the GCP check and before the dispatch time is stamped. The per-execution own-name sets are one pointer struct with nil-safe accessors, built once and passed through the fan-out, so the platform's own reservations (its siblings in the same execution and its lost-response retries) are adopted and never refused. The client and the recommendation both take their region from rec.Region. Tests that run AWS cache recommendations through the real executor now expect the reservation listing. Part of #1863 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 26 seconds. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
APPROVE @ 6019153 by claude-nibblets Cold review of #1893 (Part of #1863, S2: wires the ElastiCache recent-reservation check from #1890 into the executor; +207/-7, money path; 0 behind main). I looked for ways it could refuse a legitimate buy, miss a duplicate, or break a retry. Read: Scoped probes (go test -run ElastiCache|PreSubmit|OwnNames|Wiring|GCP|RecentCommitment|AzureRedis|CoverageExtra in internal/purchase, scratch worktree at this head, baseline ok), each killed: the check not called (TestElastiCacheWiring_RecentSamePoolReservationRefusesBeforePurchase, TestPreSubmitChecks_ElastiCacheRefusesBeforeDispatchTimeIsStamped); own names not wired, and the builder dropping the ElastiCache set (TestElastiCacheWiring_SiblingOwnReservationDoesNotRefuse); nil guard removed (TestPreSubmitChecks_NilOwnNamesDoesNotPanic, which also panics as expected); own ID never built (TestElastiCacheWiring_RetryWithForeignReservationIsAdopted). Non-blocking: any ElastiCache buy now needs a successful listing, so a transient throttle or an account whose role lacks the grant refuses the rec with the fixed "could not complete" note instead of buying; that is the intended fail-closed behaviour, and the note tells the operator to retry later or check the account. CI at this head: all 42 checks pass (Unit Tests, Lint Code, Integration Tests (api, purchase), CI Success and pre-commit); 1 skipping (CodeRabbit). |
Summary
preSubmitChecksruns the ElastiCache recent-reservation check (S1) for AWS cache recommendations, before the GCP check and before the dispatch time is stamped. A recent same-pool reservation, or a listing that cannot rule one out, refuses the rec before submission, so the row ends as a before-submission refusal.rec.Region.Verification
-race,internal/mocks, the purchase unit tests and golangci-lint pass locally on macOS; CI covers Linux and the integration suites.Part of #1863
🤖 Generated with Claude Code