diff --git a/internal/backend/remote/backend_common.go b/internal/backend/remote/backend_common.go index 07437f3a3..dc102f594 100644 --- a/internal/backend/remote/backend_common.go +++ b/internal/backend/remote/backend_common.go @@ -299,7 +299,7 @@ func (b *Remote) costEstimate(stopCtx, cancelCtx context.Context, op *backend.Op deltaRepr := strings.Replace(ce.DeltaMonthlyCost, "-", "", 1) if b.CLI != nil { - b.CLI.Output(b.Colorize().Color("[bold]" + msgPrefix + ":\n")) + b.CLI.Output(b.Colorize().Color(msgPrefix + ":\n")) b.CLI.Output(b.Colorize().Color(fmt.Sprintf("Resources: %d of %d estimated", ce.MatchedResourcesCount, ce.ResourcesCount))) b.CLI.Output(b.Colorize().Color(fmt.Sprintf(" $%s/mo %s$%s", ce.ProposedMonthlyCost, sign, deltaRepr))) diff --git a/internal/cloud/backend_common.go b/internal/cloud/backend_common.go index 2ca3fc1a2..da4500ec6 100644 --- a/internal/cloud/backend_common.go +++ b/internal/cloud/backend_common.go @@ -213,7 +213,7 @@ func (b *Cloud) costEstimate(stopCtx, cancelCtx context.Context, op *backend.Ope return nil } - msgPrefix := "Cost estimation" + msgPrefix := "Cost Estimation" started := time.Now() updated := started for i := 0; ; i++ { @@ -260,7 +260,7 @@ func (b *Cloud) costEstimate(stopCtx, cancelCtx context.Context, op *backend.Ope deltaRepr := strings.Replace(ce.DeltaMonthlyCost, "-", "", 1) if b.CLI != nil { - b.CLI.Output(b.Colorize().Color(msgPrefix + ":\n")) + b.CLI.Output(b.Colorize().Color("[bold]" + msgPrefix + ":\n")) b.CLI.Output(b.Colorize().Color(fmt.Sprintf("Resources: %d of %d estimated", ce.MatchedResourcesCount, ce.ResourcesCount))) b.CLI.Output(b.Colorize().Color(fmt.Sprintf(" $%s/mo %s$%s", ce.ProposedMonthlyCost, sign, deltaRepr))) @@ -282,12 +282,12 @@ func (b *Cloud) costEstimate(stopCtx, cancelCtx context.Context, op *backend.Ope elapsed = fmt.Sprintf( " (%s elapsed)", current.Sub(started).Truncate(30*time.Second)) } - b.CLI.Output(b.Colorize().Color(msgPrefix + ":\n")) + b.CLI.Output(b.Colorize().Color("[bold]" + msgPrefix + ":\n")) b.CLI.Output(b.Colorize().Color("Waiting for cost estimate to complete..." + elapsed + "\n")) } continue case tfe.CostEstimateSkippedDueToTargeting: - b.CLI.Output(b.Colorize().Color(msgPrefix + ":\n")) + b.CLI.Output(b.Colorize().Color("[bold]" + msgPrefix + ":\n")) b.CLI.Output("Not available for this plan, because it was created with the -target option.") b.CLI.Output("\n------------------------------------------------------------------------") return nil @@ -334,15 +334,15 @@ func (b *Cloud) checkPolicy(stopCtx, cancelCtx context.Context, op *backend.Oper var msgPrefix string switch pc.Scope { case tfe.PolicyScopeOrganization: - msgPrefix = "Organization policy check" + msgPrefix = "Organization Policy Check" case tfe.PolicyScopeWorkspace: - msgPrefix = "Workspace policy check" + msgPrefix = "Workspace Policy Check" default: msgPrefix = fmt.Sprintf("Unknown policy check (%s)", pc.Scope) } if b.CLI != nil { - b.CLI.Output(b.Colorize().Color(msgPrefix + ":\n")) + b.CLI.Output(b.Colorize().Color("[bold]" + msgPrefix + ":\n")) } if b.CLI != nil { diff --git a/internal/cloud/backend_runTasks.go b/internal/cloud/backend_runTasks.go index ab00a6aac..6c4d4a270 100644 --- a/internal/cloud/backend_runTasks.go +++ b/internal/cloud/backend_runTasks.go @@ -116,7 +116,11 @@ func (b *Cloud) runTasksWithTaskResults(context *IntegrationContext, output Inte var overall string = "[green]Passed" if firstMandatoryTaskFailed != nil { overall = "[red]Failed" - taskErr = fmt.Errorf("the run failed because the run task, %s, is required to succeed", *firstMandatoryTaskFailed) + if summary.failedMandatory > 1 { + taskErr = fmt.Errorf("the run failed because %d mandatory tasks are required to succeed", summary.failedMandatory) + } else { + taskErr = fmt.Errorf("the run failed because the run task, %s, is required to succeed", *firstMandatoryTaskFailed) + } } else if summary.failed > 0 { // we have failures but none of them mandatory overall = "[green]Passed with advisory failures" }