Documentation ¶
Index ¶
- Constants
- Variables
- func AddResult(ctx context.Context, db *gorp.DbMap, store cache.Store, wr *sdk.WorkflowRun, ...) error
- func AddSpawnInfosNodeJobRun(db gorp.SqlExecutor, nodeID, jobID int64, infos []sdk.SpawnInfo) error
- func AddWorkflowIntegration(db gorp.SqlExecutor, integ *sdk.WorkflowProjectIntegration) error
- func AddWorkflowRunInfo(run *sdk.WorkflowRun, infos ...sdk.SpawnMsg)
- func AggregateOnWorkflowTemplateInstance(ctx context.Context, db gorp.SqlExecutor, ...) error
- func BookNodeJobRun(ctx context.Context, store cache.Store, defaultBookDelay int64, ...) (*sdk.Service, error)
- func CanBeRun(workflowRun *sdk.WorkflowRun, workflowNodeRun *sdk.WorkflowNodeRun) bool
- func CanUploadRunResult(ctx context.Context, db *gorp.DbMap, store cache.Store, wr sdk.WorkflowRun, ...) (bool, error)
- func CheckRegion(ctx context.Context, db gorp.SqlExecutor, proj sdk.Project, wf sdk.Workflow) error
- func CheckValidity(_ context.Context, _ gorp.SqlExecutor, w *sdk.Workflow) error
- func CompleteWorkflow(ctx context.Context, db gorp.SqlExecutor, w *sdk.Workflow, proj sdk.Project, ...) error
- func CountNodeJobRunQueue(ctx context.Context, db gorp.SqlExecutor, store cache.Store, ...) (sdk.WorkflowNodeJobRunCount, error)
- func CountNodeJobRunQueueByGroupIDs(ctx context.Context, db gorp.SqlExecutor, store cache.Store, ...) (sdk.WorkflowNodeJobRunCount, error)
- func CountNotPendingWorkflowRunsByWorkflowID(db gorp.SqlExecutor, workflowID int64) (int64, error)
- func CountPipeline(db gorp.SqlExecutor, pipelineID int64) (bool, error)
- func CountRepositoryWebHooksByApplication(db gorp.SqlExecutor, appID int64) (int64, error)
- func CountRunSecretsByWorkflowRunID(ctx context.Context, db gorp.SqlExecutor, workflowRunID int64) (int64, error)
- func CountWorkflowRunsMarkToDelete(ctx context.Context, db gorp.SqlExecutor, ...) int64
- func CreateBuiltinWorkflowHookModels(db *gorp.DbMap) error
- func CreateBuiltinWorkflowOutgoingHookModels(db *gorp.DbMap) error
- func CreateRun(db *gorp.DbMap, wf *sdk.Workflow, opts sdk.WorkflowRunPostHandlerOption) (*sdk.WorkflowRun, error)
- func DefaultPayload(ctx context.Context, db gorpmapper.SqlExecutorWithTx, store cache.Store, ...) (interface{}, error)
- func Delete(ctx context.Context, db gorpmapper.SqlExecutorWithTx, store cache.Store, ...) error
- func DeleteIntegrationsFromWorkflow(db gorp.SqlExecutor, workflowID int64) error
- func DeleteNodeJobRun(db gorp.SqlExecutor, nodeRunJob int64) error
- func DeleteNodeJobRuns(db gorp.SqlExecutor, nodeID int64) error
- func DeleteNotifications(db gorp.SqlExecutor, workflowID int64) error
- func DeleteRunSecretsByWorkflowRunID(ctx context.Context, db gorpmapper.SqlExecutorWithTx, workflowRunID int64) error
- func DeleteWorkflowData(db gorp.SqlExecutor, wf sdk.Workflow) error
- func Exists(ctx context.Context, db gorp.SqlExecutor, key string, name string) (bool, error)
- func ExistsID(ctx context.Context, db gorp.SqlExecutor, key string, id int64) (bool, error)
- func Export(ctx context.Context, db gorp.SqlExecutor, cache cache.Store, proj sdk.Project, ...) (exportentities.Workflow, error)
- func FindOldestWorkflowRunsWithResultToSync(ctx context.Context, dbmap *gorp.DbMap) ([]int64, error)
- func FreeNodeJobRun(ctx context.Context, store cache.Store, id int64) error
- func GetNodeRunBuildCommits(ctx context.Context, db gorpmapper.SqlExecutorWithTx, store cache.Store, ...) ([]sdk.VCSCommit, sdk.BuildNumberAndHash, error)
- func GetRunResultKey(runID int64, t sdk.WorkflowRunResultType, fileName string) string
- func GetTagsAndValue(db gorp.SqlExecutor, key, name string) (map[string][]string, error)
- func Import(ctx context.Context, db gorpmapper.SqlExecutorWithTx, store cache.Store, ...) error
- func Initialize(ctx context.Context, DBFunc func() *gorp.DbMap, store cache.Store, ...)
- func Insert(ctx context.Context, db gorpmapper.SqlExecutorWithTx, store cache.Store, ...) error
- func InsertAudit(db gorp.SqlExecutor, a *sdk.AuditWorkflow) error
- func InsertHookModel(db gorp.SqlExecutor, m *sdk.WorkflowHookModel) error
- func InsertNotification(db gorp.SqlExecutor, w *sdk.Workflow, n *sdk.WorkflowNotification) error
- func InsertOutgoingHookModel(db gorp.SqlExecutor, m *sdk.WorkflowHookModel) error
- func InsertRunNum(db gorp.SqlExecutor, w *sdk.Workflow, num int64) error
- func InsertRunSecret(ctx context.Context, db gorpmapper.SqlExecutorWithTx, ...) error
- func InsertWorkflowData(db gorp.SqlExecutor, w *sdk.Workflow) error
- func InsertWorkflowRunTags(db gorp.SqlExecutor, runID int64, runTags []sdk.WorkflowRunTag) error
- func IsDeploymentIntegrationUsed(db gorp.SqlExecutor, projectID int64, appID int64, pfName string) (bool, error)
- func IsFavorite(db gorp.SqlExecutor, w *sdk.Workflow, uID string) (bool, error)
- func LabelWorkflow(db gorp.SqlExecutor, labelID, workflowID int64) error
- func Load(ctx context.Context, db gorp.SqlExecutor, _ cache.Store, proj sdk.Project, ...) (*sdk.Workflow, error)
- func LoadAll(ctx context.Context, db gorp.SqlExecutor, projectKey string) (sdk.Workflows, error)
- func LoadAllByIDs(ctx context.Context, db gorp.SqlExecutor, ids []int64) (sdk.Workflows, error)
- func LoadAllHooks(db gorp.SqlExecutor) ([]sdk.NodeHook, error)
- func LoadAllNames(db gorp.SqlExecutor, projID int64) (sdk.IDNames, error)
- func LoadAllNamesByProjectIDs(_ context.Context, db gorp.SqlExecutor, projectIDs []int64) ([]sdk.WorkflowName, error)
- func LoadAndLockNodeJobRunSkipLocked(ctx context.Context, db gorp.SqlExecutor, store cache.Store, id int64) (*sdk.WorkflowNodeJobRun, error)
- func LoadAndLockNodeJobRunWait(ctx context.Context, db gorp.SqlExecutor, store cache.Store, id int64) (*sdk.WorkflowNodeJobRun, error)
- func LoadAndLockNodeRunByID(ctx context.Context, db gorp.SqlExecutor, id int64) (*sdk.WorkflowNodeRun, error)
- func LoadAndLockNodeRunByJobID(ctx context.Context, db gorp.SqlExecutor, jobID int64) (*sdk.WorkflowNodeRun, error)
- func LoadAndLockRunByID(ctx context.Context, db gorp.SqlExecutor, id int64, loadOpts LoadRunOptions) (*sdk.WorkflowRun, error)
- func LoadAndLockRunByJobID(ctx context.Context, db gorp.SqlExecutor, id int64, loadOpts LoadRunOptions) (*sdk.WorkflowRun, error)
- func LoadAndLockTerminatedNodeJobRun(ctx context.Context, db gorp.SqlExecutor, limit int) ([]sdk.WorkflowNodeJobRun, error)
- func LoadApplicationSecrets(ctx context.Context, db gorp.SqlExecutor, id int64) ([]sdk.Variable, error)
- func LoadAudit(db gorp.SqlExecutor, auditID int64, workflowID int64) (sdk.AuditWorkflow, error)
- func LoadAudits(db gorp.SqlExecutor, workflowID int64) ([]sdk.AuditWorkflow, error)
- func LoadByApplicationName(ctx context.Context, db gorp.SqlExecutor, projectKey string, appName string) ([]sdk.WorkflowName, error)
- func LoadByEnvName(ctx context.Context, db gorp.SqlExecutor, projectKey string, envName string) ([]sdk.WorkflowName, error)
- func LoadByID(ctx context.Context, db gorp.SqlExecutor, _ cache.Store, proj sdk.Project, ...) (*sdk.Workflow, error)
- func LoadByPipelineName(ctx context.Context, db gorp.SqlExecutor, projectKey string, pipName string) ([]sdk.WorkflowName, error)
- func LoadByRepo(ctx context.Context, db gorp.SqlExecutor, proj sdk.Project, repo string, ...) (*sdk.Workflow, error)
- func LoadByWorkflowTemplateID(ctx context.Context, db gorp.SqlExecutor, templateID int64) ([]sdk.WorkflowName, error)
- func LoadCraftingWorkflowRunIDs(db gorp.SqlExecutor) ([]int64, error)
- func LoadCurrentRunNum(db gorp.SqlExecutor, projectkey, workflowname string) (int64, error)
- func LoadDeadNodeJobRun(ctx context.Context, db gorp.SqlExecutor, store cache.Store) ([]sdk.WorkflowNodeJobRun, error)
- func LoadDecryptSecrets(ctx context.Context, db gorp.SqlExecutor, wr *sdk.WorkflowRun, ...) (sdk.WorkflowRunSecrets, error)
- func LoadEnvironmentSecrets(db gorp.SqlExecutor, id int64) ([]sdk.Variable, error)
- func LoadHookByUUID(db gorp.SqlExecutor, uuid string) (sdk.NodeHook, error)
- func LoadHookModelByID(db gorp.SqlExecutor, id int64) (*sdk.WorkflowHookModel, error)
- func LoadHookModelByName(db gorp.SqlExecutor, name string) (*sdk.WorkflowHookModel, error)
- func LoadHookModels(db gorp.SqlExecutor) ([]sdk.WorkflowHookModel, error)
- func LoadLabels(db gorp.SqlExecutor, workflowIDs ...int64) ([]sdk.Label, error)
- func LoadLastRun(ctx context.Context, db gorp.SqlExecutor, projectkey, workflowname string, ...) (*sdk.WorkflowRun, error)
- func LoadLastRuns(ctx context.Context, db gorp.SqlExecutor, workflowIDs []int64, limit int) ([]sdk.WorkflowRun, error)
- func LoadNodeJobRun(ctx context.Context, db gorp.SqlExecutor, store cache.Store, id int64) (*sdk.WorkflowNodeJobRun, error)
- func LoadNodeJobRunIDByNodeRunID(db gorp.SqlExecutor, runNodeID int64) ([]int64, error)
- func LoadNodeJobRunQueue(ctx context.Context, db gorp.SqlExecutor, store cache.Store, ...) ([]sdk.WorkflowNodeJobRun, error)
- func LoadNodeJobRunQueueByGroupIDs(ctx context.Context, db gorp.SqlExecutor, store cache.Store, ...) ([]sdk.WorkflowNodeJobRun, error)
- func LoadNodeRun(db gorp.SqlExecutor, projectkey, workflowname string, noderunID int64, ...) (*sdk.WorkflowNodeRun, error)
- func LoadNodeRunByID(ctx context.Context, db gorp.SqlExecutor, id int64, loadOpts LoadRunOptions) (*sdk.WorkflowNodeRun, error)
- func LoadNodeRunByNodeJobID(db gorp.SqlExecutor, nodeJobRunID int64, loadOpts LoadRunOptions) (*sdk.WorkflowNodeRun, error)
- func LoadNodeRunDistinctExecutionIDs(db gorp.SqlExecutor) ([]string, error)
- func LoadNodeRunJobInfo(ctx context.Context, db gorp.SqlExecutor, nodeRunID int64, jobID int64) ([]sdk.SpawnInfo, error)
- func LoadNotificationsByWorkflowIDs(db gorp.SqlExecutor, ids []int64) (map[int64][]sdk.WorkflowNotification, error)
- func LoadOutgoingHookModelByID(db gorp.SqlExecutor, id int64) (*sdk.WorkflowHookModel, error)
- func LoadOutgoingHookModelByName(db gorp.SqlExecutor, name string) (*sdk.WorkflowHookModel, error)
- func LoadOutgoingHookModels(db gorp.SqlExecutor) ([]sdk.WorkflowHookModel, error)
- func LoadRun(ctx context.Context, db gorp.SqlExecutor, projectkey, workflowname string, ...) (*sdk.WorkflowRun, error)
- func LoadRunByID(ctx context.Context, db gorp.SqlExecutor, id int64, loadOpts LoadRunOptions) (*sdk.WorkflowRun, error)
- func LoadRunByIDAndProjectKey(ctx context.Context, db gorp.SqlExecutor, projectkey string, id int64, ...) (*sdk.WorkflowRun, error)
- func LoadRunByJobID(ctx context.Context, db gorp.SqlExecutor, id int64, loadOpts LoadRunOptions) (*sdk.WorkflowRun, error)
- func LoadRunResultsByNodeRunID(ctx context.Context, db gorp.SqlExecutor, nodeRunID int64) (sdk.WorkflowRunResults, error)
- func LoadRunResultsByRunID(ctx context.Context, db gorp.SqlExecutor, runID int64) (sdk.WorkflowRunResults, error)
- func LoadRunResultsByRunIDAndType(ctx context.Context, db gorp.SqlExecutor, runID int64, ...) (sdk.WorkflowRunResults, error)
- func LoadRunResultsByRunIDFilterByIDs(ctx context.Context, db gorp.SqlExecutor, runID int64, resultIDs ...string) (sdk.WorkflowRunResults, error)
- func LoadRunResultsByRunIDUnique(ctx context.Context, db gorp.SqlExecutor, runID int64) (sdk.WorkflowRunResults, error)
- func LoadRunsIDByTag(db gorp.SqlExecutor, projectKey, workflowName, tag, tagValue string) ([]int64, error)
- func LoadRunsIDsCreatedBefore(ctx context.Context, db gorp.SqlExecutor, date time.Time, limit int64) ([]int64, error)
- func LoadRunsIDsToDelete(db gorp.SqlExecutor, offset int64, limit int64) ([]int64, int64, int64, int64, error)
- func LoadRunsSummaries(ctx context.Context, db gorp.SqlExecutor, projectkey, workflowname string, ...) ([]sdk.WorkflowRunSummary, int, int, int, error)
- func LoadWorkflowFromWorkflowRunID(db gorp.SqlExecutor, wrID int64) (sdk.Workflow, error)
- func LoadWorkflowIntegrationsByWorkflowID(ctx context.Context, db gorp.SqlExecutor, id int64) ([]sdk.WorkflowProjectIntegration, error)
- func MarkAsDelete(ctx context.Context, db gorpmapper.SqlExecutorWithTx, cache cache.Store, ...) error
- func MarkAsDeleteWithDependencies(ctx context.Context, db gorpmapper.SqlExecutorWithTx, cache cache.Store, ...) error
- func MarkWorkflowRunsAsDelete(db gorp.SqlExecutor, ids []int64) error
- func MaxSubNumber(workflowNodeRuns map[int64][]sdk.WorkflowNodeRun) int64
- func NextRunNumber(db gorp.SqlExecutor, workflowID int64) (int64, error)
- func NodeBuildParametersFromRun(wr sdk.WorkflowRun, id int64) ([]sdk.Parameter, error)
- func NodeBuildParametersFromWorkflow(proj sdk.Project, wf *sdk.Workflow, refNode *sdk.Node, ancestorsIds []int64) ([]sdk.Parameter, error)
- func Parse(ctx context.Context, proj sdk.Project, oldW *sdk.Workflow, ...) (*sdk.Workflow, error)
- func ParseAndImport(ctx context.Context, db gorpmapper.SqlExecutorWithTx, store cache.Store, ...) (*sdk.Workflow, []sdk.Message, error)
- func PrepareSpawnInfos(infos []sdk.SpawnInfo) []sdk.SpawnInfo
- func PreviousNodeRun(db gorp.SqlExecutor, nr sdk.WorkflowNodeRun, nodeName string, workflowID int64) (*sdk.WorkflowNodeRun, error)
- func PreviousNodeRunVCSInfos(ctx context.Context, db gorp.SqlExecutor, projectKey string, wf sdk.Workflow, ...) (sdk.BuildNumberAndHash, error)
- func ProcessRunResultPromotionByRunID(ctx context.Context, db gorpmapper.SqlExecutorWithTx, workflowRunID int64, ...) error
- func Pull(ctx context.Context, db gorp.SqlExecutor, cache cache.Store, proj sdk.Project, ...) (exportentities.WorkflowComponents, error)
- func PurgeAllWorkflowRunsByWorkflowID(ctx context.Context, db gorp.SqlExecutor, id int64) (int, error)
- func PurgeAudits(ctx context.Context, db gorp.SqlExecutor) error
- func PurgeWorkflowRun(ctx context.Context, db gorp.SqlExecutor, wf sdk.Workflow) error
- func ReadCDSFiles(files map[string][]byte) (*tar.Reader, error)
- func RemoveIntegrationFromWorkflow(db gorp.SqlExecutor, workflowInteg sdk.WorkflowProjectIntegration) error
- func RenameNode(ctx context.Context, db gorp.SqlExecutor, w *sdk.Workflow) error
- func Resync(ctx context.Context, db gorp.SqlExecutor, store cache.Store, proj sdk.Project, ...) error
- func ResyncCommitStatus(ctx context.Context, db *gorp.DbMap, store cache.Store, proj sdk.Project, ...) error
- func ResyncNodeRunsWithCommits(ctx context.Context, db *gorp.DbMap, store cache.Store, proj sdk.Project, ...)
- func ResyncWorkflowRunResultsRoutine(ctx context.Context, DBFunc func() *gorp.DbMap, store cache.Store, ...)
- func RunExist(db gorp.SqlExecutor, projectKey string, workflowID int64, hash string) (bool, error)
- func SetMaxRuns(confMaxRuns int64)
- func SetRunReadOnlyByID(ctx context.Context, db gorpmapper.SqlExecutorWithTx, workflowRunID int64) error
- func Sort(w *sdk.Workflow)
- func SortNode(n *sdk.Node)
- func SyncNodeRunRunJob(ctx context.Context, db gorp.SqlExecutor, nodeRun *sdk.WorkflowNodeRun, ...) (bool, error)
- func SyncRunResultArtifactManagerByRunID(ctx context.Context, db gorpmapper.SqlExecutorWithTx, workflowRunID int64) error
- func UnLabelWorkflow(db gorp.SqlExecutor, labelID, workflowID int64) error
- func Update(ctx context.Context, db gorpmapper.SqlExecutorWithTx, store cache.Store, ...) error
- func UpdateCraftedWorkflowRun(db gorp.SqlExecutor, id int64) error
- func UpdateFavorite(db gorp.SqlExecutor, workflowID int64, u string, add bool) error
- func UpdateFromRepository(db gorp.SqlExecutor, workflowID int64, fromRepository string) error
- func UpdateHookModel(db gorp.SqlExecutor, m *sdk.WorkflowHookModel) error
- func UpdateIcon(db gorp.SqlExecutor, workflowID int64, icon string) error
- func UpdateMaxRunsByID(db gorp.SqlExecutor, workflowID int64, maxRuns int64) error
- func UpdateMetadata(db gorp.SqlExecutor, workflowID int64, metadata sdk.Metadata) error
- func UpdateNodeJobRun(ctx context.Context, db gorp.SqlExecutor, j *sdk.WorkflowNodeJobRun) error
- func UpdateNodeRun(db gorp.SqlExecutor, n *sdk.WorkflowNodeRun) error
- func UpdateNodeRunBuildParameters(db gorp.SqlExecutor, nodeID int64, buildParameters []sdk.Parameter) error
- func UpdateNodeRunStatusAndStage(db gorp.SqlExecutor, nodeRun *sdk.WorkflowNodeRun) error
- func UpdateOutgoingHookModel(db gorp.SqlExecutor, m *sdk.WorkflowHookModel) error
- func UpdateRunNum(db gorp.SqlExecutor, w *sdk.Workflow, num int64) error
- func UpdateRunResult(ctx context.Context, db gorp.SqlExecutor, result *sdk.WorkflowRunResult) error
- func UpdateWorkflowRun(ctx context.Context, db gorp.SqlExecutor, wr *sdk.WorkflowRun) error
- func UpdateWorkflowRunStatus(db gorp.SqlExecutor, wr *sdk.WorkflowRun) error
- func UpdateWorkflowRunTags(db gorp.SqlExecutor, r *sdk.WorkflowRun) error
- func UserFavoriteWorkflowIDs(db gorp.SqlExecutor, uID string) ([]int64, error)
- type ArtifactSignature
- type ImportOptions
- type JobRun
- type LoadAllWorkflowsOptionsFilters
- type LoadAllWorkflowsOptionsLoaders
- type LoadOptions
- type LoadRunOptions
- type NodeRun
- type Notification
- type ProcessorReport
- func ResyncWorkflowRunStatus(ctx context.Context, db gorp.SqlExecutor, wr *sdk.WorkflowRun) (*ProcessorReport, error)
- func StartWorkflowRun(ctx context.Context, db gorpmapper.SqlExecutorWithTx, store cache.Store, ...) (*ProcessorReport, error)
- func StopWorkflowNodeRun(ctx context.Context, dbFunc func() *gorp.DbMap, store cache.Store, ...) (*ProcessorReport, error)
- func TakeNodeJobRun(ctx context.Context, db gorpmapper.SqlExecutorWithTx, store cache.Store, ...) (*sdk.WorkflowNodeJobRun, *ProcessorReport, error)
- func UpdateNodeJobRunStatus(ctx context.Context, db gorpmapper.SqlExecutorWithTx, store cache.Store, ...) (*ProcessorReport, error)
- func UpdateOutgoingHookRunStatus(ctx context.Context, db gorpmapper.SqlExecutorWithTx, store cache.Store, ...) (*ProcessorReport, error)
- func UpdateParentWorkflowRun(ctx context.Context, tx gorpmapper.SqlExecutorWithTx, store cache.Store, ...) (*ProcessorReport, error)
- func (r *ProcessorReport) Add(ctx context.Context, i ...interface{})
- func (r *ProcessorReport) All() []interface{}
- func (r *ProcessorReport) Errors() []error
- func (r *ProcessorReport) Jobs() []sdk.WorkflowNodeJobRun
- func (r *ProcessorReport) Merge(ctx context.Context, r1 *ProcessorReport)
- func (r *ProcessorReport) Nodes() []sdk.WorkflowNodeRun
- func (r *ProcessorReport) WorkflowRuns() []sdk.WorkflowRun
- func (r *ProcessorReport) Workflows() []sdk.WorkflowRun
- type PushOption
- type PushSecrets
- func CreateFromRepository(ctx context.Context, db *gorp.DbMap, store cache.Store, p *sdk.Project, ...) (*PushSecrets, []sdk.Message, error)
- func Push(ctx context.Context, db *gorp.DbMap, store cache.Store, proj *sdk.Project, ...) ([]sdk.Message, *sdk.Workflow, *sdk.Workflow, *PushSecrets, error)
- func RetrieveSecrets(ctx context.Context, db gorp.SqlExecutor, wf sdk.Workflow) (*PushSecrets, error)
- type QueueFilter
- type Run
- type RunTag
- type UpdateOptions
- type VCSEventMessenger
- type Workflow
- func (w *Workflow) Get() sdk.Workflow
- func (w *Workflow) PostGet(db gorp.SqlExecutor) error
- func (w *Workflow) PostInsert(db gorp.SqlExecutor) error
- func (w *Workflow) PostUpdate(db gorp.SqlExecutor) error
- func (w *Workflow) PreInsert(db gorp.SqlExecutor) error
- func (w *Workflow) PreUpdate(_ gorp.SqlExecutor) error
- type WorkflowDAO
- func (dao WorkflowDAO) GetLoaders() []gorpmapping.GetOptionFunc
- func (dao WorkflowDAO) Load(ctx context.Context, db gorp.SqlExecutor) (sdk.Workflow, error)
- func (dao WorkflowDAO) LoadAll(ctx context.Context, db gorp.SqlExecutor) (sdk.Workflows, error)
- func (dao WorkflowDAO) Query() gorpmapping.Query
- type Workflows
Constants ¶
const ( SecretProjContext = "proj" SecretAppContext = "app:%d" SecretEnvContext = "env:%d" SecretProjIntegrationContext = "integration:%d" SecretApplicationIntegrationContext = "app:%d:integration:%s" )
const WorkflowAsCodePattern = ".cds/*.yml"
WorkflowAsCodePattern is the default code pattern to find cds files
Variables ¶
var ( Audits = map[string]sdk.Audit{ fmt.Sprintf("%T", sdk.EventWorkflowAdd{}): addWorkflowAudit{}, fmt.Sprintf("%T", sdk.EventWorkflowUpdate{}): updateWorkflowAudit{}, fmt.Sprintf("%T", sdk.EventWorkflowPermissionAdd{}): addWorkflowPermissionAudit{}, fmt.Sprintf("%T", sdk.EventWorkflowPermissionUpdate{}): updateWorkflowPermissionAudit{}, fmt.Sprintf("%T", sdk.EventWorkflowPermissionDelete{}): deleteWorkflowPermissionAudit{}, } )
var (
KeyResult = cache.Key("run", "result")
)
Functions ¶
func AddSpawnInfosNodeJobRun ¶
AddSpawnInfosNodeJobRun saves spawn info before starting worker
func AddWorkflowIntegration ¶
func AddWorkflowIntegration(db gorp.SqlExecutor, integ *sdk.WorkflowProjectIntegration) error
AddWorkflowIntegration link a project integration on a workflow
func AddWorkflowRunInfo ¶
func AddWorkflowRunInfo(run *sdk.WorkflowRun, infos ...sdk.SpawnMsg)
AddWorkflowRunInfo add WorkflowRunInfo on a WorkflowRun
func AggregateOnWorkflowTemplateInstance ¶
func AggregateOnWorkflowTemplateInstance(ctx context.Context, db gorp.SqlExecutor, wtis ...*sdk.WorkflowTemplateInstance) error
AggregateOnWorkflowTemplateInstance set workflow for each workflow template instance.
func BookNodeJobRun ¶
func BookNodeJobRun(ctx context.Context, store cache.Store, defaultBookDelay int64, customBookDelay map[string]int64, id int64, hatchery *sdk.Service) (*sdk.Service, error)
BookNodeJobRun Book a job for a hatchery
func CanBeRun ¶
func CanBeRun(workflowRun *sdk.WorkflowRun, workflowNodeRun *sdk.WorkflowNodeRun) bool
CanBeRun return boolean to know if a workflow node run can be run or not TODO: if no bugs are found, it could be used to refactor process.go
func CanUploadRunResult ¶
func CheckRegion ¶
func CheckValidity ¶
CheckValidity checks workflow validity
func CompleteWorkflow ¶
func CompleteWorkflow(ctx context.Context, db gorp.SqlExecutor, w *sdk.Workflow, proj sdk.Project, opts LoadOptions) error
func CountNodeJobRunQueue ¶
func CountNodeJobRunQueue(ctx context.Context, db gorp.SqlExecutor, store cache.Store, filter QueueFilter) (sdk.WorkflowNodeJobRunCount, error)
CountNodeJobRunQueue count all workflow_node_run_job accessible
func CountNodeJobRunQueueByGroupIDs ¶
func CountNodeJobRunQueueByGroupIDs(ctx context.Context, db gorp.SqlExecutor, store cache.Store, filter QueueFilter, groupIDs []int64) (sdk.WorkflowNodeJobRunCount, error)
func CountNotPendingWorkflowRunsByWorkflowID ¶
func CountNotPendingWorkflowRunsByWorkflowID(db gorp.SqlExecutor, workflowID int64) (int64, error)
func CountPipeline ¶
func CountPipeline(db gorp.SqlExecutor, pipelineID int64) (bool, error)
CountPipeline Count the number of workflow that use the given pipeline
func CountRepositoryWebHooksByApplication ¶
func CountRepositoryWebHooksByApplication(db gorp.SqlExecutor, appID int64) (int64, error)
CountRepositoryWebHooksByApplication count repository webhooks by application id
func CountRunSecretsByWorkflowRunID ¶ added in v0.52.0
func CountWorkflowRunsMarkToDelete ¶
func CountWorkflowRunsMarkToDelete(ctx context.Context, db gorp.SqlExecutor, workflowRunsMarkToDelete *stats.Int64Measure) int64
func CreateBuiltinWorkflowHookModels ¶
CreateBuiltinWorkflowHookModels insert all builtin hook models in database
func CreateBuiltinWorkflowOutgoingHookModels ¶
CreateBuiltinWorkflowOutgoingHookModels insert all builtin hook models in database
func CreateRun ¶
func CreateRun(db *gorp.DbMap, wf *sdk.Workflow, opts sdk.WorkflowRunPostHandlerOption) (*sdk.WorkflowRun, error)
CreateRun creates a new workflow run and insert it
func DefaultPayload ¶
func DefaultPayload(ctx context.Context, db gorpmapper.SqlExecutorWithTx, store cache.Store, proj sdk.Project, wf *sdk.Workflow) (interface{}, error)
DefaultPayload returns the default payload for the workflow root
func Delete ¶
func Delete(ctx context.Context, db gorpmapper.SqlExecutorWithTx, store cache.Store, proj sdk.Project, w *sdk.Workflow) error
Delete workflow
func DeleteIntegrationsFromWorkflow ¶
func DeleteIntegrationsFromWorkflow(db gorp.SqlExecutor, workflowID int64) error
DeleteIntegrationsFromWorkflow remove a project integration on a workflow
func DeleteNodeJobRun ¶
func DeleteNodeJobRun(db gorp.SqlExecutor, nodeRunJob int64) error
DeleteNodeJobRun deletes the given workflow_node_run_job
func DeleteNodeJobRuns ¶
func DeleteNodeJobRuns(db gorp.SqlExecutor, nodeID int64) error
DeleteNodeJobRuns deletes all workflow_node_run_job for a given workflow_node_run
func DeleteNotifications ¶
func DeleteNotifications(db gorp.SqlExecutor, workflowID int64) error
func DeleteRunSecretsByWorkflowRunID ¶ added in v0.52.0
func DeleteRunSecretsByWorkflowRunID(ctx context.Context, db gorpmapper.SqlExecutorWithTx, workflowRunID int64) error
func DeleteWorkflowData ¶
func DeleteWorkflowData(db gorp.SqlExecutor, wf sdk.Workflow) error
DeleteWorkflowData delete the relation representation of the workflow
func Export ¶
func Export(ctx context.Context, db gorp.SqlExecutor, cache cache.Store, proj sdk.Project, name string, opts ...v2.ExportOptions) (exportentities.Workflow, error)
Export a workflow
func FindOldestWorkflowRunsWithResultToSync ¶ added in v0.52.0
func FreeNodeJobRun ¶
FreeNodeJobRun Free a job for a hatchery
func GetNodeRunBuildCommits ¶
func GetNodeRunBuildCommits(ctx context.Context, db gorpmapper.SqlExecutorWithTx, store cache.Store, proj sdk.Project, wf sdk.Workflow, wNodeName string, number int64, nodeRun *sdk.WorkflowNodeRun, app *sdk.Application, env *sdk.Environment) ([]sdk.VCSCommit, sdk.BuildNumberAndHash, error)
GetNodeRunBuildCommits gets commits for given node run and return current vcs info
func GetRunResultKey ¶
func GetRunResultKey(runID int64, t sdk.WorkflowRunResultType, fileName string) string
func GetTagsAndValue ¶
GetTagsAndValue returns a map of tags and all the values available on all runs of a workflow
func Import ¶
func Import(ctx context.Context, db gorpmapper.SqlExecutorWithTx, store cache.Store, proj sdk.Project, oldW, w *sdk.Workflow, consumer *sdk.AuthUserConsumer, opts ImportOptions, msgChan chan<- sdk.Message) error
Import is able to create a new workflow and all its components
func Initialize ¶
func Initialize(ctx context.Context, DBFunc func() *gorp.DbMap, store cache.Store, uiURL, confDefaultOS, confDefaultArch string, maxLogSize int64)
Initialize starts goroutines for workflows
func Insert ¶
func Insert(ctx context.Context, db gorpmapper.SqlExecutorWithTx, store cache.Store, proj sdk.Project, w *sdk.Workflow) error
Insert inserts a new workflow
func InsertAudit ¶
func InsertAudit(db gorp.SqlExecutor, a *sdk.AuditWorkflow) error
InsertAudit insert a workflow audit
func InsertHookModel ¶
func InsertHookModel(db gorp.SqlExecutor, m *sdk.WorkflowHookModel) error
InsertHookModel inserts a hook model in database
func InsertNotification ¶
func InsertNotification(db gorp.SqlExecutor, w *sdk.Workflow, n *sdk.WorkflowNotification) error
func InsertOutgoingHookModel ¶
func InsertOutgoingHookModel(db gorp.SqlExecutor, m *sdk.WorkflowHookModel) error
InsertOutgoingHookModel inserts a hook model in database
func InsertRunNum ¶
InsertRunNum Insert run number for the given workflow
func InsertRunSecret ¶
func InsertRunSecret(ctx context.Context, db gorpmapper.SqlExecutorWithTx, wrSecret *sdk.WorkflowRunSecret) error
func InsertWorkflowData ¶
func InsertWorkflowData(db gorp.SqlExecutor, w *sdk.Workflow) error
InsertWorkflowData insert workflow data
func InsertWorkflowRunTags ¶
func InsertWorkflowRunTags(db gorp.SqlExecutor, runID int64, runTags []sdk.WorkflowRunTag) error
InsertWorkflowRunTags inserts new tags in database
func IsDeploymentIntegrationUsed ¶
func IsDeploymentIntegrationUsed(db gorp.SqlExecutor, projectID int64, appID int64, pfName string) (bool, error)
IsDeploymentIntegrationUsed checks if a deployment integration is used on any workflow
func IsFavorite ¶
func LabelWorkflow ¶
func LabelWorkflow(db gorp.SqlExecutor, labelID, workflowID int64) error
LabelWorkflow link a label on a workflow given his workflow id
func Load ¶
func Load(ctx context.Context, db gorp.SqlExecutor, _ cache.Store, proj sdk.Project, name string, opts LoadOptions) (*sdk.Workflow, error)
Load loads a workflow for a given user (ie. checking permissions)
func LoadAll ¶
LoadAll loads all workflows for a project. All users in a project can list all workflows in a project
func LoadAllByIDs ¶
LoadAllByIDs returns all workflows by ids.
func LoadAllHooks ¶
func LoadAllHooks(db gorp.SqlExecutor) ([]sdk.NodeHook, error)
LoadAllHooks returns all hooks
func LoadAllNames ¶
LoadAllNames loads all workflow names for a project.
func LoadAllNamesByProjectIDs ¶
func LoadAllNamesByProjectIDs(_ context.Context, db gorp.SqlExecutor, projectIDs []int64) ([]sdk.WorkflowName, error)
LoadAllNamesByProjectIDs returns all workflow for given project ids.
func LoadAndLockNodeJobRunSkipLocked ¶
func LoadAndLockNodeJobRunSkipLocked(ctx context.Context, db gorp.SqlExecutor, store cache.Store, id int64) (*sdk.WorkflowNodeJobRun, error)
LoadAndLockNodeJobRunSkipLocked load for update a NodeJobRun given its ID
func LoadAndLockNodeJobRunWait ¶
func LoadAndLockNodeJobRunWait(ctx context.Context, db gorp.SqlExecutor, store cache.Store, id int64) (*sdk.WorkflowNodeJobRun, error)
LoadAndLockNodeJobRunWait load for update a NodeJobRun given its ID
func LoadAndLockNodeRunByID ¶
func LoadAndLockNodeRunByID(ctx context.Context, db gorp.SqlExecutor, id int64) (*sdk.WorkflowNodeRun, error)
LoadAndLockNodeRunByID load and lock a specific node run on a workflow
func LoadAndLockNodeRunByJobID ¶
func LoadAndLockNodeRunByJobID(ctx context.Context, db gorp.SqlExecutor, jobID int64) (*sdk.WorkflowNodeRun, error)
LoadAndLockNodeRunByJobID load and lock a specific node run on a workflow
func LoadAndLockRunByID ¶
func LoadAndLockRunByID(ctx context.Context, db gorp.SqlExecutor, id int64, loadOpts LoadRunOptions) (*sdk.WorkflowRun, error)
LoadAndLockRunByID loads run by ID
func LoadAndLockRunByJobID ¶
func LoadAndLockRunByJobID(ctx context.Context, db gorp.SqlExecutor, id int64, loadOpts LoadRunOptions) (*sdk.WorkflowRun, error)
LoadAndLockRunByJobID loads a run by a job id
func LoadAndLockTerminatedNodeJobRun ¶ added in v0.53.1
func LoadAndLockTerminatedNodeJobRun(ctx context.Context, db gorp.SqlExecutor, limit int) ([]sdk.WorkflowNodeJobRun, error)
func LoadApplicationSecrets ¶
func LoadAudit ¶
func LoadAudit(db gorp.SqlExecutor, auditID int64, workflowID int64) (sdk.AuditWorkflow, error)
LoadAudit Load audit for the given workflow
func LoadAudits ¶
func LoadAudits(db gorp.SqlExecutor, workflowID int64) ([]sdk.AuditWorkflow, error)
LoadAudits Load audits for the given workflow
func LoadByApplicationName ¶
func LoadByApplicationName(ctx context.Context, db gorp.SqlExecutor, projectKey string, appName string) ([]sdk.WorkflowName, error)
LoadByApplicationName loads a workflow for a given project key and application name
func LoadByEnvName ¶
func LoadByEnvName(ctx context.Context, db gorp.SqlExecutor, projectKey string, envName string) ([]sdk.WorkflowName, error)
LoadByEnvName loads a workflow for a given project key and environment name (ie. checking permissions)
func LoadByID ¶
func LoadByID(ctx context.Context, db gorp.SqlExecutor, _ cache.Store, proj sdk.Project, id int64, opts LoadOptions) (*sdk.Workflow, error)
LoadByID loads a workflow
func LoadByPipelineName ¶
func LoadByPipelineName(ctx context.Context, db gorp.SqlExecutor, projectKey string, pipName string) ([]sdk.WorkflowName, error)
LoadByPipelineName loads a workflow for a given project key and pipeline name
func LoadByRepo ¶
func LoadByWorkflowTemplateID ¶
func LoadByWorkflowTemplateID(ctx context.Context, db gorp.SqlExecutor, templateID int64) ([]sdk.WorkflowName, error)
LoadByWorkflowTemplateID load all workflow names linked to a workflow template
func LoadCraftingWorkflowRunIDs ¶ added in v0.53.1
func LoadCraftingWorkflowRunIDs(db gorp.SqlExecutor) ([]int64, error)
func LoadCurrentRunNum ¶
func LoadCurrentRunNum(db gorp.SqlExecutor, projectkey, workflowname string) (int64, error)
LoadCurrentRunNum load the current num from workflow_sequences table
func LoadDeadNodeJobRun ¶
func LoadDeadNodeJobRun(ctx context.Context, db gorp.SqlExecutor, store cache.Store) ([]sdk.WorkflowNodeJobRun, error)
LoadDeadNodeJobRun load a NodeJobRun which is Building but without worker
func LoadDecryptSecrets ¶
func LoadDecryptSecrets(ctx context.Context, db gorp.SqlExecutor, wr *sdk.WorkflowRun, nodeRun *sdk.WorkflowNodeRun) (sdk.WorkflowRunSecrets, error)
LoadDecryptSecrets loads all secrets for a job run
func LoadEnvironmentSecrets ¶
func LoadHookByUUID ¶
LoadHookByUUID load a hook by his uuid
func LoadHookModelByID ¶
func LoadHookModelByID(db gorp.SqlExecutor, id int64) (*sdk.WorkflowHookModel, error)
LoadHookModelByID returns a hook model by it's id, if not found, it returns an error
func LoadHookModelByName ¶
func LoadHookModelByName(db gorp.SqlExecutor, name string) (*sdk.WorkflowHookModel, error)
LoadHookModelByName returns a hook model by it's name, if not found, it returns an error
func LoadHookModels ¶
func LoadHookModels(db gorp.SqlExecutor) ([]sdk.WorkflowHookModel, error)
LoadHookModels returns all hook models available
func LoadLabels ¶
LoadLabels return list of labels given a workflow ID
func LoadLastRun ¶
func LoadLastRun(ctx context.Context, db gorp.SqlExecutor, projectkey, workflowname string, loadOpts LoadRunOptions) (*sdk.WorkflowRun, error)
LoadLastRun returns the last run for a workflow
func LoadLastRuns ¶
func LoadLastRuns(ctx context.Context, db gorp.SqlExecutor, workflowIDs []int64, limit int) ([]sdk.WorkflowRun, error)
LoadLastRuns returns the last run per workflowIDs
func LoadNodeJobRun ¶
func LoadNodeJobRun(ctx context.Context, db gorp.SqlExecutor, store cache.Store, id int64) (*sdk.WorkflowNodeJobRun, error)
LoadNodeJobRun load a NodeJobRun given its ID
func LoadNodeJobRunIDByNodeRunID ¶
func LoadNodeJobRunIDByNodeRunID(db gorp.SqlExecutor, runNodeID int64) ([]int64, error)
LoadNodeJobRunIDByNodeRunID Load node run job id by node run id
func LoadNodeJobRunQueue ¶
func LoadNodeJobRunQueue(ctx context.Context, db gorp.SqlExecutor, store cache.Store, filter QueueFilter) ([]sdk.WorkflowNodeJobRun, error)
LoadNodeJobRunQueue load all workflow_node_run_job accessible
func LoadNodeJobRunQueueByGroupIDs ¶
func LoadNodeJobRunQueueByGroupIDs(ctx context.Context, db gorp.SqlExecutor, store cache.Store, filter QueueFilter, groupIDs []int64) ([]sdk.WorkflowNodeJobRun, error)
LoadNodeJobRunQueueByGroupIDs load all workflow_node_run_job accessible
func LoadNodeRun ¶
func LoadNodeRun(db gorp.SqlExecutor, projectkey, workflowname string, noderunID int64, loadOpts LoadRunOptions) (*sdk.WorkflowNodeRun, error)
LoadNodeRun load a specific node run on a workflow
func LoadNodeRunByID ¶
func LoadNodeRunByID(ctx context.Context, db gorp.SqlExecutor, id int64, loadOpts LoadRunOptions) (*sdk.WorkflowNodeRun, error)
LoadNodeRunByID load a specific node run on a workflow
func LoadNodeRunByNodeJobID ¶
func LoadNodeRunByNodeJobID(db gorp.SqlExecutor, nodeJobRunID int64, loadOpts LoadRunOptions) (*sdk.WorkflowNodeRun, error)
LoadNodeRunByNodeJobID load a specific node run on a workflow from a node job run id
func LoadNodeRunDistinctExecutionIDs ¶
func LoadNodeRunDistinctExecutionIDs(db gorp.SqlExecutor) ([]string, error)
func LoadNodeRunJobInfo ¶
func LoadNodeRunJobInfo(ctx context.Context, db gorp.SqlExecutor, nodeRunID int64, jobID int64) ([]sdk.SpawnInfo, error)
LoadNodeRunJobInfo load infos (workflow_node_run_job_infos) for a job (workflow_node_run_job)
func LoadNotificationsByWorkflowIDs ¶
func LoadNotificationsByWorkflowIDs(db gorp.SqlExecutor, ids []int64) (map[int64][]sdk.WorkflowNotification, error)
func LoadOutgoingHookModelByID ¶
func LoadOutgoingHookModelByID(db gorp.SqlExecutor, id int64) (*sdk.WorkflowHookModel, error)
LoadOutgoingHookModelByID returns a hook model by it's id, if not found, it returns an error
func LoadOutgoingHookModelByName ¶
func LoadOutgoingHookModelByName(db gorp.SqlExecutor, name string) (*sdk.WorkflowHookModel, error)
LoadOutgoingHookModelByName returns a hook model by it's name, if not found, it returns an error
func LoadOutgoingHookModels ¶
func LoadOutgoingHookModels(db gorp.SqlExecutor) ([]sdk.WorkflowHookModel, error)
LoadOutgoingHookModels returns all hook models available
func LoadRun ¶
func LoadRun(ctx context.Context, db gorp.SqlExecutor, projectkey, workflowname string, number int64, loadOpts LoadRunOptions) (*sdk.WorkflowRun, error)
LoadRun returns a specific run
func LoadRunByID ¶
func LoadRunByID(ctx context.Context, db gorp.SqlExecutor, id int64, loadOpts LoadRunOptions) (*sdk.WorkflowRun, error)
LoadRunByID loads run by ID
func LoadRunByIDAndProjectKey ¶
func LoadRunByIDAndProjectKey(ctx context.Context, db gorp.SqlExecutor, projectkey string, id int64, loadOpts LoadRunOptions) (*sdk.WorkflowRun, error)
LoadRunByIDAndProjectKey returns a specific run
func LoadRunByJobID ¶
func LoadRunByJobID(ctx context.Context, db gorp.SqlExecutor, id int64, loadOpts LoadRunOptions) (*sdk.WorkflowRun, error)
LoadRunByJobID loads a run by a job id
func LoadRunResultsByNodeRunID ¶
func LoadRunResultsByNodeRunID(ctx context.Context, db gorp.SqlExecutor, nodeRunID int64) (sdk.WorkflowRunResults, error)
func LoadRunResultsByRunID ¶
func LoadRunResultsByRunID(ctx context.Context, db gorp.SqlExecutor, runID int64) (sdk.WorkflowRunResults, error)
func LoadRunResultsByRunIDAndType ¶
func LoadRunResultsByRunIDAndType(ctx context.Context, db gorp.SqlExecutor, runID int64, t sdk.WorkflowRunResultType) (sdk.WorkflowRunResults, error)
func LoadRunResultsByRunIDFilterByIDs ¶ added in v0.52.0
func LoadRunResultsByRunIDFilterByIDs(ctx context.Context, db gorp.SqlExecutor, runID int64, resultIDs ...string) (sdk.WorkflowRunResults, error)
func LoadRunResultsByRunIDUnique ¶ added in v0.52.0
func LoadRunResultsByRunIDUnique(ctx context.Context, db gorp.SqlExecutor, runID int64) (sdk.WorkflowRunResults, error)
func LoadRunsIDByTag ¶
func LoadRunsIDByTag(db gorp.SqlExecutor, projectKey, workflowName, tag, tagValue string) ([]int64, error)
LoadRunsIDByTag load workflow run ids for given tag and his value
func LoadRunsIDsCreatedBefore ¶ added in v0.52.0
func LoadRunsIDsCreatedBefore(ctx context.Context, db gorp.SqlExecutor, date time.Time, limit int64) ([]int64, error)
LoadRunsIDsCreatedBefore returns the first workflow runs created before given date.
func LoadRunsIDsToDelete ¶
func LoadRunsSummaries ¶
func LoadRunsSummaries(ctx context.Context, db gorp.SqlExecutor, projectkey, workflowname string, offset, limit int, tagFilter map[string]string) ([]sdk.WorkflowRunSummary, int, int, int, error)
LoadRunsSummaries loads a short version of workflow runs It returns runs, offset, limit count and an error
func LoadWorkflowFromWorkflowRunID ¶
LoadWorkflowFromWorkflowRunID loads the workflow for the given workfloxw run id
func LoadWorkflowIntegrationsByWorkflowID ¶
func LoadWorkflowIntegrationsByWorkflowID(ctx context.Context, db gorp.SqlExecutor, id int64) ([]sdk.WorkflowProjectIntegration, error)
LoadWorkflowIntegrationsByWorkflowID load workflow integrations by workflowid
func MarkAsDelete ¶
func MarkAsDelete(ctx context.Context, db gorpmapper.SqlExecutorWithTx, cache cache.Store, proj sdk.Project, wkf *sdk.Workflow) error
MarkAsDelete marks a workflow to be deleted
func MarkWorkflowRunsAsDelete ¶
func MarkWorkflowRunsAsDelete(db gorp.SqlExecutor, ids []int64) error
MarkWorkflowRunsAsDelete marks workflow runs to be deleted
func MaxSubNumber ¶
func MaxSubNumber(workflowNodeRuns map[int64][]sdk.WorkflowNodeRun) int64
MaxSubNumber returns the MaxSubNumber of workflowNodeRuns
func NextRunNumber ¶
func NextRunNumber(db gorp.SqlExecutor, workflowID int64) (int64, error)
func NodeBuildParametersFromRun ¶
NodeBuildParametersFromRun return build parameters from previous workflow run
func NodeBuildParametersFromWorkflow ¶
func NodeBuildParametersFromWorkflow(proj sdk.Project, wf *sdk.Workflow, refNode *sdk.Node, ancestorsIds []int64) ([]sdk.Parameter, error)
NodeBuildParametersFromWorkflow returns build_parameters for a node given its id
func Parse ¶
func Parse(ctx context.Context, proj sdk.Project, oldW *sdk.Workflow, ew exportentities.Workflow) (*sdk.Workflow, error)
Parse parse an exportentities.workflow and return the parsed workflow
func ParseAndImport ¶
func ParseAndImport(ctx context.Context, db gorpmapper.SqlExecutorWithTx, store cache.Store, proj sdk.Project, oldW *sdk.Workflow, ew exportentities.Workflow, consumer *sdk.AuthUserConsumer, opts ImportOptions) (*sdk.Workflow, []sdk.Message, error)
ParseAndImport parse an exportentities.workflow and insert or update the workflow in database
func PrepareSpawnInfos ¶
PrepareSpawnInfos helps yoi to create sdk.SpawnInfo array
func PreviousNodeRun ¶
func PreviousNodeRun(db gorp.SqlExecutor, nr sdk.WorkflowNodeRun, nodeName string, workflowID int64) (*sdk.WorkflowNodeRun, error)
PreviousNodeRun find previous node run
func PreviousNodeRunVCSInfos ¶
func PreviousNodeRunVCSInfos(ctx context.Context, db gorp.SqlExecutor, projectKey string, wf sdk.Workflow, nodeName string, current sdk.BuildNumberAndHash, appID int64, envID int64) (sdk.BuildNumberAndHash, error)
PreviousNodeRunVCSInfos returns a struct with BuildNumber, Commit Hash, Branch, Remote, Remote_url for the current node run and the previous one on the same branch. Returned value may be zero if node run are not found If you don't have environment linked set envID to 0 or -1
func ProcessRunResultPromotionByRunID ¶ added in v0.52.0
func ProcessRunResultPromotionByRunID(ctx context.Context, db gorpmapper.SqlExecutorWithTx, workflowRunID int64, promotionType sdk.WorkflowRunResultPromotionType, promotionRequest sdk.WorkflowRunResultPromotionRequest) error
func Pull ¶
func Pull(ctx context.Context, db gorp.SqlExecutor, cache cache.Store, proj sdk.Project, name string, encryptFunc sdk.EncryptFunc, opts ...v2.ExportOptions) (exportentities.WorkflowComponents, error)
Pull a workflow with all it dependencies; it writes a tar buffer in the writer
func PurgeAllWorkflowRunsByWorkflowID ¶
func PurgeAllWorkflowRunsByWorkflowID(ctx context.Context, db gorp.SqlExecutor, id int64) (int, error)
PurgeAllWorkflowRunsByWorkflowID marks all workflow to delete given a workflow
func PurgeAudits ¶
func PurgeAudits(ctx context.Context, db gorp.SqlExecutor) error
func PurgeWorkflowRun ¶
PurgeWorkflowRun mark all workflow run to delete
func ReadCDSFiles ¶
ReadCDSFiles reads CDS files
func RemoveIntegrationFromWorkflow ¶
func RemoveIntegrationFromWorkflow(db gorp.SqlExecutor, workflowInteg sdk.WorkflowProjectIntegration) error
RemoveIntegrationFromWorkflow remove a project integration on a workflow
func RenameNode ¶
func Resync ¶
func Resync(ctx context.Context, db gorp.SqlExecutor, store cache.Store, proj sdk.Project, wr *sdk.WorkflowRun) error
Resync a workflow in the given workflow run
func ResyncCommitStatus ¶
func ResyncCommitStatus(ctx context.Context, db *gorp.DbMap, store cache.Store, proj sdk.Project, wr *sdk.WorkflowRun, cdsUIURL string) error
ResyncCommitStatus resync commit status for a workflow run
func ResyncNodeRunsWithCommits ¶
func ResyncNodeRunsWithCommits(ctx context.Context, db *gorp.DbMap, store cache.Store, proj sdk.Project, report *ProcessorReport)
ResyncNodeRunsWithCommits load commits build in this node run and save it into node run
func ResyncWorkflowRunResultsRoutine ¶ added in v0.52.0
func SetMaxRuns ¶
func SetMaxRuns(confMaxRuns int64)
func SetRunReadOnlyByID ¶ added in v0.52.0
func SetRunReadOnlyByID(ctx context.Context, db gorpmapper.SqlExecutorWithTx, workflowRunID int64) error
SetRunReadOnly set read only flag of a workflow run, this run cannot be restarted anymore.
func SyncNodeRunRunJob ¶
func SyncNodeRunRunJob(ctx context.Context, db gorp.SqlExecutor, nodeRun *sdk.WorkflowNodeRun, nodeJobRun sdk.WorkflowNodeJobRun) (bool, error)
SyncNodeRunRunJob sync step status and spawnInfos in a specific run job
func SyncRunResultArtifactManagerByRunID ¶ added in v0.52.0
func SyncRunResultArtifactManagerByRunID(ctx context.Context, db gorpmapper.SqlExecutorWithTx, workflowRunID int64) error
func UnLabelWorkflow ¶
func UnLabelWorkflow(db gorp.SqlExecutor, labelID, workflowID int64) error
UnLabelWorkflow unlink a label on a workflow given his workflow id
func Update ¶
func Update(ctx context.Context, db gorpmapper.SqlExecutorWithTx, store cache.Store, proj sdk.Project, wf *sdk.Workflow, uptOption UpdateOptions) error
Update updates a workflow
func UpdateCraftedWorkflowRun ¶
func UpdateCraftedWorkflowRun(db gorp.SqlExecutor, id int64) error
func UpdateFavorite ¶
UpdateFavorite add or delete workflow from user favorites
func UpdateFromRepository ¶
func UpdateFromRepository(db gorp.SqlExecutor, workflowID int64, fromRepository string) error
UpdateFromRepository update the from_repository of a workflow
func UpdateHookModel ¶
func UpdateHookModel(db gorp.SqlExecutor, m *sdk.WorkflowHookModel) error
UpdateHookModel updates a hook model in database
func UpdateIcon ¶
func UpdateIcon(db gorp.SqlExecutor, workflowID int64, icon string) error
UpdateIcon update the icon of a workflow
func UpdateMaxRunsByID ¶
func UpdateMaxRunsByID(db gorp.SqlExecutor, workflowID int64, maxRuns int64) error
func UpdateMetadata ¶
UpdateMetadata update the metadata of a workflow
func UpdateNodeJobRun ¶
func UpdateNodeJobRun(ctx context.Context, db gorp.SqlExecutor, j *sdk.WorkflowNodeJobRun) error
UpdateNodeJobRun updates a workflow_node_run_job
func UpdateNodeRun ¶
func UpdateNodeRun(db gorp.SqlExecutor, n *sdk.WorkflowNodeRun) error
UpdateNodeRun updates in table workflow_node_run
func UpdateNodeRunBuildParameters ¶
func UpdateNodeRunBuildParameters(db gorp.SqlExecutor, nodeID int64, buildParameters []sdk.Parameter) error
UpdateNodeRunBuildParameters updates build_parameters in table workflow_node_run
func UpdateNodeRunStatusAndStage ¶
func UpdateNodeRunStatusAndStage(db gorp.SqlExecutor, nodeRun *sdk.WorkflowNodeRun) error
UpdateNodeRunStatusAndStage update just noderun status and stage
func UpdateOutgoingHookModel ¶
func UpdateOutgoingHookModel(db gorp.SqlExecutor, m *sdk.WorkflowHookModel) error
UpdateOutgoingHookModel updates a hook model in database
func UpdateRunNum ¶
UpdateRunNum Update run number for the given workflow
func UpdateRunResult ¶ added in v0.52.0
func UpdateRunResult(ctx context.Context, db gorp.SqlExecutor, result *sdk.WorkflowRunResult) error
func UpdateWorkflowRun ¶
func UpdateWorkflowRun(ctx context.Context, db gorp.SqlExecutor, wr *sdk.WorkflowRun) error
UpdateWorkflowRun updates in table "workflow_run""
func UpdateWorkflowRunStatus ¶
func UpdateWorkflowRunStatus(db gorp.SqlExecutor, wr *sdk.WorkflowRun) error
UpdateWorkflowRunStatus update status of a workflow run
func UpdateWorkflowRunTags ¶
func UpdateWorkflowRunTags(db gorp.SqlExecutor, r *sdk.WorkflowRun) error
UpdateWorkflowRunTags updates new tags in database
func UserFavoriteWorkflowIDs ¶
func UserFavoriteWorkflowIDs(db gorp.SqlExecutor, uID string) ([]int64, error)
UserFavoriteWorkflowIDs returns the list of workflow ID
Types ¶
type ArtifactSignature ¶ added in v0.53.0
type ImportOptions ¶
type ImportOptions struct { Force bool WorkflowName string FromRepository string IsDefaultBranch bool FromBranch string VCSServer string RepositoryName string RepositoryStrategy sdk.RepositoryStrategy HookUUID string }
ImportOptions is option to parse a workflow
type JobRun ¶
type JobRun struct { ProjectID int64 `db:"project_id"` ID int64 `db:"id"` WorkflowNodeRunID int64 `db:"workflow_node_run_id"` Job sql.NullString `db:"job"` Parameters sql.NullString `db:"variables"` Status string `db:"status"` Retry int `db:"retry"` Queued time.Time `db:"queued"` Start time.Time `db:"start"` Done time.Time `db:"done"` Model string `db:"model"` ExecGroups sql.NullString `db:"exec_groups"` BookedBy sdk.BookedBy `db:"-"` Region *string `db:"region"` ContainsService bool `db:"contains_service"` ModelType sql.NullString `db:"model_type"` Header sql.NullString `db:"header"` HatcheryName string `db:"hatchery_name"` WorkerName string `db:"worker_name"` IntegrationPlugins sql.NullString `db:"integration_plugins"` Contexts sdk.JobRunContext `db:"contexts"` }
JobRun is a gorp wrapper around sdk.WorkflowNodeJobRun
func (*JobRun) ToJobRun ¶
func (j *JobRun) ToJobRun(jr *sdk.WorkflowNodeJobRun) (err error)
ToJobRun transform the JobRun with data of the provided sdk.WorkflowNodeJobRun
func (JobRun) WorkflowNodeRunJob ¶
func (j JobRun) WorkflowNodeRunJob() (sdk.WorkflowNodeJobRun, error)
WorkflowNodeRunJob returns a sdk.WorkflowNodeRunJob
type LoadOptions ¶
type LoadOptions struct { Minimal bool DeepPipeline bool WithLabels bool WithIcon bool WithAsCodeUpdateEvent bool WithIntegrations bool WithTemplate bool WithFavoritesForUserID string }
LoadOptions custom option for loading workflow
func (LoadOptions) GetWorkflowDAO ¶
func (loadOpts LoadOptions) GetWorkflowDAO() WorkflowDAO
type LoadRunOptions ¶
type LoadRunOptions struct { WithTests bool WithLightTests bool WithDeleted bool DisableDetailledNodeRun bool }
LoadRunOptions are options for loading a run (node or workflow)
type NodeRun ¶
type NodeRun struct { WorkflowID sql.NullInt64 `db:"workflow_id"` WorkflowRunID int64 `db:"workflow_run_id"` ApplicationID sql.NullInt64 `db:"application_id"` ID int64 `db:"id"` WorkflowNodeID int64 `db:"workflow_node_id"` WorkflowNodeName string `db:"workflow_node_name"` Number int64 `db:"num"` SubNumber int64 `db:"sub_num"` Status string `db:"status"` Start time.Time `db:"start"` Done time.Time `db:"done"` LastModified time.Time `db:"last_modified"` HookEvent sql.NullString `db:"hook_event"` Manual sql.NullString `db:"manual"` SourceNodeRuns sql.NullString `db:"source_node_runs"` Payload sql.NullString `db:"payload"` PipelineParameters sql.NullString `db:"pipeline_parameters"` BuildParameters sql.NullString `db:"build_parameters"` Tests sql.NullString `db:"tests"` Commits sql.NullString `db:"commits"` Stages sql.NullString `db:"stages"` TriggersRun sql.NullString `db:"triggers_run"` VCSRepository sql.NullString `db:"vcs_repository"` VCSBranch sql.NullString `db:"vcs_branch"` VCSTag sql.NullString `db:"vcs_tag"` VCSHash sql.NullString `db:"vcs_hash"` VCSServer sql.NullString `db:"vcs_server"` Header sql.NullString `db:"header"` UUID sql.NullString `db:"uuid"` OutgoingHook sql.NullString `db:"outgoinghook"` HookExecutionTimestamp sql.NullInt64 `db:"hook_execution_timestamp"` ExecutionID sql.NullString `db:"execution_id"` Callback sql.NullString `db:"callback"` Contexts sdk.NodeRunContext `db:"contexts"` }
NodeRun is a gorp wrapper around sdk.WorkflowNodeRun
type Notification ¶
type Notification sdk.WorkflowNotification
Notification is a gorp wrapper around sdk.WorkflowNotification
func (*Notification) PostGet ¶
func (no *Notification) PostGet(db gorp.SqlExecutor) error
PostGet is a db hook
func (*Notification) PostInsert ¶
func (no *Notification) PostInsert(db gorp.SqlExecutor) error
PostInsert is a db hook
type ProcessorReport ¶
type ProcessorReport struct {
// contains filtered or unexported fields
}
ProcessorReport represents the state of the workflow processor
func ResyncWorkflowRunStatus ¶
func ResyncWorkflowRunStatus(ctx context.Context, db gorp.SqlExecutor, wr *sdk.WorkflowRun) (*ProcessorReport, error)
ResyncWorkflowRunStatus resync the status of workflow if you stop a node run when workflow run is building
func StartWorkflowRun ¶
func StartWorkflowRun(ctx context.Context, db gorpmapper.SqlExecutorWithTx, store cache.Store, proj sdk.Project, wr *sdk.WorkflowRun, opts *sdk.WorkflowRunPostHandlerOption, u sdk.AuthUserConsumer, asCodeInfos []sdk.Message) (*ProcessorReport, error)
func StopWorkflowNodeRun ¶
func StopWorkflowNodeRun(ctx context.Context, dbFunc func() *gorp.DbMap, store cache.Store, proj sdk.Project, workflowRun sdk.WorkflowRun, workflowNodeRun sdk.WorkflowNodeRun, stopInfos sdk.SpawnInfo) (*ProcessorReport, error)
StopWorkflowNodeRun to stop a workflow node run with a specific spawn info
func TakeNodeJobRun ¶
func TakeNodeJobRun(ctx context.Context, db gorpmapper.SqlExecutorWithTx, store cache.Store, proj sdk.Project, jobID int64, workerModel, workerName, workerID string, infos []sdk.SpawnInfo, hatcheryName string) (*sdk.WorkflowNodeJobRun, *ProcessorReport, error)
TakeNodeJobRun Take an a job run for update
func UpdateNodeJobRunStatus ¶
func UpdateNodeJobRunStatus(ctx context.Context, db gorpmapper.SqlExecutorWithTx, store cache.Store, proj sdk.Project, job *sdk.WorkflowNodeJobRun, status string) (*ProcessorReport, error)
UpdateNodeJobRunStatus Update status of an workflow_node_run_job.
func UpdateOutgoingHookRunStatus ¶
func UpdateOutgoingHookRunStatus(ctx context.Context, db gorpmapper.SqlExecutorWithTx, store cache.Store, proj sdk.Project, wr *sdk.WorkflowRun, hookRunID string, callback sdk.WorkflowNodeOutgoingHookRunCallback) (*ProcessorReport, error)
UpdateOutgoingHookRunStatus updates the status and callback of a outgoing hook run, and then it reprocess the whole workflow
func UpdateParentWorkflowRun ¶
func UpdateParentWorkflowRun(ctx context.Context, tx gorpmapper.SqlExecutorWithTx, store cache.Store, wr *sdk.WorkflowRun, parentProj sdk.Project, parentWR *sdk.WorkflowRun) (*ProcessorReport, error)
UpdateParentWorkflowRun updates the workflow which triggered the current workflow
func (*ProcessorReport) Add ¶
func (r *ProcessorReport) Add(ctx context.Context, i ...interface{})
Add something to the report
func (*ProcessorReport) All ¶
func (r *ProcessorReport) All() []interface{}
All returns all the objects in the reports
func (*ProcessorReport) Jobs ¶
func (r *ProcessorReport) Jobs() []sdk.WorkflowNodeJobRun
func (*ProcessorReport) Merge ¶
func (r *ProcessorReport) Merge(ctx context.Context, r1 *ProcessorReport)
Merge to the provided report and the current report
func (*ProcessorReport) Nodes ¶
func (r *ProcessorReport) Nodes() []sdk.WorkflowNodeRun
func (*ProcessorReport) WorkflowRuns ¶
func (r *ProcessorReport) WorkflowRuns() []sdk.WorkflowRun
WorkflowRuns returns the list of concerned workflow runs
func (*ProcessorReport) Workflows ¶
func (r *ProcessorReport) Workflows() []sdk.WorkflowRun
type PushOption ¶
type PushOption struct { VCSServer string FromRepository string Branch string IsDefaultBranch bool RepositoryName string RepositoryStrategy sdk.RepositoryStrategy HookUUID string Force bool OldWorkflow sdk.Workflow }
PushOption is the set of options for workflow push
type PushSecrets ¶
type PushSecrets struct { ApplicationsSecrets map[int64][]sdk.Variable EnvironmentdSecrets map[int64][]sdk.Variable }
func CreateFromRepository ¶
func CreateFromRepository(ctx context.Context, db *gorp.DbMap, store cache.Store, p *sdk.Project, wf *sdk.Workflow, opts sdk.WorkflowRunPostHandlerOption, u sdk.AuthUserConsumer, decryptFunc keys.DecryptFunc, emailFunc keys.EmailFunc) (*PushSecrets, []sdk.Message, error)
CreateFromRepository a workflow from a repository.
func Push ¶
func Push(ctx context.Context, db *gorp.DbMap, store cache.Store, proj *sdk.Project, data exportentities.WorkflowComponents, opts *PushOption, consumer *sdk.AuthUserConsumer, decryptFunc keys.DecryptFunc, emailFunc keys.EmailFunc) ([]sdk.Message, *sdk.Workflow, *sdk.Workflow, *PushSecrets, error)
Push push a workflow from cds files
func RetrieveSecrets ¶
func RetrieveSecrets(ctx context.Context, db gorp.SqlExecutor, wf sdk.Workflow) (*PushSecrets, error)
type QueueFilter ¶
type QueueFilter struct { ModelType []string Rights int Since *time.Time Until *time.Time Limit *int Statuses []string Regions []string SkipBooked bool }
QueueFilter contains all criteria used to fetch queue
func NewQueueFilter ¶
func NewQueueFilter() QueueFilter
type Run ¶
type Run sdk.WorkflowRun
Run is a gorp wrapper around sdk.WorkflowRun
func (*Run) PostInsert ¶
func (r *Run) PostInsert(db gorp.SqlExecutor) error
PostInsert is a db hook on WorkflowRun
func (*Run) PostUpdate ¶
func (r *Run) PostUpdate(db gorp.SqlExecutor) error
PostUpdate is a db hook on WorkflowRun
type UpdateOptions ¶
type UpdateOptions struct {
DisableHookManagement bool
}
UpdateOptions is option to parse a workflow
type VCSEventMessenger ¶
type VCSEventMessenger struct {
// contains filtered or unexported fields
}
func (*VCSEventMessenger) SendVCSEvent ¶
func (e *VCSEventMessenger) SendVCSEvent(ctx context.Context, db *gorp.DbMap, store cache.Store, proj sdk.Project, wr sdk.WorkflowRun, nodeRun sdk.WorkflowNodeRun, cdsUIURL string) error
type Workflow ¶
Workflow is a gorp wrapper around sdk.WorkflowData
func (*Workflow) PostGet ¶
func (w *Workflow) PostGet(db gorp.SqlExecutor) error
PostGet is a db hook
func (*Workflow) PostInsert ¶
func (w *Workflow) PostInsert(db gorp.SqlExecutor) error
PostInsert is a db hook
func (*Workflow) PostUpdate ¶
func (w *Workflow) PostUpdate(db gorp.SqlExecutor) error
PostUpdate is a db hook
type WorkflowDAO ¶
type WorkflowDAO struct { Filters LoadAllWorkflowsOptionsFilters Loaders LoadAllWorkflowsOptionsLoaders Offset int Limit int Ascending bool Lock bool }
func (WorkflowDAO) GetLoaders ¶
func (dao WorkflowDAO) GetLoaders() []gorpmapping.GetOptionFunc
func (WorkflowDAO) Load ¶
func (dao WorkflowDAO) Load(ctx context.Context, db gorp.SqlExecutor) (sdk.Workflow, error)
func (WorkflowDAO) LoadAll ¶
func (dao WorkflowDAO) LoadAll(ctx context.Context, db gorp.SqlExecutor) (sdk.Workflows, error)
func (WorkflowDAO) Query ¶
func (dao WorkflowDAO) Query() gorpmapping.Query
Source Files ¶
- audit.go
- dao.go
- dao_audit.go
- dao_data.go
- dao_data_context.go
- dao_data_hook.go
- dao_data_join.go
- dao_data_outgoing_hook.go
- dao_data_trigger.go
- dao_hook_model.go
- dao_label.go
- dao_node.go
- dao_node_job_run_info.go
- dao_node_run.go
- dao_node_run_job.go
- dao_notification.go
- dao_outgoing_hook_model.go
- dao_run.go
- dao_run_secret.go
- dao_workflow_favorite.go
- dao_workflow_integration.go
- dao_workflow_template_instance.go
- dao_workflow_usage.go
- execute_node_job_run.go
- execute_node_run.go
- execute_outgoing_hook_run.go
- factory_dao.go
- gorp_model.go
- heartbeat.go
- hook.go
- init.go
- process.go
- process_data.go
- process_node.go
- process_outgoinghook.go
- process_parameters.go
- process_requirements.go
- process_start.go
- repository.go
- resync_workflow.go
- run_workflow.go
- sort.go
- workflow_exporter.go
- workflow_importer.go
- workflow_parser.go
- workflow_run_event.go
- workflow_run_results.go
- workflow_secrets.go