workflow_v2

package
v0.56.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2025 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WorkflowEngineKey = "workflow:engine"
)

Variables

This section is empty.

Functions

func CountAllRuns added in v0.55.0

func CountAllRuns(ctx context.Context, db gorp.SqlExecutor, filters SearchRunsFilters) (int64, error)

func CountBlockedRunWithProjectConcurrency added in v0.55.2

func CountBlockedRunWithProjectConcurrency(ctx context.Context, db gorp.SqlExecutor, proj string, concurrencyName string) (int64, error)

func CountBlockedWithWorkflowConcurrency added in v0.55.2

func CountBlockedWithWorkflowConcurrency(ctx context.Context, db gorp.SqlExecutor, proj string, vcs string, repo string, workflow string, concurrencyName string) (int64, error)

func CountRunJobsByProjectStatusAndRegions added in v0.55.0

func CountRunJobsByProjectStatusAndRegions(ctx context.Context, db gorp.SqlExecutor, pkeys []string, statusFilter []sdk.V2WorkflowRunJobStatus, regionsFilter []string) (int64, error)

func CountRunningWithProjectConcurrency added in v0.55.2

func CountRunningWithProjectConcurrency(ctx context.Context, db gorp.SqlExecutor, proj string, concurrencyName string) (int64, error)

func CountRunningWithWorkflowConcurrency added in v0.55.2

func CountRunningWithWorkflowConcurrency(ctx context.Context, db gorp.SqlExecutor, proj string, vcs string, repo string, workflow string, concurrencyName string) (int64, error)

func CountRuns added in v0.53.1

func CountRuns(ctx context.Context, db gorp.SqlExecutor, projKey string, filters SearchRunsFilters) (int64, error)

func DeleteRunByID added in v0.55.0

func DeleteRunByID(db gorp.SqlExecutor, id string) error

func DeleteWorkflowHookByID added in v0.55.2

func DeleteWorkflowHookByID(ctx context.Context, db gorpmapper.SqlExecutorWithTx, hookID string) error

func DeleteWorkflowVersion added in v0.55.0

func DeleteWorkflowVersion(ctx context.Context, db gorpmapper.SqlExecutorWithTx, v *sdk.V2WorkflowVersion) error

func InsertRunResult added in v0.53.1

func InsertRunResult(ctx context.Context, db gorp.SqlExecutor, runResult *sdk.V2WorkflowRunResult) error

func InsertWorkflowHook added in v0.53.1

func InsertWorkflowHook(ctx context.Context, db gorpmapper.SqlExecutorWithTx, h *sdk.V2WorkflowHook) error

func InsertWorkflowVersion added in v0.55.0

func InsertWorkflowVersion(ctx context.Context, db gorpmapper.SqlExecutorWithTx, v *sdk.V2WorkflowVersion) error

func LoadAbandonnedRunResultsID added in v0.53.1

func LoadAbandonnedRunResultsID(ctx context.Context, db gorp.SqlExecutor) ([]string, error)

func LoadAllHooksUnsafe added in v0.53.1

func LoadAllHooksUnsafe(ctx context.Context, db gorp.SqlExecutor) ([]sdk.V2WorkflowHook, error)

func LoadAllVerionsByWorkflow added in v0.55.0

func LoadAllVerionsByWorkflow(ctx context.Context, db gorp.SqlExecutor, projKey, vcs, repository, wkf string) ([]sdk.V2WorkflowVersion, error)

func LoadAndLockRunByID added in v0.55.0

func LoadAndLockRunByID(ctx context.Context, db gorp.SqlExecutor, id string, opts ...gorpmapper.GetOptionFunc) (*sdk.V2WorkflowRun, error)

func LoadAndLockRunResultByID added in v0.53.1

func LoadAndLockRunResultByID(ctx context.Context, db gorp.SqlExecutor, id string) (*sdk.V2WorkflowRunResult, error)

func LoadBuildingRunWithEndedJobs

func LoadBuildingRunWithEndedJobs(ctx context.Context, db gorp.SqlExecutor, opts ...gorpmapper.GetAllOptionFunc) ([]sdk.V2WorkflowRun, error)

func LoadCratingWorkflowRunIDs

func LoadCratingWorkflowRunIDs(db gorp.SqlExecutor) ([]string, error)

func LoadDeadJobs

func LoadDeadJobs(ctx context.Context, db gorp.SqlExecutor) ([]sdk.V2WorkflowRunJob, error)

func LoadHeadHookToMigrate added in v0.55.2

func LoadHeadHookToMigrate(ctx context.Context, db gorp.SqlExecutor) ([]sdk.V2WorkflowHook, error)

Deprecated

func LoadHookByWorkflowAndType added in v0.55.2

func LoadHookByWorkflowAndType(ctx context.Context, db gorp.SqlExecutor, projKey, vcsName, repoName, workflowName string, hookType string) ([]sdk.V2WorkflowHook, error)

func LoadHookHeadPullRequestHookByWorkflowAndEvent added in v0.55.2

func LoadHookHeadPullRequestHookByWorkflowAndEvent(ctx context.Context, db gorp.SqlExecutor, vcsName, repoName string) ([]sdk.V2WorkflowHook, error)

func LoadHookHeadRepositoryWebHookByWorkflowAndEvent added in v0.55.0

func LoadHookHeadRepositoryWebHookByWorkflowAndEvent(ctx context.Context, db gorp.SqlExecutor, projKey, vcsName, repoName, workflowName string, eventName sdk.WorkflowHookEventName, ref string) (*sdk.V2WorkflowHook, error)

func LoadHooksByEntityID added in v0.55.0

func LoadHooksByEntityID(ctx context.Context, db gorp.SqlExecutor, entityID string) ([]sdk.V2WorkflowHook, error)

func LoadHooksByID added in v0.55.0

func LoadHooksByID(ctx context.Context, db gorp.SqlExecutor, hookID string) (*sdk.V2WorkflowHook, error)

func LoadHooksByModelUpdated added in v0.53.1

func LoadHooksByModelUpdated(ctx context.Context, db gorp.SqlExecutor, ref string, models []string) ([]sdk.V2WorkflowHook, error)

func LoadHooksByRepositoryEvent added in v0.53.1

func LoadHooksByRepositoryEvent(ctx context.Context, db gorp.SqlExecutor, vcsName, repoName string, eventName sdk.WorkflowHookEventName) ([]sdk.V2WorkflowHook, error)

func LoadHooksByWorkflowUpdated added in v0.53.1

func LoadHooksByWorkflowUpdated(ctx context.Context, db gorp.SqlExecutor, projKey, vcsName, repoName, workflowName, ref string) (*sdk.V2WorkflowHook, error)

func LoadHooksWorkflowRunByListeningWorkflow added in v0.55.2

func LoadHooksWorkflowRunByListeningWorkflow(ctx context.Context, db gorp.SqlExecutor, workflowName string) ([]sdk.V2WorkflowHook, error)

func LoadOldHeadHooksByVCSAndRepoAndRefAndWorkflow added in v0.55.2

func LoadOldHeadHooksByVCSAndRepoAndRefAndWorkflow(ctx context.Context, db gorp.SqlExecutor, projectKey, vcsName, repoName, ref, workflowName string) ([]sdk.V2WorkflowHook, error)

Deprecated

func LoadOldScheduledRunJob

func LoadOldScheduledRunJob(ctx context.Context, db gorp.SqlExecutor, timeout int64) ([]sdk.V2WorkflowRunJob, error)

func LoadOldWaitingRunJob added in v0.55.1

func LoadOldWaitingRunJob(ctx context.Context, db gorp.SqlExecutor, timeout int64) ([]sdk.V2WorkflowRunJob, error)

func LoadOlderRuns added in v0.56.0

func LoadOlderRuns(ctx context.Context, db gorp.SqlExecutor, projKey, vcs, repo, workflow, ref string, days int64) ([]string, error)

func LoadProjectConccurencyRunObjects added in v0.55.2

func LoadProjectConccurencyRunObjects(ctx context.Context, db gorp.SqlExecutor, proj string, concurrencyName string) ([]sdk.ProjectConcurrencyRunObject, error)

func LoadQueuedRunJobByModelTypeAndRegionAndModelOSArch added in v0.55.1

func LoadQueuedRunJobByModelTypeAndRegionAndModelOSArch(ctx context.Context, db gorp.SqlExecutor, regionName string, modelType string, modelOSArch []string) ([]sdk.V2WorkflowRunJob, error)

func LoadRunByProjectKeyAndID added in v0.53.1

func LoadRunByProjectKeyAndID(ctx context.Context, db gorp.SqlExecutor, projectKey, id string, opts ...gorpmapper.GetOptionFunc) (*sdk.V2WorkflowRun, error)

func LoadRunByRunNumber

func LoadRunByRunNumber(ctx context.Context, db gorp.SqlExecutor, projectKey, vcsServerID, repositoryID, wfName string, runNumber int64, opts ...gorpmapper.GetOptionFunc) (*sdk.V2WorkflowRun, error)

func LoadRunIDsToDelete added in v0.55.0

func LoadRunIDsToDelete(ctx context.Context, db gorp.SqlExecutor) ([]string, error)

func LoadRunInfosByRunID

func LoadRunInfosByRunID(ctx context.Context, db gorp.SqlExecutor, runID string) ([]sdk.V2WorkflowRunInfo, error)

func LoadRunJobByID

func LoadRunJobByID(ctx context.Context, db gorp.SqlExecutor, jobRunID string) (*sdk.V2WorkflowRunJob, error)

func LoadRunJobByRunIDAndID added in v0.53.1

func LoadRunJobByRunIDAndID(ctx context.Context, db gorp.SqlExecutor, wrID, jobRunID string) (*sdk.V2WorkflowRunJob, error)

func LoadRunJobInfosByRunJobID added in v0.53.1

func LoadRunJobInfosByRunJobID(ctx context.Context, db gorp.SqlExecutor, runJobID string) ([]sdk.V2WorkflowRunJobInfo, error)

func LoadRunJobsByName added in v0.55.0

func LoadRunJobsByName(ctx context.Context, db gorp.SqlExecutor, wrID string, jobName string, runAttempt int64) ([]sdk.V2WorkflowRunJob, error)

func LoadRunJobsByProjectStatusAndRegions added in v0.55.0

func LoadRunJobsByProjectStatusAndRegions(ctx context.Context, db gorp.SqlExecutor, pkeys []string, statusFilter []sdk.V2WorkflowRunJobStatus, regionsFilter []string, offset int, limit int) ([]sdk.V2WorkflowRunJob, error)

func LoadRunJobsByRunID

func LoadRunJobsByRunID(ctx context.Context, db gorp.SqlExecutor, runID string, runAttempt int64) ([]sdk.V2WorkflowRunJob, error)

func LoadRunJobsByRunIDAndStatus

func LoadRunJobsByRunIDAndStatus(ctx context.Context, db gorp.SqlExecutor, runID string, status []string, runAttempt int64) ([]sdk.V2WorkflowRunJob, error)

func LoadRunResult added in v0.53.1

func LoadRunResult(ctx context.Context, db gorp.SqlExecutor, runID string, id string) (*sdk.V2WorkflowRunResult, error)

func LoadRunResultsByRunID added in v0.53.1

func LoadRunResultsByRunID(ctx context.Context, db gorp.SqlExecutor, runID string) ([]sdk.V2WorkflowRunResult, error)

func LoadRunResultsByRunIDAttempt added in v0.55.0

func LoadRunResultsByRunIDAttempt(ctx context.Context, db gorp.SqlExecutor, runID string, runAttempt int64) ([]sdk.V2WorkflowRunResult, error)

func LoadRunResultsByRunJobID added in v0.53.1

func LoadRunResultsByRunJobID(ctx context.Context, db gorp.SqlExecutor, runJobID string) ([]sdk.V2WorkflowRunResult, error)

func LoadRuns

func LoadRuns(ctx context.Context, db gorp.SqlExecutor, projKey, vcsProjectID, repoID, workflowName string, opts ...gorpmapper.GetAllOptionFunc) ([]sdk.V2WorkflowRun, error)

func LoadRunsActors added in v0.53.1

func LoadRunsActors(ctx context.Context, db gorp.SqlExecutor, projKey string) ([]string, error)

func LoadRunsAuthors added in v0.56.0

func LoadRunsAuthors(ctx context.Context, db gorp.SqlExecutor, projKey string) ([]string, error)

func LoadRunsDescAtOffset added in v0.56.0

func LoadRunsDescAtOffset(ctx context.Context, db gorp.SqlExecutor, projKey, vcs, repo, workflow, ref string, offset int64) ([]string, error)

func LoadRunsGitRefs added in v0.53.1

func LoadRunsGitRefs(ctx context.Context, db gorp.SqlExecutor, projKey string) ([]string, error)

func LoadRunsGitRepositories added in v0.55.0

func LoadRunsGitRepositories(ctx context.Context, db gorp.SqlExecutor, projKey string) ([]string, error)

func LoadRunsTemplates added in v0.55.0

func LoadRunsTemplates(ctx context.Context, db gorp.SqlExecutor, projKey string) ([]string, error)

func LoadRunsUnsafe added in v0.53.1

func LoadRunsUnsafe(ctx context.Context, db gorp.SqlExecutor) ([]sdk.V2WorkflowRun, error)

func LoadRunsUnsafeWithPagination added in v0.55.0

func LoadRunsUnsafeWithPagination(ctx context.Context, db gorp.SqlExecutor, offset, limit int) ([]sdk.V2WorkflowRun, error)

func LoadRunsWorkflowNames added in v0.53.1

func LoadRunsWorkflowNames(ctx context.Context, db gorp.SqlExecutor, projKey string) ([]string, error)

func LoadRunsWorkflowRefs added in v0.55.0

func LoadRunsWorkflowRefs(ctx context.Context, db gorp.SqlExecutor, projKey string) ([]string, error)

func LoadRunsWorkflowRefsByWorkflow added in v0.56.0

func LoadRunsWorkflowRefsByWorkflow(ctx context.Context, db gorp.SqlExecutor, projKey, vcs, repository, workflow string) ([]string, error)

func LoadRunsWorkflowRepositories added in v0.55.0

func LoadRunsWorkflowRepositories(ctx context.Context, db gorp.SqlExecutor, projKey string) ([]string, error)

func LoadWorkflowVersion added in v0.55.0

func LoadWorkflowVersion(ctx context.Context, db gorp.SqlExecutor, projKey, vcs, repository, wkf, version string) (*sdk.V2WorkflowVersion, error)

func RetrieveJobToKeep added in v0.53.1

func RetrieveJobToKeep(_ context.Context, w sdk.V2Workflow, runJobsMap map[string]sdk.V2WorkflowRunJob, runJobToRestart map[string]sdk.V2WorkflowRunJob) map[string]sdk.V2WorkflowRunJob

func SearchAllRuns added in v0.55.0

func SearchAllRuns(ctx context.Context, db gorp.SqlExecutor, filters SearchRunsFilters, offset, limit uint, sort string, opts ...gorpmapper.GetAllOptionFunc) ([]sdk.V2WorkflowRun, error)

func SearchRuns added in v0.53.1

func SearchRuns(ctx context.Context, db gorp.SqlExecutor, projKey string, filters SearchRunsFilters, offset, limit uint, sort string, opts ...gorpmapper.GetAllOptionFunc) ([]sdk.V2WorkflowRun, error)

func UnsafeLoadAllRunJobs added in v0.53.1

func UnsafeLoadAllRunJobs(ctx context.Context, db gorp.SqlExecutor) ([]sdk.V2WorkflowRunJob, error)

func UpdateRunResult added in v0.53.1

func UpdateRunResult(ctx context.Context, db gorp.SqlExecutor, runResult *sdk.V2WorkflowRunResult) error

func UpdateWorkflowHook added in v0.53.1

func UpdateWorkflowHook(ctx context.Context, db gorpmapper.SqlExecutorWithTx, h *sdk.V2WorkflowHook) error

func WorkflowRunNextNumber

func WorkflowRunNextNumber(db gorp.SqlExecutor, repoID, workflowName string) (int64, error)

Types

type AnnotationsFilter added in v0.55.0

type AnnotationsFilter struct {
	Key    string         `db:"key"`
	Values pq.StringArray `db:"values"`
}

type AnnotationsFilters added in v0.55.0

type AnnotationsFilters []AnnotationsFilter

func LoadRunsAnnotations added in v0.55.0

func LoadRunsAnnotations(ctx context.Context, db gorp.SqlExecutor, projKey string) (AnnotationsFilters, error)

type ConcurrencyObject added in v0.55.2

type ConcurrencyObject struct {
	Type ConcurrencyObjectType `db:"type"`
	ID   string                `db:"id"`
}

func LoadNewestRunJobWithProjectScopedConcurrency added in v0.55.2

func LoadNewestRunJobWithProjectScopedConcurrency(ctx context.Context, db gorp.SqlExecutor, proj string, concurrencyName string, rjStatus []string, workflowRunStatus sdk.V2WorkflowRunStatus, limit interface{}) ([]ConcurrencyObject, error)

func LoadNewestRunJobWithWorkflowScopedConcurrency added in v0.55.2

func LoadNewestRunJobWithWorkflowScopedConcurrency(ctx context.Context, db gorp.SqlExecutor, proj string, vcs string, repo string, workflow string, concurrencyName string, rjStatus []string, workflowRunStatus sdk.V2WorkflowRunStatus, limit interface{}) ([]ConcurrencyObject, error)

func LoadOldestRunJobWithProjectScopedConcurrency added in v0.55.2

func LoadOldestRunJobWithProjectScopedConcurrency(ctx context.Context, db gorp.SqlExecutor, proj string, concurrencyName string, rjStatus []string, workflowStatus sdk.V2WorkflowRunStatus, limit int64) ([]ConcurrencyObject, error)

func LoadOldestRunJobWithWorkflowScopedConcurrency added in v0.55.2

func LoadOldestRunJobWithWorkflowScopedConcurrency(ctx context.Context, db gorp.SqlExecutor, proj string, vcs string, repo string, workflow string, concurrencyName string, rjStatus []string, workflowRunStatus sdk.V2WorkflowRunStatus, limit int64) ([]ConcurrencyObject, error)

type ConcurrencyObjectType added in v0.55.2

type ConcurrencyObjectType string
const (
	ConcurrencyObjectTypeWorkflow ConcurrencyObjectType = "WORKFLOW"
	ConcurrencyObjectTypeJob      ConcurrencyObjectType = "JOB"
)

type ConcurrencyRule added in v0.55.2

type ConcurrencyRule struct {
	MinPool int64  `db:"pool"`
	Order   string `db:"order"`
	Cancel  bool   `db:"cancel"`
}

func LoadProjectConcurrencyRules added in v0.55.2

func LoadProjectConcurrencyRules(ctx context.Context, db gorp.SqlExecutor, proj string, concurrencyName string) ([]ConcurrencyRule, error)

func LoadWorkflowConcurrencyRules added in v0.55.2

func LoadWorkflowConcurrencyRules(ctx context.Context, db gorp.SqlExecutor, proj string, vcs string, repo string, workflow string, concurrencyName string) ([]ConcurrencyRule, error)

type SearchRunsFilters added in v0.55.1

type SearchRunsFilters struct {
	Workflows            []string
	Actors               []string
	Authors              []string
	Status               []string
	Refs                 []string
	WorkflowRefs         []string
	Repositories         []string
	WorkflowRepositories []string
	Commits              []string
	Templates            []string
	AnnotationKeys       []string
	AnnotationValues     []string
}

func (SearchRunsFilters) Lower added in v0.55.1

func (s SearchRunsFilters) Lower()

type V2WorkflowVersionWorkflowShort added in v0.55.0

type V2WorkflowVersionWorkflowShort struct {
	DistinctID         string `db:"id"`
	ProjectKey         string `db:"project_key"`
	WorkflowVCS        string `db:"workflow_vcs"`
	WorkflowRepository string `db:"workflow_repository"`
	WorkflowName       string `db:"workflow_name"`
}

func LoadDistinctWorkflowVersionByWorkflow added in v0.55.0

func LoadDistinctWorkflowVersionByWorkflow(ctx context.Context, db gorp.SqlExecutor) ([]V2WorkflowVersionWorkflowShort, error)

func (V2WorkflowVersionWorkflowShort) String added in v0.55.0

Jump to

Keyboard shortcuts

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