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
fix(tools): audit failed upfront dry runs and missing-figure refusals in the RI purchase tools #129
When a partial- or all-upfront dry run cannot price the offering, the purchase tool returns the error before ExecutePurchase. Only ExecutePurchase writes the preview audit record, so the failed preview leaves no audit entry. The same early return skips the audit when a confirmed upfront purchase is refused for missing approved figures (applyApprovedFigures). The EC2 tool has had this gap since #123, and #127 extends the pattern to RDS, OpenSearch, Redshift and MemoryDB. Raised by CodeRabbit on #127 (tools/aws_rds_ri.go:121).
Fix
Record both early returns through the existing refusal/audit helpers (recordPurchaseRefusal, tools/purchase.go) in all five tools, with a test per tool asserting the audit record.
The remaining items (test renames, partial-upfront boundary cases, the schema-enum pin and the README tolerance wording) go in a follow-up PR, which closes this issue.
Activity
cristim commentedon Nov 4, 2026
Scope note. The two halves are handled differently.
error,dry_run: true). The README promises a record for every attempt, previews included.approved_upfront/approved_currency: intentionally unchanged. The README audit section defines a missing figure as an argument-validation error that writes no record, the same as every other argument error. That rule came in with fix(tools): pass the approved upfront on RDS, OpenSearch, Redshift and MemoryDB purchases #127, and fix(tools): audit an upfront dry run that cannot produce a quote #133 has a test pinning it. Auditing it would contradict that rule, so changing it is an owner call, not part of this fix.The remaining items (test renames, partial-upfront boundary cases, the schema-enum pin and the README tolerance wording) go in a follow-up PR, which closes this issue.
fix(tools): audit an upfront dry run that cannot produce a quote (#133)