driftui

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildDriftItems

func BuildDriftItems(
	result *container.ReconciliationCheckResult,
	instanceState *state.InstanceState,
) []splitpane.Item

BuildDriftItems creates DriftItems from a ReconciliationCheckResult. instanceState is optional - when provided, it enables resource state lookup for displaying computed fields/outputs.

func HintForContext

func HintForContext(ctx DriftContext) string

HintForContext returns the appropriate hint text for the given drift context.

func HumanReadableAction

func HumanReadableAction(action container.ReconciliationAction) string

HumanReadableAction converts a ReconciliationAction to a human-readable label.

func HumanReadableDriftType

func HumanReadableDriftType(t container.ReconciliationType) string

HumanReadableDriftType converts a ReconciliationType to a short uppercase label.

func HumanReadableDriftTypeLabel

func HumanReadableDriftTypeLabel(t container.ReconciliationType) string

HumanReadableDriftTypeLabel converts a ReconciliationType to a human-readable label.

func SortDriftItems

func SortDriftItems(items []splitpane.Item)

SortDriftItems sorts items alphabetically by name.

Types

type DriftContext

type DriftContext string

DriftContext determines the contextual hints shown in the footer.

const (
	// DriftContextStage is used when drift is detected during the stage command.
	// Hint: "Use --skip-drift-check to skip drift detection"
	DriftContextStage DriftContext = "stage"
	// DriftContextDeployStage is used when drift is detected during the staging phase of deploy --stage.
	// Hint: "Use --skip-drift-check to skip drift detection"
	DriftContextDeployStage DriftContext = "deploy_stage"
	// DriftContextDeploy is used when drift is detected during deployment (409 response).
	// Hint: "Use --force to override drift check"
	DriftContextDeploy DriftContext = "deploy"
	// DriftContextDestroy is used when drift is detected during destroy (409 response).
	// Hint: "Use --force to override drift check"
	DriftContextDestroy DriftContext = "destroy"
)

type DriftDetailsRenderer

type DriftDetailsRenderer struct {
	MaxExpandDepth       int
	NavigationStackDepth int
}

DriftDetailsRenderer implements splitpane.DetailsRenderer for drift review UI.

func (*DriftDetailsRenderer) RenderDetails

func (r *DriftDetailsRenderer) RenderDetails(item splitpane.Item, width int, s *styles.Styles) string

RenderDetails renders the right pane content for a selected drift item.

type DriftDetectedMsg

type DriftDetectedMsg struct {
	// ReconciliationResult contains the full drift/interrupted state detection result.
	ReconciliationResult *container.ReconciliationCheckResult
	// Message explains what was detected.
	Message string
	// InstanceID is the ID of the blueprint instance.
	InstanceID string
	// ChangesetID is the ID of the changeset (for continuing deployment after reconciliation).
	ChangesetID string
	// InstanceState is the current instance state (for displaying computed fields).
	InstanceState *state.InstanceState
}

DriftDetectedMsg is sent when drift is detected during staging or deployment. For staging: triggered by the DriftDetected streaming event. For deployment: triggered by a 409 DriftBlockedResponse.

type DriftFooterRenderer

type DriftFooterRenderer struct {
	Context DriftContext
}

DriftFooterRenderer implements splitpane.FooterRenderer for drift review UI.

func (*DriftFooterRenderer) RenderFooter

func (r *DriftFooterRenderer) RenderFooter(model *splitpane.Model, s *styles.Styles) string

RenderFooter renders the drift review footer with options and contextual hint.

type DriftItem

type DriftItem struct {
	Type         DriftItemType
	Name         string
	ResourceType string // For resources: the resource type (e.g., "aws/s3/bucket")
	ChildPath    string // Path to child blueprint (e.g., "childA" or "childA.childB")
	DriftType    container.ReconciliationType
	// Changes for resources
	ResourceResult *container.ResourceReconcileResult
	// ResourceState from instance state (for computed fields/outputs)
	ResourceState *state.ResourceState
	// Changes for links
	LinkResult  *container.LinkReconcileResult
	Recommended container.ReconciliationAction
	// For hierarchical display
	Depth       int
	ParentChild string
	// Children for child blueprint summary items
	Children []*DriftItem
}

DriftItem represents a resource or link with drift for the split pane.

func (*DriftItem) CanDrillDown

func (d *DriftItem) CanDrillDown() bool

CanDrillDown returns true if the item can be drilled into.

func (*DriftItem) GetAction

func (d *DriftItem) GetAction() string

GetAction returns the action badge text.

func (*DriftItem) GetChildren

func (d *DriftItem) GetChildren() []splitpane.Item

GetChildren returns child items when expanded.

func (*DriftItem) GetDepth

func (d *DriftItem) GetDepth() int

GetDepth returns the nesting depth for indentation.

func (*DriftItem) GetID

func (d *DriftItem) GetID() string

GetID returns a unique identifier for the item.

func (*DriftItem) GetIcon

func (d *DriftItem) GetIcon(selected bool) string

GetIcon returns an icon for the item.

func (*DriftItem) GetIconStyled

func (d *DriftItem) GetIconStyled(s *styles.Styles, styled bool) string

GetIconStyled returns a styled icon for the item.

func (*DriftItem) GetItemType

func (d *DriftItem) GetItemType() string

GetItemType returns the type for section grouping.

func (*DriftItem) GetName

func (d *DriftItem) GetName() string

GetName returns the display name for the item.

func (*DriftItem) GetParentID

func (d *DriftItem) GetParentID() string

GetParentID returns the parent item ID.

func (*DriftItem) IsExpandable

func (d *DriftItem) IsExpandable() bool

IsExpandable returns true if the item can be expanded in-place.

type DriftItemType

type DriftItemType string

DriftItemType represents the type of drift item.

const (
	DriftItemTypeResource DriftItemType = "resource"
	DriftItemTypeLink     DriftItemType = "link"
	DriftItemTypeChild    DriftItemType = "child"
)

type DriftSectionGrouper

type DriftSectionGrouper struct {
	MaxExpandDepth int
}

DriftSectionGrouper implements splitpane.SectionGrouper for drift review UI.

func (*DriftSectionGrouper) GroupItems

func (g *DriftSectionGrouper) GroupItems(
	items []splitpane.Item,
	isExpanded func(id string) bool,
) []splitpane.Section

GroupItems organizes drift items into sections: Resources, Links, Child Blueprints.

type HeadlessDriftPrinter

type HeadlessDriftPrinter struct {
	// contains filtered or unexported fields
}

HeadlessDriftPrinter prints drift information in headless mode.

func NewHeadlessDriftPrinter

func NewHeadlessDriftPrinter(printer *headless.Printer, context DriftContext) *HeadlessDriftPrinter

NewHeadlessDriftPrinter creates a new headless drift printer.

func (*HeadlessDriftPrinter) PrintDriftDetected

func (p *HeadlessDriftPrinter) PrintDriftDetected(result *container.ReconciliationCheckResult)

PrintDriftDetected prints the full drift detection output.

type ReconciliationCompleteMsg

type ReconciliationCompleteMsg struct {
	// InstanceID is the ID of the blueprint instance that was reconciled.
	InstanceID string
	// ResourcesUpdated is the number of resources that were successfully updated.
	ResourcesUpdated int
	// LinksUpdated is the number of links that were successfully updated.
	LinksUpdated int
}

ReconciliationCompleteMsg is sent after successful reconciliation.

type ReconciliationErrorMsg

type ReconciliationErrorMsg struct {
	// Err is the error that occurred during reconciliation.
	Err error
}

ReconciliationErrorMsg is sent when reconciliation fails.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL