opentofu/internal/plans/quality.go
Nick Fagerlund 0df3c143bb New plans.Quality type for display-relevant facts about a plan
This commit replaces the existing jsonformat.PlanRendererOpt type with a new
type with identical semantics, located in the plans package.

We needed to be able to exchange the facts represented by
`jsonformat.PlanRendererOpt` across some package boundaries, but the jsonformat
package is implicated in too many dependency chains to be safe for that purpose!
So, we had to make a new one. The plans package seems safe to import from all
the places that must emit or accept this info, and already contains plans.Mode,
which is effectively a sibling of this type.
2023-07-24 14:12:44 -04:00

21 lines
663 B
Go

// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package plans
// Quality represents facts about the nature of a plan that might be relevant
// when rendering it, like whether it errored or contains no changes. A plan can
// have multiple qualities.
type Quality int
//go:generate go run golang.org/x/tools/cmd/stringer -type Quality
const (
// Errored plans did not successfully complete, and cannot be applied.
Errored Quality = iota
// NoChanges plans won't result in any actions on infrastructure, or any
// semantically meaningful updates to state. They can sometimes still affect
// the format of state if applied.
NoChanges
)