v1

package
v0.6.49 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: AGPL-3.0, Apache-2.0, MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArgsModifier

type ArgsModifier interface {
	// Args allows modifying stack run step arguments before
	// execution.
	Args(args []string) []string
}

type Config

type Config struct {
	// WorkDir is the working directory for the tool.
	WorkDir string

	// ExecDir is the execution directory for the tool.
	ExecDir string

	// Variables is a JSON encoded string representing
	// tool variables.
	Variables *string

	// Scanner is a security scanner. See [securityv1.Scanner] for more information.
	Scanner securityv1.Scanner

	// Run is a stack run that is being processed.
	Run *stackrunv1.StackRun

	ConsoleURL string

	ConsoleToken string
}

type DefaultModifier

type DefaultModifier struct{}

DefaultModifier implements Modifier interface.

func (*DefaultModifier) Args

func (in *DefaultModifier) Args(args []string) []string

Args implements ArgsModifier interface.

func (*DefaultModifier) Env

func (in *DefaultModifier) Env(env []string) []string

Env implements EnvModifier interface.

func (*DefaultModifier) WriteCloser

func (in *DefaultModifier) WriteCloser() []io.WriteCloser

WriteCloser implements PassthroughModifier interface.

type DefaultTool

type DefaultTool struct {
	// Scanner is a security scanner. See [securityv1.Scanner] for more information.
	Scanner securityv1.Scanner
}

DefaultTool implements Tool interface.

func (*DefaultTool) ConfigureStateBackend

func (in *DefaultTool) ConfigureStateBackend(_, _ string, _ *console.StackRunBaseFragment_StateUrls) error

ConfigureStateBackend implements Tool interface.

func (*DefaultTool) HasChanges

func (in *DefaultTool) HasChanges() (bool, error)

HasChanges implements Tool interface. The default implementation returns true (assumes changes exist). Tool-specific implementations should override this for deterministic detection.

func (*DefaultTool) Modifier

func (in *DefaultTool) Modifier(stage console.StepStage) Modifier

Modifier implements Tool interface.

func (*DefaultTool) Output

func (in *DefaultTool) Output() ([]*console.StackOutputAttributes, error)

Output implements Tool interface.

func (*DefaultTool) Plan

Plan implements Tool interface.

func (*DefaultTool) Scan

Scan implements Tool interface.

func (*DefaultTool) State

State implements Tool interface.

type EnvModifier

type EnvModifier interface {
	// Env allows modifying stack run step env vars before
	// execution.
	Env(env []string) []string
}

type Modifier

type Modifier interface {
	ArgsModifier
	EnvModifier
	PassthroughModifier
}

Modifier can do many different runtime modifications of the provided stack run steps. For example, it can alter arguments of the executable step command or provide a custom writer that can capture step command output.

func NewDefaultModifier

func NewDefaultModifier() Modifier

func NewMultiModifier

func NewMultiModifier(modifiers ...Modifier) Modifier

type PassthroughModifier

type PassthroughModifier interface {
	// WriteCloser provides a custom array of [io.WriteCloser].
	// Related stack run step output will be proxied all of them.
	WriteCloser() []io.WriteCloser
}

type Tool

type Tool interface {
	// Scan tries to scan the state/plan information based on local files.
	Scan() ([]*console.StackPolicyViolationAttributes, error)
	// Plan tries to assemble plan information based on local files
	// created by specific tool after PLAN stage. It then transforms it
	// into gqlclient.StackStateAttributes.
	Plan() (*console.StackStateAttributes, error)
	// State tries to assemble state/plan information based on local files
	// created by specific tool after all steps are finished running. It then
	// transforms this information into gqlclient.StackStateAttributes.
	State() (*console.StackStateAttributes, error)
	// Output tries to find any available outputs information based on local files
	// created by specific tool after all steps are finished running. It then
	// transforms this information into gqlclient.StackOutputAttributes.
	Output() ([]*console.StackOutputAttributes, error)
	// ConfigureStateBackend manages the configuration of remote backend if
	// supported by specific tool.
	ConfigureStateBackend(actor, deployToken string, urls *console.StackRunBaseFragment_StateUrls) error
	// Modifier returns specific modifier implementation based on the
	// current step stage. Modifiers can for example alter arguments of the
	// executable step command.
	Modifier(stage console.StepStage) Modifier
	// HasChanges deterministically checks if the plan contains any changes.
	// Returns true if changes are detected, false for no-op plans.
	// This allows the harness to skip unnecessary apply steps and not wait for approvals to free up resources.
	HasChanges() (bool, error)
}

Tool handles one of the supported infrastructure management tools. List of supported tools is based on the gqlclient.StackType. It is mainly responsible for: - gathering state/plan information after successful run from local files - gathering any available outputs from local files - providing runtime modifiers to alter step command execution arguments, env, etc.

func New

func New() Tool

Jump to

Keyboard shortcuts

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