models

package
v2.40.3 Latest Latest
Warning

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

Go to latest
Published: May 22, 2026 License: MIT Imports: 20 Imported by: 12

Documentation

Index

Constants

View Source
const (
	FormatVersion                   = "26"
	StepListItemWithKey             = "with"
	StepListItemStepBundleKeyPrefix = "bundle::"
)
View Source
const LogFormatVersion = "2"
View Source
const ToolSyntaxPatternInstalled = `(.*):installed$`
View Source
const ToolSyntaxPatternLatest = `(.*):latest$`

Variables

View Source
var ToolProviders = []string{"asdf", "mise"}

Functions

func MergeStepWith

func MergeStepWith(step, otherStep stepmanModels.StepModel) (stepmanModels.StepModel, error)

func ProcessContainerList added in v2.39.0

func ProcessContainerList(containers map[string]Container) (executionContainers map[string]Container, serviceContainers map[string]Container)

Types

type AppModel

type AppModel struct {
	Title            string                              `json:"title,omitempty" yaml:"title,omitempty"`
	Summary          string                              `json:"summary,omitempty" yaml:"summary,omitempty"`
	Description      string                              `json:"description,omitempty" yaml:"description,omitempty"`
	StatusReportName string                              `json:"status_report_name,omitempty" yaml:"status_report_name,omitempty"`
	Environments     []envmanModels.EnvironmentItemModel `json:"envs,omitempty" yaml:"envs,omitempty"`
}

func (*AppModel) FillMissingDefaults

func (app *AppModel) FillMissingDefaults() error

func (*AppModel) MinimalValidation

func (app *AppModel) MinimalValidation() error

func (*AppModel) Normalize

func (app *AppModel) Normalize() error

func (*AppModel) Validate

func (app *AppModel) Validate() error

type BitriseDataModel

type BitriseDataModel struct {
	FormatVersion        string `json:"format_version" yaml:"format_version"`
	DefaultStepLibSource string `json:"default_step_lib_source,omitempty" yaml:"default_step_lib_source,omitempty"`
	ProjectType          string `json:"project_type" yaml:"project_type"`
	//
	Title       string `json:"title,omitempty" yaml:"title,omitempty"`
	Summary     string `json:"summary,omitempty" yaml:"summary,omitempty"`
	Description string `json:"description,omitempty" yaml:"description,omitempty"`
	//
	App         AppModel                   `json:"app,omitempty" yaml:"app,omitempty"`
	Meta        map[string]interface{}     `json:"meta,omitempty" yaml:"meta,omitempty"`
	TriggerMap  TriggerMapModel            `json:"trigger_map,omitempty" yaml:"trigger_map,omitempty"`
	Pipelines   map[string]PipelineModel   `json:"pipelines,omitempty" yaml:"pipelines,omitempty"`
	Stages      map[string]StageModel      `json:"stages,omitempty" yaml:"stages,omitempty"`
	Workflows   map[string]WorkflowModel   `json:"workflows,omitempty" yaml:"workflows,omitempty"`
	StepBundles map[string]StepBundleModel `json:"step_bundles,omitempty" yaml:"step_bundles,omitempty"`
	Tools       ToolsModel                 `json:"tools,omitempty" yaml:"tools,omitempty"`
	ToolConfig  *ToolConfigModel           `json:"tool_config,omitempty" yaml:"tool_config,omitempty"`
	// Docker container definitions
	Services map[string]Container `json:"services,omitempty" yaml:"services,omitempty"`
	// The new containerization syntax uses the "containers" property to define both execution and service containers.
	// The new "type" property on the Container model defines whether the container is an execution or service container.
	Containers map[string]Container `json:"containers,omitempty" yaml:"containers,omitempty"`
}

func (*BitriseDataModel) FillMissingDefaults

func (config *BitriseDataModel) FillMissingDefaults() error

func (*BitriseDataModel) MinimalValidation

func (config *BitriseDataModel) MinimalValidation() ([]string, error)

func (*BitriseDataModel) Normalize

func (config *BitriseDataModel) Normalize() error

func (*BitriseDataModel) RemoveRedundantFields

func (config *BitriseDataModel) RemoveRedundantFields() error

func (*BitriseDataModel) Validate

func (config *BitriseDataModel) Validate() ([]string, error)

type BuildRunResultsModel

type BuildRunResultsModel struct {
	WorkflowID           string                `json:"workflow_id" yaml:"workflow_id"`
	EventName            string                `json:"event_name" yaml:"event_name"`
	ProjectType          string                `json:"project_type" yaml:"project_type"`
	StartTime            time.Time             `json:"start_time" yaml:"start_time"`
	StepmanUpdates       map[string]int        `json:"stepman_updates" yaml:"stepman_updates"`
	SuccessSteps         []StepRunResultsModel `json:"success_steps" yaml:"success_steps"`
	FailedSteps          []StepRunResultsModel `json:"failed_steps" yaml:"failed_steps"`
	FailedSkippableSteps []StepRunResultsModel `json:"failed_skippable_steps" yaml:"failed_skippable_steps"`
	SkippedSteps         []StepRunResultsModel `json:"skipped_steps" yaml:"skipped_steps"`
}

func NewBuildRunResultsModel added in v2.30.0

func NewBuildRunResultsModel(workflowID string, start time.Time, projectType string) BuildRunResultsModel

func (BuildRunResultsModel) ExitCode

func (buildRes BuildRunResultsModel) ExitCode() int

func (BuildRunResultsModel) HasFailedSkippableSteps

func (buildRes BuildRunResultsModel) HasFailedSkippableSteps() bool

func (BuildRunResultsModel) IsBuildFailed

func (buildRes BuildRunResultsModel) IsBuildFailed() bool

func (BuildRunResultsModel) IsStepLibUpdated

func (buildRes BuildRunResultsModel) IsStepLibUpdated(stepLib string) bool

func (BuildRunResultsModel) OrderedResults

func (buildRes BuildRunResultsModel) OrderedResults() []StepRunResultsModel

func (BuildRunResultsModel) ResultsCount

func (buildRes BuildRunResultsModel) ResultsCount() int

type BuildRunStartModel

type BuildRunStartModel struct {
	EventName   string    `json:"event_name" yaml:"event_name"`
	ProjectType string    `json:"project_type" yaml:"project_type"`
	StartTime   time.Time `json:"start_time" yaml:"start_time"`
}

type BundleContext added in v2.37.0

type BundleContext struct {
	UUID               string
	Envs               []envmanModels.EnvironmentItemModel
	RunIfs             []string
	ExecutionContainer *ContainerConfig  // resolved exec container from parent chain
	ServiceContainers  []ContainerConfig // accumulated services from parent chain
}

type ConfigFileTreeModel

type ConfigFileTreeModel struct {
	Path     string                `json:"path" yaml:"path"`
	Contents string                `json:"contents,omitempty" yaml:"contents,omitempty"`
	Includes []ConfigFileTreeModel `json:"includes,omitempty" yaml:"includes,omitempty"`
}

func (*ConfigFileTreeModel) Merge

func (configTree *ConfigFileTreeModel) Merge() (string, error)

type Container

type Container struct {
	Type        ContainerType                       `json:"type,omitempty" yaml:"type,omitempty"`
	Image       string                              `json:"image,omitempty" yaml:"image,omitempty"`
	Credentials DockerCredentials                   `json:"credentials,omitempty" yaml:"credentials,omitempty"`
	Ports       []string                            `json:"ports,omitempty" yaml:"ports,omitempty"`
	Envs        []envmanModels.EnvironmentItemModel `json:"envs,omitempty" yaml:"envs,omitempty"`
	Options     string                              `json:"options,omitempty" yaml:"options,omitempty"`
}

Container model defines a Docker container configuration.

func (*Container) Normalize

func (container *Container) Normalize() error

func (*Container) Validate

func (container *Container) Validate() error

type ContainerConfig added in v2.39.0

type ContainerConfig struct {
	ContainerID string `json:"container_id,omitempty"`
	Recreate    bool   `json:"-"`
}

type ContainerPlan

type ContainerPlan struct {
	Image string `json:"image"`
}

type ContainerType added in v2.39.0

type ContainerType string
const (
	ContainerTypeExecution ContainerType = "execution"
	ContainerTypeService   ContainerType = "service"
)

type Containerisable added in v2.39.0

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

func (Containerisable) GetExecutionContainerConfig added in v2.39.0

func (c Containerisable) GetExecutionContainerConfig() (*ContainerConfig, error)

func (Containerisable) GetServiceContainerConfigs added in v2.39.0

func (c Containerisable) GetServiceContainerConfigs() ([]ContainerConfig, error)

type DockerCredentials

type DockerCredentials struct {
	Username string `json:"username,omitempty" yaml:"username,omitempty"`
	Password string `json:"password,omitempty" yaml:"password,omitempty"`
	Server   string `json:"server,omitempty" yaml:"server,omitempty"`
}

type GraphPipelineAlwaysRunMode

type GraphPipelineAlwaysRunMode string
const (
	GraphPipelineAlwaysRunModeOff      GraphPipelineAlwaysRunMode = "off"
	GraphPipelineAlwaysRunModeWorkflow GraphPipelineAlwaysRunMode = "workflow"
)

func (*GraphPipelineAlwaysRunMode) UnmarshalJSON

func (d *GraphPipelineAlwaysRunMode) UnmarshalJSON(data []byte) error

func (*GraphPipelineAlwaysRunMode) UnmarshalYAML

func (d *GraphPipelineAlwaysRunMode) UnmarshalYAML(unmarshal func(interface{}) error) error

type GraphPipelineRunIfModel

type GraphPipelineRunIfModel struct {
	Expression string `json:"expression,omitempty" yaml:"expression,omitempty"`
}

type GraphPipelineWorkflowListItemModel

type GraphPipelineWorkflowListItemModel map[string]GraphPipelineWorkflowModel

type GraphPipelineWorkflowModel

type GraphPipelineWorkflowModel struct {
	DependsOn       []string                          `json:"depends_on,omitempty" yaml:"depends_on,omitempty"`
	AbortOnFail     bool                              `json:"abort_on_fail,omitempty" yaml:"abort_on_fail,omitempty"`
	RunIf           GraphPipelineRunIfModel           `json:"run_if,omitempty" yaml:"run_if,omitempty"`
	ShouldAlwaysRun GraphPipelineAlwaysRunMode        `json:"should_always_run,omitempty" yaml:"should_always_run,omitempty"`
	Uses            string                            `json:"uses,omitempty" yaml:"uses,omitempty"`
	Inputs          []GraphPipelineWorkflowModelInput `json:"inputs,omitempty" yaml:"inputs,omitempty"`
	Parallel        string                            `json:"parallel,omitempty" yaml:"parallel,omitempty"`
}

type GraphPipelineWorkflowModelInput

type GraphPipelineWorkflowModelInput map[string]interface{}

type PipelineModel

type PipelineModel struct {
	Title            string                             `json:"title,omitempty" yaml:"title,omitempty"`
	Summary          string                             `json:"summary,omitempty" yaml:"summary,omitempty"`
	Description      string                             `json:"description,omitempty" yaml:"description,omitempty"`
	Triggers         Triggers                           `json:"triggers,omitempty" yaml:"triggers,omitempty"`
	StatusReportName string                             `json:"status_report_name,omitempty" yaml:"status_report_name,omitempty"`
	Stages           []StageListItemModel               `json:"stages,omitempty" yaml:"stages,omitempty"`
	Workflows        GraphPipelineWorkflowListItemModel `json:"workflows,omitempty" yaml:"workflows,omitempty"`
	Priority         *int                               `json:"priority,omitempty" yaml:"priority,omitempty"`
}

type PullRequestGitEventTriggerItem

type PullRequestGitEventTriggerItem struct {
	Enabled       *bool `json:"enabled,omitempty" yaml:"enabled,omitempty"`
	Priority      *int  `json:"priority,omitempty" yaml:"priority,omitempty"`
	DraftEnabled  *bool `json:"draft_enabled,omitempty" yaml:"draft_enabled,omitempty"`
	SourceBranch  any   `json:"source_branch,omitempty" yaml:"source_branch,omitempty"`
	TargetBranch  any   `json:"target_branch,omitempty" yaml:"target_branch,omitempty"`
	Label         any   `json:"label,omitempty" yaml:"label,omitempty"`
	Comment       any   `json:"comment,omitempty" yaml:"comment,omitempty"`
	CommitMessage any   `json:"commit_message,omitempty" yaml:"commit_message,omitempty"`
	ChangedFiles  any   `json:"changed_files,omitempty" yaml:"changed_files,omitempty"`
}

type PullRequestReadyState

type PullRequestReadyState string
const (
	PullRequestReadyStateDraft                     PullRequestReadyState = "draft"
	PullRequestReadyStateReadyForReview            PullRequestReadyState = "ready_for_review"
	PullRequestReadyStateConvertedToReadyForReview PullRequestReadyState = "converted_to_ready_for_review"
)

type PushGitEventTriggerItem

type PushGitEventTriggerItem struct {
	Enabled       *bool `json:"enabled,omitempty" yaml:"enabled,omitempty"`
	Priority      *int  `json:"priority,omitempty" yaml:"priority,omitempty"`
	Branch        any   `json:"branch,omitempty" yaml:"branch,omitempty"`
	CommitMessage any   `json:"commit_message,omitempty" yaml:"commit_message,omitempty"`
	ChangedFiles  any   `json:"changed_files,omitempty" yaml:"changed_files,omitempty"`
}

type StageListItemModel

type StageListItemModel map[string]StageModel

type StageModel

type StageModel struct {
	Title           string                       `json:"title,omitempty" yaml:"title,omitempty"`
	Summary         string                       `json:"summary,omitempty" yaml:"summary,omitempty"`
	Description     string                       `json:"description,omitempty" yaml:"description,omitempty"`
	ShouldAlwaysRun bool                         `json:"should_always_run,omitempty" yaml:"should_always_run,omitempty"`
	AbortOnFail     bool                         `json:"abort_on_fail,omitempty" yaml:"abort_on_fail,omitempty"`
	RunIf           string                       `json:"run_if,omitempty" yaml:"run_if,omitempty"`
	Workflows       []StageWorkflowListItemModel `json:"workflows,omitempty" yaml:"workflows,omitempty"`
}

type StageWorkflowListItemModel

type StageWorkflowListItemModel map[string]StageWorkflowModel

type StageWorkflowModel

type StageWorkflowModel struct {
	RunIf string `json:"run_if,omitempty" yaml:"run_if,omitempty"`
}

type StepBundleListItemModel

type StepBundleListItemModel struct {
	Title              string                              `json:"title,omitempty" yaml:"title,omitempty"`
	Summary            string                              `json:"summary,omitempty" yaml:"summary,omitempty"`
	Description        string                              `json:"description,omitempty" yaml:"description,omitempty"`
	RunIf              *string                             `json:"run_if,omitempty" yaml:"run_if,omitempty"`
	Inputs             []envmanModels.EnvironmentItemModel `json:"inputs,omitempty" yaml:"inputs,omitempty"`
	Environments       []envmanModels.EnvironmentItemModel `json:"envs,omitempty" yaml:"envs,omitempty"`
	ExecutionContainer stepmanModels.ContainerReference    `json:"execution_container,omitempty" yaml:"execution_container,omitempty"`
	ServiceContainers  []stepmanModels.ContainerReference  `json:"service_containers,omitempty" yaml:"service_containers,omitempty"`
}

func (*StepBundleListItemModel) Normalize

func (bundle *StepBundleListItemModel) Normalize() error

func (*StepBundleListItemModel) Validate

func (bundle *StepBundleListItemModel) Validate(stepBundleDefinition StepBundleModel, containerValidationCtx *containerValidationContext) error

type StepBundleModel

type StepBundleModel struct {
	Title              string                              `json:"title,omitempty" yaml:"title,omitempty"`
	Summary            string                              `json:"summary,omitempty" yaml:"summary,omitempty"`
	Description        string                              `json:"description,omitempty" yaml:"description,omitempty"`
	RunIf              string                              `json:"run_if,omitempty" yaml:"run_if,omitempty"`
	Inputs             []envmanModels.EnvironmentItemModel `json:"inputs,omitempty" yaml:"inputs,omitempty"`
	Environments       []envmanModels.EnvironmentItemModel `json:"envs,omitempty" yaml:"envs,omitempty"`
	ExecutionContainer stepmanModels.ContainerReference    `json:"execution_container,omitempty" yaml:"execution_container,omitempty"`
	ServiceContainers  []stepmanModels.ContainerReference  `json:"service_containers,omitempty" yaml:"service_containers,omitempty"`
	Steps              []StepListItemStepOrBundleModel     `json:"steps,omitempty" yaml:"steps,omitempty"`
}

func (*StepBundleModel) Normalize

func (bundle *StepBundleModel) Normalize() error

func (*StepBundleModel) Validate

func (bundle *StepBundleModel) Validate(stepBundleDefinitions map[string]StepBundleModel, containerValidationCtx *containerValidationContext) ([]string, error)

type StepBundlePlan

type StepBundlePlan struct {
	ID    string `json:"id"`
	Title string `json:"title,omitempty"`
}

type StepError

type StepError struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

type StepExecutionPlan

type StepExecutionPlan struct {
	UUID   string                  `json:"uuid"`
	StepID string                  `json:"step_id"`
	Step   stepmanModels.StepModel `json:"-"`

	// Step Bundle group
	StepBundleUUID string                              `json:"step_bundle_uuid,omitempty"`
	StepBundleEnvs []envmanModels.EnvironmentItemModel `json:"-"`
	// StepBundleRunIfs stores each run_if statements of the including Step Bundles.
	// The first element is the run_if statement of the top most Step Bundle including the given Step.
	// To execute the Step, all run_if statements must be evaluated to true.
	StepBundleRunIfs []string `json:"-"`

	// Containers
	ExecutionContainer *ContainerConfig  `json:"-"`
	ServiceContainers  []ContainerConfig `json:"-"`

	// With (container) group
	WithGroupUUID string   `json:"with_group_uuid,omitempty"`
	ContainerID   string   `json:"-"`
	ServiceIDs    []string `json:"-"`
}

type StepListItem added in v2.37.0

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

func NewStepListItemFromBundleStep added in v2.37.0

func NewStepListItemFromBundleStep(source StepListItemStepOrBundleModel) (*StepListItem, error)

func NewStepListItemFromWithStep added in v2.37.0

func NewStepListItemFromWithStep(source StepListStepItemModel) (*StepListItem, error)

func NewStepListItemFromWorkflowStep added in v2.37.0

func NewStepListItemFromWorkflowStep(source StepListItemModel) (*StepListItem, error)

func (*StepListItem) GetBundle added in v2.37.0

func (i *StepListItem) GetBundle() *StepBundleListItemModel

func (*StepListItem) GetKeyAndType added in v2.37.0

func (i *StepListItem) GetKeyAndType() (string, StepListItemType)

func (*StepListItem) GetStep added in v2.37.0

func (i *StepListItem) GetStep() *stepmanModels.StepModel

func (*StepListItem) GetWithGroup added in v2.37.0

func (i *StepListItem) GetWithGroup() *WithModel

type StepListItemModel

type StepListItemModel map[string]interface{}

StepListItemModel is a map representing a step list item of a workflow, the value is either a Step, a With Group or Step Bundle.

func (*StepListItemModel) GetBundle

func (stepListItem *StepListItemModel) GetBundle() (*StepBundleListItemModel, error)

func (*StepListItemModel) GetKeyAndType

func (stepListItem *StepListItemModel) GetKeyAndType() (string, StepListItemType, error)

func (*StepListItemModel) GetStep

func (stepListItem *StepListItemModel) GetStep() (*stepmanModels.StepModel, error)

func (*StepListItemModel) GetWith

func (stepListItem *StepListItemModel) GetWith() (*WithModel, error)

func (*StepListItemModel) UnmarshalJSON

func (stepListItem *StepListItemModel) UnmarshalJSON(b []byte) error

func (*StepListItemModel) UnmarshalYAML

func (stepListItem *StepListItemModel) UnmarshalYAML(unmarshal func(interface{}) error) error

type StepListItemStepOrBundleModel

type StepListItemStepOrBundleModel map[string]any

StepListItemStepOrBundleModel is a map representing a step list item of a Step Bundle, the value is either a Step or a Step Bundle.

func (*StepListItemStepOrBundleModel) GetBundle

func (stepListItem *StepListItemStepOrBundleModel) GetBundle() (*StepBundleListItemModel, error)

func (*StepListItemStepOrBundleModel) GetKeyAndType

func (stepListItem *StepListItemStepOrBundleModel) GetKeyAndType() (string, StepListItemType, error)

func (*StepListItemStepOrBundleModel) GetStep

func (stepListItem *StepListItemStepOrBundleModel) GetStep() (*stepmanModels.StepModel, error)

func (*StepListItemStepOrBundleModel) UnmarshalJSON

func (stepListItem *StepListItemStepOrBundleModel) UnmarshalJSON(b []byte) error

func (*StepListItemStepOrBundleModel) UnmarshalYAML

func (stepListItem *StepListItemStepOrBundleModel) UnmarshalYAML(unmarshal func(interface{}) error) error

type StepListItemType

type StepListItemType int
const (
	StepListItemTypeUnknown StepListItemType = iota
	StepListItemTypeStep
	StepListItemTypeWith
	StepListItemTypeBundle
)

type StepListStepBundleItemModel

type StepListStepBundleItemModel map[string]StepBundleListItemModel

type StepListStepItemModel

type StepListStepItemModel map[string]stepmanModels.StepModel

StepListStepItemModel is a map representing a step list item of a With group, the value is a Step.

func (*StepListStepItemModel) GetStepIDAndStep

func (stepListStepItem *StepListStepItemModel) GetStepIDAndStep() (string, stepmanModels.StepModel, error)

type StepListWithItemModel

type StepListWithItemModel map[string]WithModel

type StepRunResultsModel

type StepRunResultsModel struct {
	StepInfo   stepmanModels.StepInfoModel `json:"step_info" yaml:"step_info"`
	StepInputs map[string]string           `json:"step_inputs" yaml:"step_inputs"`
	Status     StepRunStatus               `json:"status" yaml:"status"`
	Idx        int                         `json:"idx" yaml:"idx"`
	RunTime    time.Duration               `json:"run_time" yaml:"run_time"`
	StartTime  time.Time                   `json:"start_time" yaml:"start_time"`
	ErrorStr   string                      `json:"error_str" yaml:"error_str"`
	ExitCode   int                         `json:"exit_code" yaml:"exit_code"`

	Timeout         time.Duration `json:"-"`
	NoOutputTimeout time.Duration `json:"-"`
}

func (StepRunResultsModel) StatusReasonAndErrors

func (s StepRunResultsModel) StatusReasonAndErrors() (string, []StepError)

type StepRunStatus

type StepRunStatus int

StepRunStatus ...

const (
	StepRunStatusCodeSuccess                StepRunStatus = 0
	StepRunStatusCodeFailed                 StepRunStatus = 1
	StepRunStatusCodeFailedSkippable        StepRunStatus = 2
	StepRunStatusCodeSkipped                StepRunStatus = 3
	StepRunStatusCodeSkippedWithRunIf       StepRunStatus = 4
	StepRunStatusCodePreparationFailed      StepRunStatus = 5
	StepRunStatusAbortedWithCustomTimeout   StepRunStatus = 7 // step times out due to a custom timeout
	StepRunStatusAbortedWithNoOutputTimeout StepRunStatus = 8 // step times out due to no output received (hang)
)

func NewStepRunStatus

func NewStepRunStatus(status string) StepRunStatus

func (StepRunStatus) Name

func (s StepRunStatus) Name() string

func (StepRunStatus) String

func (s StepRunStatus) String() string

type TagGitEventTriggerItem

type TagGitEventTriggerItem struct {
	Enabled  *bool `json:"enabled,omitempty" yaml:"enabled,omitempty"`
	Priority *int  `json:"priority,omitempty" yaml:"priority,omitempty"`
	Name     any   `json:"name,omitempty" yaml:"name,omitempty"`
}

type TestResultStepInfo

type TestResultStepInfo struct {
	ID      string `json:"id" yaml:"id"`
	Version string `json:"version" yaml:"version"`
	Title   string `json:"title" yaml:"title"`
	Number  int    `json:"number" yaml:"number"`
}

type ToolConfigModel added in v2.33.0

type ToolConfigModel struct {
	Provider string `json:"provider,omitempty" yaml:"provider,omitempty"`

	// Extra tool-plugins on top of Bitrise-vetted integrations. This is very provider-specific, but the map value is a URL to the plugin source.
	ExtraPlugins map[ToolID]string `json:"extra_plugins,omitempty" yaml:"extra_plugins,omitempty"`

	// FastInstall enables the use of nixpkgs backend for faster tool installation.
	// Default behavior if unset: see toolprovider.selectFastInstall().
	FastInstall *bool `json:"fast_install,omitempty" yaml:"fast_install,omitempty"`
}

type ToolID added in v2.33.0

type ToolID string

type ToolsModel added in v2.33.0

type ToolsModel map[ToolID]string

ToolsModel is a mapping of tool IDs to their versions (see package toolprovider about the version syntax)

type TriggerEventType

type TriggerEventType string
const (
	TriggerEventTypeCodePush    TriggerEventType = "code-push"
	TriggerEventTypePullRequest TriggerEventType = "pull-request"
	TriggerEventTypeTag         TriggerEventType = "tag"
	TriggerEventTypeUnknown     TriggerEventType = "unknown"
)

type TriggerItemType

type TriggerItemType string
const (
	CodePushType    TriggerItemType = "push"
	PullRequestType TriggerItemType = "pull_request"
	TagPushType     TriggerItemType = "tag"
)

type TriggerMapItemModel

type TriggerMapItemModel struct {
	// Trigger Item shared properties
	Type       TriggerItemType `json:"type,omitempty" yaml:"type,omitempty"`
	Enabled    *bool           `json:"enabled,omitempty" yaml:"enabled,omitempty"`
	PipelineID string          `json:"pipeline,omitempty" yaml:"pipeline,omitempty"`
	WorkflowID string          `json:"workflow,omitempty" yaml:"workflow,omitempty"`

	// Code Push Item conditions
	PushBranch interface{} `json:"push_branch,omitempty" yaml:"push_branch,omitempty"`

	// Code Push and Pull Request Item conditions
	CommitMessage interface{} `json:"commit_message,omitempty" yaml:"commit_message,omitempty"`
	ChangedFiles  interface{} `json:"changed_files,omitempty" yaml:"changed_files,omitempty"`

	// Tag Push Item conditions
	Tag interface{} `json:"tag,omitempty" yaml:"tag,omitempty"`

	// Pull Request Item conditions
	PullRequestSourceBranch interface{} `json:"pull_request_source_branch,omitempty" yaml:"pull_request_source_branch,omitempty"`
	PullRequestTargetBranch interface{} `json:"pull_request_target_branch,omitempty" yaml:"pull_request_target_branch,omitempty"`
	DraftPullRequestEnabled *bool       `json:"draft_pull_request_enabled,omitempty" yaml:"draft_pull_request_enabled,omitempty"`
	PullRequestLabel        interface{} `json:"pull_request_label,omitempty" yaml:"pull_request_label,omitempty"`
	PullRequestComment      interface{} `json:"pull_request_comment,omitempty" yaml:"pull_request_comment,omitempty"`

	// Deprecated properties
	Pattern              string `json:"pattern,omitempty" yaml:"pattern,omitempty"`
	IsPullRequestAllowed bool   `json:"is_pull_request_allowed,omitempty" yaml:"is_pull_request_allowed,omitempty"`
}

func (TriggerMapItemModel) IsDraftPullRequestEnabled

func (item TriggerMapItemModel) IsDraftPullRequestEnabled() bool

func (TriggerMapItemModel) MatchWithParams

func (item TriggerMapItemModel) MatchWithParams(pushBranch, prSourceBranch, prTargetBranch string, prReadyState PullRequestReadyState, tag string) (bool, error)

func (TriggerMapItemModel) Normalized

func (item TriggerMapItemModel) Normalized(idx int) (TriggerMapItemModel, error)

Normalized casts trigger item values from map[interface{}]interface{} to map[string]interface{} to support JSON marshalling of the bitrise.yml.

func (TriggerMapItemModel) Validate

func (item TriggerMapItemModel) Validate(idx int, workflows, pipelines []string) ([]string, error)

type TriggerMapModel

type TriggerMapModel []TriggerMapItemModel

func (TriggerMapModel) FirstMatchingTarget

func (triggerMap TriggerMapModel) FirstMatchingTarget(pushBranch, prSourceBranch, prTargetBranch string, prReadyState PullRequestReadyState, tag string) (string, string, error)

func (TriggerMapModel) Normalized

func (triggerMap TriggerMapModel) Normalized() ([]TriggerMapItemModel, error)

func (TriggerMapModel) Validate

func (triggerMap TriggerMapModel) Validate(workflows, pipelines []string) ([]string, error)

type Triggers

type Triggers struct {
	Enabled             *bool                            `json:"enabled,omitempty" yaml:"enabled,omitempty"`
	PushTriggers        []PushGitEventTriggerItem        `json:"push,omitempty" yaml:"push,omitempty"`
	PullRequestTriggers []PullRequestGitEventTriggerItem `json:"pull_request,omitempty" yaml:"pull_request,omitempty"`
	TagTriggers         []TagGitEventTriggerItem         `json:"tag,omitempty" yaml:"tag,omitempty"`
}

func (*Triggers) UnmarshalYAML

func (triggers *Triggers) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the yaml.Unmarshaler interface for Triggers, allowing additional validation of the triggers YAML configuration.

type WithGroupContext added in v2.37.0

type WithGroupContext struct {
	UUID        string
	ContainerID string
	ServiceIDs  []string
}

type WithGroupPlan

type WithGroupPlan struct {
	Services  []ContainerPlan `json:"services,omitempty"`
	Container ContainerPlan   `json:"container,omitempty"`
}

WithGroupPlan ... TODO: Old container plan, to be removed when containerisation using "With groups" is sunsetted

type WithModel

type WithModel struct {
	ContainerID string                  `json:"container,omitempty" yaml:"container,omitempty"`
	ServiceIDs  []string                `json:"services,omitempty" yaml:"services,omitempty"`
	Steps       []StepListStepItemModel `json:"steps,omitempty" yaml:"steps,omitempty"`
}

func (*WithModel) Normalize

func (with *WithModel) Normalize() error

func (*WithModel) Validate

func (with *WithModel) Validate(workflowID string, containers, services map[string]Container) ([]string, error)

type WorkflowExecutionPlan

type WorkflowExecutionPlan struct {
	UUID                 string              `json:"uuid"`
	WorkflowID           string              `json:"workflow_id"`
	Steps                []StepExecutionPlan `json:"steps"`
	WorkflowTitle        string              `json:"-"`
	IsSteplibOfflineMode bool                `json:"-"`
}

type WorkflowListItemModel

type WorkflowListItemModel map[string]WorkflowModel

type WorkflowModel

type WorkflowModel struct {
	Title            string                              `json:"title,omitempty" yaml:"title,omitempty"`
	Summary          string                              `json:"summary,omitempty" yaml:"summary,omitempty"`
	Description      string                              `json:"description,omitempty" yaml:"description,omitempty"`
	Triggers         Triggers                            `json:"triggers,omitempty" yaml:"triggers,omitempty"`
	StatusReportName string                              `json:"status_report_name,omitempty" yaml:"status_report_name,omitempty"`
	BeforeRun        []string                            `json:"before_run,omitempty" yaml:"before_run,omitempty"`
	AfterRun         []string                            `json:"after_run,omitempty" yaml:"after_run,omitempty"`
	Environments     []envmanModels.EnvironmentItemModel `json:"envs,omitempty" yaml:"envs,omitempty"`
	Steps            []StepListItemModel                 `json:"steps,omitempty" yaml:"steps,omitempty"`
	Priority         *int                                `json:"priority,omitempty" yaml:"priority,omitempty"`
	Tools            ToolsModel                          `json:"tools,omitempty" yaml:"tools,omitempty"`
	Meta             map[string]interface{}              `json:"meta,omitempty" yaml:"meta,omitempty"`
}

func (*WorkflowModel) FillMissingDefaults

func (workflow *WorkflowModel) FillMissingDefaults(title string) error

func (*WorkflowModel) Normalize

func (workflow *WorkflowModel) Normalize() error

func (*WorkflowModel) Validate

func (workflow *WorkflowModel) Validate() error

type WorkflowRunModes

type WorkflowRunModes struct {
	CIMode                  bool
	PRMode                  bool
	DebugMode               bool
	SecretFilteringMode     bool
	SecretEnvsFilteringMode bool
	NoOutputTimeout         time.Duration
	IsSteplibOfflineMode    bool
}

type WorkflowRunPlan

type WorkflowRunPlan struct {
	Version          string `json:"version"`
	LogFormatVersion string `json:"log_format_version"`

	CIMode                  bool `json:"ci_mode"`
	PRMode                  bool `json:"pr_mode"`
	DebugMode               bool `json:"debug_mode"`
	IsSteplibOfflineMode    bool `json:"-"`
	NoOutputTimeoutMode     bool `json:"no_output_timeout_mode"`
	SecretFilteringMode     bool `json:"secret_filtering_mode"`
	SecretEnvsFilteringMode bool `json:"secret_envs_filtering_mode"`

	ExecutionPlan   []WorkflowExecutionPlan   `json:"execution_plan"`
	StepBundlePlans map[string]StepBundlePlan `json:"step_bundles,omitempty"`

	// ----
	// Container plans
	// step execution container id to container plan
	ExecutionContainerPlans map[string]ContainerPlan `json:"-"`
	// service container id to container plan
	ServiceContainerPlans map[string]ContainerPlan `json:"-"`

	// TODO: Old container plan, to be removed when containerisation using "With groups" is sunsetted
	WithGroupPlans map[string]WithGroupPlan `json:"with_groups,omitempty"`
}

type WorkflowRunPlanBuilder added in v2.37.0

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

func NewWorkflowRunPlanBuilder added in v2.37.0

func NewWorkflowRunPlanBuilder(workflows map[string]WorkflowModel, stepBundles map[string]StepBundleModel, containers map[string]Container, services map[string]Container, uuidProvider func() string) *WorkflowRunPlanBuilder

func (*WorkflowRunPlanBuilder) Build added in v2.37.0

func (builder *WorkflowRunPlanBuilder) Build(modes WorkflowRunModes, targetWorkflowID string) (WorkflowRunPlan, error)

Jump to

Keyboard shortcuts

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