helpers

package
v0.19.913 Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 License: AGPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppWorkflowsQueueName          = "app-workflows"
	AppSignalsQueueName            = "app-signals"
	AppWorkflowStepGroupsQueueName = "app-workflow-step-groups"
	AppWorkflowStepsQueueName      = "app-workflow-steps"
)

Variables

This section is empty.

Functions

func GetActionReferences

func GetActionReferences(cfg *app.AppConfig, action string) []refs.Ref

func GetComponentReferences

func GetComponentReferences(cfg *app.AppConfig, comp string) []refs.Ref

NOTE(jm): this is a function, because it is used directly within a workflow.

func GetFakeSandboxStackData added in v0.19.850

func GetFakeSandboxStackData(appCfg *app.AppConfig, region string, stateMap map[string]interface{}) map[string]any

GetFakeSandboxStackData builds a fake stack output map for sandbox mode orgs, using real keys from the app config with random fake values. stateMap is used to render templated role names (e.g. "{{.install.name}}-admin"). NOTE: this is a standalone function because it is used directly within workflows.

func GetStackReferences

func GetStackReferences(cfg *app.AppConfig) []refs.Ref

func IsEmail

func IsEmail(email string) bool

func PreloadAppActionWorkflowConfigs

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

preload action workflow configs

func PreloadAppBreakGlassConfig

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

break glass config

func PreloadAppConfigComponentConfigConnections

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

component config connections

func PreloadAppConfigInputConfig

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

input config

func PreloadAppConfigPermissionsConfig

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

permissions config

func PreloadAppConfigPolicyConfig

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

policies config

func PreloadAppConfigRunnerConfig

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

runner config

func PreloadAppConfigSandboxConfig

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

sandbox config

func PreloadAppConfigStackConfig

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

cloudformation stack config

func PreloadAppOperationRoleConfig added in v0.19.807

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

component role config

func PreloadAppSecretsConfig

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

secrets config

func PreloadComponentConfigConnections

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

component config connections

Types

type CreateAppBranchRunRequest added in v0.19.850

type CreateAppBranchRunRequest struct {
	AppBranchID       string
	AppBranchConfigID string
	Force             bool
}

type Helpers

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

func New

func New(params Params) *Helpers

func (*Helpers) CliVerisionAllowed

func (h *Helpers) CliVerisionAllowed(ctx context.Context, version string) (bool, error)

func (*Helpers) CreateAppBranch

func (h *Helpers) CreateAppBranch(
	ctx context.Context,
	appID string,
	name string,
) (*app.AppBranch, error)

func (*Helpers) CreateAppBranchConfig added in v0.19.850

func (h *Helpers) CreateAppBranchConfig(
	ctx context.Context,
	appBranchID string,
	connectedGithubVCSConfig *app.ConnectedGithubVCSConfig,
	publicGitVCSConfig *app.PublicGitVCSConfig,
	installGroups []app.AppBranchInstallGroup,
) (*app.AppBranchConfig, error)

func (*Helpers) CreateAppBranchRun added in v0.19.850

func (h *Helpers) CreateAppBranchRun(ctx context.Context, req *CreateAppBranchRunRequest) (*app.AppBranchRun, error)

func (*Helpers) CreateAppSandboxQueue added in v0.19.850

func (h *Helpers) CreateAppSandboxQueue(ctx context.Context, appID string) error

CreateAppSandboxQueue creates a Temporal queue for the app's sandbox build workflow. This enables sandbox-build signals to be enqueued and processed against the app.

func (*Helpers) CreateAppWorkflow added in v0.19.903

func (s *Helpers) CreateAppWorkflow(ctx context.Context,
	appID string,
	workflowType app.WorkflowType,
	metadata map[string]string,
	planOnly bool,
) (*app.Workflow, error)

func (*Helpers) CreateWorkflow

func (s *Helpers) CreateWorkflow(ctx context.Context,
	appBranchID string,
	workflowType app.WorkflowType,
	metadata map[string]string,
	planOnly bool,
) (*app.Workflow, error)

func (*Helpers) DeleteAppComponent

func (s *Helpers) DeleteAppComponent(ctx context.Context, compID string) error

func (*Helpers) EnsureAppBranchQueue added in v0.19.850

func (h *Helpers) EnsureAppBranchQueue(ctx context.Context, branchID string) error

EnsureAppBranchQueue creates a Temporal queue workflow for the given app branch. Safe to call multiple times — queueClient.Create is idempotent.

func (*Helpers) EnsureAppQueue added in v0.19.903

func (h *Helpers) EnsureAppQueue(ctx context.Context, appID string) error

EnsureAppQueue creates all Temporal queue workflows needed for an app to execute workflows through the shared flow infrastructure. Safe to call multiple times — queueClient.Create is idempotent.

func (*Helpers) FetchAppBranchesWithConfigs added in v0.19.850

func (h *Helpers) FetchAppBranchesWithConfigs(ctx context.Context, appID string) ([]app.AppBranch, error)

FetchAppBranchesWithConfigs retrieves all app branches for an app with their configs preloaded

func (*Helpers) GetAppComponents

func (s *Helpers) GetAppComponents(ctx context.Context, appID string) ([]app.Component, error)

func (*Helpers) GetAppComponentsAtConfigVersion

func (h *Helpers) GetAppComponentsAtConfigVersion(ctx context.Context, appID string, appCfgVersion int, componentIDs []string) ([]app.Component, error)

This returns all app components for a point in time

func (*Helpers) GetAppInstalls

func (s *Helpers) GetAppInstalls(ctx context.Context, appID string) ([]app.Install, error)

func (*Helpers) GetAppLatestConfig

func (h *Helpers) GetAppLatestConfig(ctx context.Context, appID string) (*app.AppConfig, error)

func (*Helpers) GetComponentDependents

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

func (*Helpers) GetComponents

func (s *Helpers) GetComponents(ctx context.Context, compIDs []string) ([]app.Component, error)

func (*Helpers) GetConfigComponentDeployOrder

func (h *Helpers) GetConfigComponentDeployOrder(ctx context.Context, cfg *app.AppConfig, compID string) ([]string, error)

func (*Helpers) GetConfigDefaultComponentOrder

func (h *Helpers) GetConfigDefaultComponentOrder(ctx context.Context, cfg *app.AppConfig) ([]string, error)

func (*Helpers) GetConfigGraph

func (h *Helpers) GetConfigGraph(ctx context.Context, cfg *app.AppConfig) (graph.Graph[string, *app.Component], error)

GetConfigGraph builds a directed acyclic graph of component dependencies and returns both the graph and a sorted list of components in deployment order (dependencies first)

func (*Helpers) GetConfigReverseDefaultComponentOrder

func (h *Helpers) GetConfigReverseDefaultComponentOrder(ctx context.Context, cfg *app.AppConfig) ([]string, error)

func (*Helpers) GetFullAppConfig

func (h *Helpers) GetFullAppConfig(ctx context.Context, appConfigID string, skipAdditionalChecks bool) (*app.AppConfig, error)

func (*Helpers) GetPoliciesConfigByAppConfigID

func (h *Helpers) GetPoliciesConfigByAppConfigID(ctx context.Context, appConfigID string) (*app.AppPoliciesConfig, error)

func (*Helpers) GetReverseConfigComponentDeployOrder

func (h *Helpers) GetReverseConfigComponentDeployOrder(ctx context.Context, cfg *app.AppConfig, compID string) ([]string, error)

func (*Helpers) VCSHelpers added in v0.19.850

func (h *Helpers) VCSHelpers() *vcshelpers.Helpers

VCSHelpers returns the VCS helpers for git source resolution and token creation.

func (*Helpers) ValidateGraph

func (h *Helpers) ValidateGraph(ctx context.Context, appID string) error

func (*Helpers) ValidateSameRepo added in v0.19.850

func (h *Helpers) ValidateSameRepo(
	branches []app.AppBranch,
	vcsConfigReq *vcshelpers.VCSConfigRequest,
) error

ValidateSameRepo validates that all app branches use the same repository as the provided request Accepts the VCS config request (before creation) to validate early If both publicRepoReq and connectedRepoReq are nil, returns early with no validation Branches with no VCS config (both nil) are ignored during validation

type Params

type Params struct {
	fx.In

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

Jump to

Keyboard shortcuts

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