Repository navigation
fix(cli): use purchaseSucceeded in the interrupt summary and run stats - #2253
Merged
Merged
Conversation
A result with Success=true and a non-nil Error is a failure. Route the Ctrl-C summary, the audit-stop message, the per-service counts and the non-zero exit check through purchaseSucceeded so they agree with the audit status. The CSV Success column stays the raw provider flag and is documented as such; the Error column carries the error. Closes #2205 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Member
Author
Independent review verdict: CLEAN at 441761fReviewer: fresh Claude agent (Sonnet 5.5, high effort), not the author, briefed cold. PR body and issue treated as claims. Coordinator: claude-cc-reviewer. Blocking findings: none. Every success/failure decision in
How each result shape is now counted:
Interrupt path: Local verification (unit and mock-based):
Non-blocking notes (both predate this PR):
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 #2205
Summary
#2204 added
purchaseSucceeded(result)(Success && Error == nil) and used it for the audit status and the purchase diagnostics. Some summary sites still read the rawresult.Success. For a provider result of{Success: true, Error: non-nil}, those sites disagreed with the audit record for the same purchase. They now go throughpurchaseSucceeded:cmd/interrupt.goprintInterruptedSummary: the Ctrl-C summary now lists the result under "verify in AWS before re-running".cmd/interrupt.goauditStopMessage: the message now reads "(errored: ...)" instead of "(commitment )".cmd/multi_service_stats.gocalculateServiceStats: the result now counts as failed, and the totals inherit that.cmd/multi_service_stats.gopurchaseFailureError(the exit-code check from fix(cmd): exit non-zero and count Savings Plan failures after a purchase run #2238/fix(cmd): repair red main after #2238 and drop the RI hint on SP-only runs #2243): the run now exits non-zero for such a result, using the same predicate as the printed summary.The CSV
Successcolumn keeps the raw provider flag, as the issue allows.docs/cli/README.mdnow says to read theErrorcolumn, and that an errored row counts as failed in the summary and the exit code.cmd/multi_service_csv.gois unchanged; the open #2247 and #2250 touch it.CHANGELOG.mdhas a Fixed entry.Evidence (local, macOS,
GOTOOLCHAIN=go1.26.9, unit tests)cmd/purchase_succeeded_summaries_2205_test.gocovers the interrupt summary, the audit-stop message, the stats and the exit-code check, plus ordinary success,Success=falseand a separate Go error. With the two source files stashed, all four test functions fail. With the fix, they pass.calculateServiceStats,purchaseFailureErrororinterrupt.go:43to.Successeach fails a test.make build: passes.go vet ./...: passes.go test -race ./cmd/...: passes.scripts/test-git-secrets-allowlist.sh: 44/44..Successreads remain;🤖 Generated with Claude Code
Summary by CodeRabbit
Successcolumn shows the provider’s raw result. Check theErrorcolumn for error details; results with errors count as failures in the run summary.