Repository navigation
fix(cmd): repair red main after #2238 and drop the RI hint on SP-only runs - #2243
Merged
Merged
Conversation
…eeds A run where only Savings Plans succeeded still printed "Allow up to 15 minutes for RIs to appear in your account". printFinalMessage now takes the RI success count and prints the hint only when an RI was bought. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rchase LeanerCloud#2238 made a real purchase run with any failure return errPurchasesFailed so the CLI exits non-zero; LeanerCloud#2230's TestCSVRealPurchase_FailedPurchaseCarriesError (merged alongside it) still required runCSVPurchases to return nil, so main fails. The shared env helper now requires the sentinel when the test expects a failed purchase. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Member
Independent review verdict: CLEAN at c36842aReviewer: fresh Claude agent (Sonnet, high effort), not the author, cold brief. The PR body was treated as a claim. Coordinator: claude-cc-reviewer. Blocking findings: none. Main is red: on 4ed7248, Commit 1 (test-only):
Commit 2:
What was attacked and how (
Gate:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2242. Follow-up to #2238 (issue #2157). There are two commits on main (4ed7248).
1. Fix red main (
test(csv))#2238 made a real run with any failed purchase return
errPurchasesFailed, so the CLI exits non-zero. #2230 merged at about the same time, and itsTestCSVRealPurchase_FailedPurchaseCarriesErrorstill didrequire.NoError(runCSVPurchases(...))while forcing a failed ElastiCache purchase. Sogo test ./cmd/fails on main.The shared
csvPurchaseEnvgets anexpectPurchaseFailureflag. When it's set,runrequireserrors.Is(err, errPurchasesFailed); otherwise it still requires no error. The failed-purchase test sets it. This is test-only, and the per-row report and audit assertions are unchanged.2. CodeRabbit finding on #2238 (
fix(cmd))This commit is 9c24083, cherry-picked unchanged. It was pushed to the #2238 branch after that PR merged.
printFinalMessage(isDryRun, riSuccess, success, failed)prints "Allow up to 15 minutes for RIs to appear" only when an RI purchase succeeded. The completion line still prints for any success.TestPrintMultiServiceSummary_RIHintOnlyAfterRISuccesscovers five cases:Before the fix, the two Savings Plan cases failed. Three mutation probes were all caught.
Verification
Tests ran on macOS with AWS config set to /dev/null, using mocks and the offline HTTP fake. Nothing called real AWS, and nothing ran with
--yes.go test ./cmd/ -count=1fails withTestCSVRealPurchase_FailedPurchaseCarriesError: "Received unexpected error".go test ./cmd/ -count=1passes.go build ./cmdpasses,go vet ./...is clean, and golangci-lint v2.10.1 reports 0 issues.Maintainer: please copy the labels from #2157.
🤖 Generated with Claude Code
Summary by CodeRabbit