Help us shape the future of Go! Take the 2026 Go Developer Survey

purge

package
v0.57.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2026 License: BSD-3-Clause Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RunStatus          = "run_status"
	RunDaysBefore      = "run_days_before"
	RunHasGitBranch    = "has_git_branch"
	RunGitBranchExist  = "git_branch_exist"
	RunChangeExist     = "gerrit_change_exist"
	RunChangeMerged    = "gerrit_change_merged"
	RunChangeAbandoned = "gerrit_change_abandoned"
	RunChangeDayBefore = "gerrit_change_days_before"
)

Variables

This section is empty.

Functions

func ApplyRetentionPolicyOnWorkflow

func ApplyRetentionPolicyOnWorkflow(ctx context.Context, store cache.Store, db *gorp.DbMap, wf sdk.Workflow, opts MarkAsDeleteOptions, u *sdk.AuthentifiedUser) error

func ApplyRunRetentionOnProject added in v0.56.0

func ApplyRunRetentionOnProject(ctx context.Context, db *gorp.DbMap, store cache.Store, pkey string, routines *sdk.GoRoutines, opts PurgeOption) error

func ApplyRunRetentionOnWorkflow added in v0.56.0

func ApplyRunRetentionOnWorkflow(ctx context.Context, db *gorp.DbMap, store cache.Store, pkey, workflowFullName string, projectRunRetention *sdk.ProjectRunRetention, routines *sdk.GoRoutines, opts PurgeOption) sdk.WorkflowPurgeReport

func ApplyRunRetentionOnWorkflowRef added in v0.56.0

func ApplyRunRetentionOnWorkflowRef(ctx context.Context, db *gorp.DbMap, store cache.Store, pkey, vcs, repo, workflowName, ref string, ruleRetention *sdk.RetentionRule, routines *sdk.GoRoutines, opts PurgeOption) (sdk.WorkflowRefPurgeReport, error)

func DeleteArtifactsFromRepositoryManager

func DeleteArtifactsFromRepositoryManager(ctx context.Context, db gorp.SqlExecutor, wr *sdk.WorkflowRun) error

func DeleteArtifactsFromRepositoryManagerV2 added in v0.55.0

func DeleteArtifactsFromRepositoryManagerV2(ctx context.Context, db gorp.SqlExecutor, run *sdk.V2WorkflowRun, routines *sdk.GoRoutines) error

func GetRetentionPolicyVariables

func GetRetentionPolicyVariables() []string

func MarkOldWorkflowRunsV1 added in v0.57.0

func MarkOldWorkflowRunsV1(ctx context.Context, DBFunc func() *gorp.DbMap, maxRetentionDays, schedulingSeconds, batchSize int64)

MarkOldWorkflowRunsV1 is a goroutine that periodically marks old workflow v1 runs as to_delete based on their last_modified date and the configured max retention days.

func MarkRunsAsDelete

func MarkRunsAsDelete(ctx context.Context, store cache.Store, DBFunc func() *gorp.DbMap, workflowRunsMarkToDelete *stats.Int64Measure)

MarkRunsAsDelete mark workflow run as delete

func MarkWorkflowRuns

func MarkWorkflowRuns(ctx context.Context, db *gorp.DbMap, workflowRunsMarkToDelete *stats.Int64Measure) error

MarkWorkflowRuns Deprecated: old method to mark runs to delete

func PurgeWorkflowRunsV2 added in v0.56.0

func PurgeWorkflowRunsV2(ctx context.Context, DBFunc func() *gorp.DbMap, store cache.Store, purgeRoutineTicker int64, routines *sdk.GoRoutines)

WorkflowRunsV2 deletes workflow run v2

func RemoveWorkflowRunV2 added in v0.56.0

func RemoveWorkflowRunV2(ctx context.Context, db *gorp.DbMap, id string, routines *sdk.GoRoutines) error

func SetPurgeConfiguration

func SetPurgeConfiguration(rule string, disableDeletionConf bool) error

func Workflow

func Workflow(ctx context.Context, store cache.Store, DBFunc func() *gorp.DbMap, workflowRunsMarkToDelete *stats.Int64Measure)

Workflow deletes workflows marked as to delete

func WorkflowRuns

func WorkflowRuns(ctx context.Context, DBFunc func() *gorp.DbMap, workflowRunsMarkToDelete, workflowRunsDeleted *stats.Int64Measure)

PurgeWorkflow deletes workflow runs marked as to delete

Types

type MarkAsDeleteOptions

type MarkAsDeleteOptions struct {
	DryRun bool
}

type PurgeOption added in v0.56.0

type PurgeOption struct {
	DisabledDryRun bool
	DryRunRules    *sdk.ProjectRunRetention
	ReportID       string
}

Jump to

Keyboard shortcuts

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