helpers

package
v0.19.1237 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: AGPL-3.0 Imports: 18 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// ComponentWorkflowStepsQueueName is the named queue on each component
	// where execute-workflow-step signals run for component builds.
	ComponentWorkflowStepsQueueName = queuenames.ComponentWorkflowStepsQueueName
)

Variables

This section is empty.

Functions

func DockerBuildUnsupported added in v0.19.1097

func DockerBuildUnsupported() stderr.ErrUser

func PreloadComponentBuildConfig

func PreloadComponentBuildConfig(db *gorm.DB) *gorm.DB

component config connections

func PreloadLatestConfig

func PreloadLatestConfig(db *gorm.DB) *gorm.DB

component config connections

Types

type ComponentQueueIDs added in v0.19.903

type ComponentQueueIDs struct {
	DefaultQueueID       string `json:"default_queue_id"`
	WorkflowStepsQueueID string `json:"workflow_steps_queue_id"`
}

ComponentQueueIDs holds the queue IDs for a component.

type CreateComponentParams added in v0.19.894

type CreateComponentParams struct {
	AppID            string
	Name             string
	VarName          string
	Dependencies     []string
	Labels           map[string]string
	SkipDependencies bool

	// Queue creation starts Temporal workflows, so a transactional caller must defer it.
	SkipQueues bool
}

type Helpers

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

func New

func New(params Params) *Helpers

func (*Helpers) ClearComponentDependencies

func (h *Helpers) ClearComponentDependencies(ctx context.Context, compID string) error

func (*Helpers) ClearComponentDependenciesWithDB added in v0.19.1133

func (h *Helpers) ClearComponentDependenciesWithDB(ctx context.Context, db *gorm.DB, compID string) error

func (*Helpers) CreateComponent added in v0.19.894

func (h *Helpers) CreateComponent(ctx context.Context, params *CreateComponentParams) (*app.Component, error)

func (*Helpers) CreateComponentBuild

func (s *Helpers) CreateComponentBuild(ctx context.Context, cmpID string, useLatest bool, gitRef *string) (*app.ComponentBuild, error)

func (*Helpers) CreateComponentBuildForConfigConnection added in v0.19.1153

func (s *Helpers) CreateComponentBuildForConfigConnection(ctx context.Context, cmpID, componentConfigConnectionID string, gitRef *string) (*app.ComponentBuild, error)

CreateComponentBuildForConfigConnection creates a build attached to a specific CCC (e.g. a branch run's app-config CCC) instead of the global LatestConfig.

func (*Helpers) CreateComponentBuildInTx added in v0.19.1131

func (s *Helpers) CreateComponentBuildInTx(ctx context.Context, tx *gorm.DB, cmpID, componentConfigConnectionID string, useLatest bool, gitRef *string) (*app.ComponentBuild, error)

CreateComponentBuildInTx creates the build through the caller's transaction. When componentConfigConnectionID is set, the build is attached to that CCC.

func (*Helpers) CreateComponentBuildWithID added in v0.19.1043

func (s *Helpers) CreateComponentBuildWithID(ctx context.Context, buildID, cmpID string, useLatest bool, gitRef *string) (*app.ComponentBuild, error)

func (*Helpers) CreateComponentBuildWithRequest added in v0.19.1231

func (s *Helpers) CreateComponentBuildWithRequest(ctx context.Context, cmpID string, useLatest bool, gitRef *string, wfRequest *app.WorkflowRequest) (*app.ComponentBuild, error)

func (*Helpers) CreateComponentDependencies

func (h *Helpers) CreateComponentDependencies(ctx context.Context, compID string, dependencyIDs []string) error

NOTE: GORM does not support callbacks when using a custom join table on many2many relationships + associations mode, so this is a helper used to create component dependencies

func (*Helpers) CreateComponentDependenciesWithDB added in v0.19.1133

func (h *Helpers) CreateComponentDependenciesWithDB(ctx context.Context, db *gorm.DB, compID string, dependencyIDs []string) error

Callers inside a transaction must use this, or the component FKs fail.

func (*Helpers) CreateComponentWithDB added in v0.19.1131

func (h *Helpers) CreateComponentWithDB(ctx context.Context, db *gorm.DB, params *CreateComponentParams) (*app.Component, error)

func (*Helpers) EnsureComponentQueues added in v0.19.903

func (h *Helpers) EnsureComponentQueues(ctx context.Context, componentID string) (*ComponentQueueIDs, error)

EnsureComponentQueues creates all Temporal queue workflows for a component and returns the queue IDs. Safe to call multiple times — Create is idempotent.

func (*Helpers) EnsureInstallComponents

func (h *Helpers) EnsureInstallComponents(ctx context.Context, appID string, installIDs []string) error

func (*Helpers) GetComponent

func (s *Helpers) GetComponent(ctx context.Context, cmpID string) (*app.Component, error)

func (*Helpers) GetComponentByID added in v0.19.903

func (s *Helpers) GetComponentByID(ctx context.Context, componentID string) (*app.Component, error)

func (*Helpers) GetComponentByName

func (s *Helpers) GetComponentByName(ctx context.Context, appID, name string) (*app.Component, error)

func (*Helpers) GetComponentCommit

func (s *Helpers) GetComponentCommit(ctx context.Context, cmpID string) (*app.VCSConnectionCommit, error)

GetComponentCommit will return a commit for a component, when a connected git source is attached.

func (*Helpers) GetComponentIDs

func (s *Helpers) GetComponentIDs(ctx context.Context, appID string, comps []string) ([]string, error)

func (*Helpers) GetComponentIDsWithDB added in v0.19.1133

func (s *Helpers) GetComponentIDsWithDB(ctx context.Context, db *gorm.DB, appID string, comps []string) ([]string, error)

Callers inside a transaction must use this, or in-transaction components read as missing.

func (*Helpers) GetComponentInTx added in v0.19.1131

func (s *Helpers) GetComponentInTx(ctx context.Context, tx *gorm.DB, cmpID string) (*app.Component, error)

GetComponentInTx reads the component through the caller's transaction so config connections created within that transaction are visible.

func (*Helpers) GetComponentLatestBuilds

func (s *Helpers) GetComponentLatestBuilds(ctx context.Context, cmpIDs ...string) ([]app.ComponentBuild, error)

func (*Helpers) GetComponentQueueIDs added in v0.19.903

func (h *Helpers) GetComponentQueueIDs(ctx context.Context, componentID string) (*ComponentQueueIDs, error)

GetComponentQueueIDs looks up existing queue IDs for a component.

func (*Helpers) HelmChartFromICs

func (h *Helpers) HelmChartFromICs(ics []app.InstallComponent, helmCmps map[string]bool) []app.HelmChart

func (*Helpers) HelmReleaseFromIC

func (h *Helpers) HelmReleaseFromIC(ic app.InstallComponent) app.HelmChart

func (*Helpers) QueueClient added in v0.19.1012

func (h *Helpers) QueueClient() *queueclient.Client

func (*Helpers) TFWorkSpaceFromIC

func (h *Helpers) TFWorkSpaceFromIC(ic app.InstallComponent) app.TerraformWorkspace

func (*Helpers) TFWorkspacesFromICs

func (h *Helpers) TFWorkspacesFromICs(ics []app.InstallComponent) []app.TerraformWorkspace

func (*Helpers) UpdateComponentType

func (s *Helpers) UpdateComponentType(ctx context.Context, cmpID string, cmpType app.ComponentType) error

type Params

type Params struct {
	fx.In

	V           *validator.Validate
	Cfg         *internal.Config
	DB          *gorm.DB `name:"psql"`
	VcsHelpers  *vcshelpers.Helpers
	QueueClient *queueclient.Client
}

Jump to

Keyboard shortcuts

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