-
Notifications
You must be signed in to change notification settings - Fork 610
enhance: Update PR comment's cost change summary #3099
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
3fcd4aa
to
c53709e
Compare
Keeping .Root.CloudURL as it's used for Bitbucket as it doesn't support collapsed sections.
c53709e
to
1c7c864
Compare
internal/output/diff.go
Outdated
@@ -188,11 +188,18 @@ func tableForDiff(out Root, opts Options) string { | |||
continue | |||
} | |||
|
|||
var usageCost string | |||
if out.Metadata.UsageApiEnabled { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm worried that this condition is not sufficient because usage costs can also come from the usage file. Essentially, we only want to show the "-" when usageCostsMessage
is the "Usage costs CAN be estimated..." one. It looks like that works out to showing - when !out.Metadata.UsageApiEnabled && out.Metadata.UsageFilePath == "" && !out.Metadata.ConfigFileHasUsageFile
as a sanity check in the API comment I also checked to make sure that both usage costs were zero or not present (I was worried about putting in a "-" and then having the total change not equal baseline change.
1c7c864
to
dc5f235
Compare
cmd/infracost/testdata/diff_terraform_plan_json/diff_terraform_plan_json.golden
Outdated
Show resolved
Hide resolved
dc5f235
to
bf4f8c3
Compare
formatMarkdownCostChange(out.Currency, project.PastBreakdown.TotalMonthlyUsageCost, project.Breakdown.TotalMonthlyUsageCost, false, true), | ||
formatMarkdownCostChange(out.Currency, project.PastBreakdown.TotalMonthlyCost, project.Breakdown.TotalMonthlyCost, false, false), | ||
formatMarkdownCostChange(out.Currency, project.PastBreakdown.TotalMonthlyBaselineCost(), project.Breakdown.TotalMonthlyBaselineCost(), false, true, false), | ||
formatMarkdownCostChange(out.Currency, project.PastBreakdown.TotalMonthlyUsageCost, project.Breakdown.TotalMonthlyUsageCost, false, true, !usageCostsEnabled(out)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tim775 This should also be inverted: when usage costs are disabled, skipIfZero
is true, so we'll show dashes for zeros.
ce23a01
to
df35f67
Compare
df35f67
to
e5464b8
Compare
No description provided.