plangenerate

package
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: May 31, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoSuitableWorkflowFound = errors.New("no suitable workflow found")
)

Functions

This section is empty.

Types

type GeneratePlanRequest

type GeneratePlanRequest struct {
	Modules      []*analyzerapi.ProjectModule        `json:"modules"`
	Registry     catalog.Config                      `json:"registry"`
	ProjectDir   string                              `json:"project_dir"`
	Env          map[string]string                   `json:"env"`
	Executables  []executable.Executable             `json:"executables"`
	PinVersions  bool                                `json:"pin_versions"`
	Variables    []api.CIVariable                    `json:"variables"`
	Environments map[string]appcommon.VCSEnvironment `json:"environments"`
	WorkflowType string                              `json:"workflow_type"`
}

type Plan

type Plan struct {
	Name              string                  `json:"name"`
	Stages            []string                `json:"stages"`
	Steps             []Step                  `json:"steps"`
	PinnedExecutables []executable.Executable `json:"pinned-executables,omitempty"`
}

func GeneratePlan

func GeneratePlan(request GeneratePlanRequest) (Plan, error)

type PlanContext

type PlanContext struct {
	ProjectDir      string
	Environment     map[string]string
	Stages          []string
	VCSVariables    []api.CIVariable
	VCSEnvironments map[string]appcommon.VCSEnvironment
	Registry        catalog.Config
	Modules         []*analyzerapi.ProjectModule
}

type Stage

type Stage struct {
	Name  string   `json:"name"`
	Steps []Step   `json:"steps,omitempty"`
	Needs []string `json:"needs,omitempty"`
}

type Step

type Step struct {
	ID                 string                 `json:"id"`
	Name               string                 `json:"name"`
	Slug               string                 `json:"slug"`
	Stage              string                 `json:"stage"`
	Scope              actionsdk.ActionScope  `json:"scope"`
	Action             string                 `json:"action"`
	Module             string                 `json:"module,omitempty"`
	ModuleDir          string                 `json:"module-dir,omitempty"`             // Directory of the module, if applicable
	RunAfter           []string               `json:"run-after,omitempty"`              // List of steps that need to be completed before this step starts (by slug)
	RunAfterByName     []string               `json:"run-after-by-name,omitempty"`      // List of steps that need to be completed before this step starts (by name)
	RunIfChanged       []string               `json:"run-if-changed,omitempty"`         // List of files that trigger this step if changed
	UsesOutputOf       []string               `json:"uses-output-of,omitempty"`         // List of steps whose outputs need to be downloaded (by slug)
	UsesOutputOfByName []string               `json:"uses-output-of-by-name,omitempty"` // List of steps whose outputs need to be downloaded (by name)
	Environment        string                 `json:"environment,omitempty"`
	Access             actionsdk.ActionAccess `json:"access,omitempty"`
	Inputs             actionsdk.ActionInput  `json:"inputs,omitempty"`
	Outputs            actionsdk.ActionOutput `json:"outputs,omitempty"`
	Order              int                    `json:"order"` // Topological order
	Config             interface{}            `json:"config,omitempty"`
}

func SortSteps

func SortSteps(steps []Step) ([]Step, error)

SortSteps sorts the steps using the Topological Sort Algorithm

func (*Step) HasOutputWithTypeAndFormat

func (s *Step) HasOutputWithTypeAndFormat(artifactType string, artifactFormat string) bool

type StepMetadata

type StepMetadata struct {
	ExecutableConstraints map[string]string `json:"executable-constraints,omitempty"`
}

Jump to

Keyboard shortcuts

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