Skip to content

feat: match dashboard cost formatting and guardrail messages - #4

Merged
liamcervante merged 2 commits into
mainfrom
feat/cost-formatting-and-guardrail-messages
Apr 7, 2026
Merged

feat: match dashboard cost formatting and guardrail messages#4
liamcervante merged 2 commits into
mainfrom
feat/cost-formatting-and-guardrail-messages

Conversation

@liamcervante

Copy link
Copy Markdown
Collaborator

Summary

  • Updates formatCost to match the dashboard's autoDecimals behavior: costs >= $1 are rounded to whole numbers, costs < $1 show 2 decimal places
  • Updates formatCostChangeSentence to use formatCost instead of hardcoded StringFixed(2)
  • Rewrites formatGuardrailMessage to match the dashboard's buildTriggerReason — includes scope-based prefix, threshold explanations, total threshold, and user-configured message

Before merging

This PR depends on infracost/go-proto#27 and currently points at a specific commit. Before merging:

  1. Merge feat: include guardrail config in evaluation results go-proto#27
  2. Create a new go-proto tag
  3. Update go.mod here to point at the new tag instead of the commit hash

Update formatCost to use the dashboard's autoDecimals behavior: values
>= $1 are rounded to whole numbers, values < $1 show 2 decimal places.

Rewrite formatGuardrailMessage to match the dashboard's
buildTriggerReason, including scope, threshold explanations, and user
message. This requires the new config fields added to GuardrailResult
in go-proto.
@liamcervante
liamcervante requested a review from a team April 1, 2026 10:14
@liamcervante
liamcervante merged commit 39f1ad1 into main Apr 7, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants