ascode

package
v0.54.1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteAsCodeEventByWorkflowID

func DeleteAsCodeEventByWorkflowID(db gorp.SqlExecutor, id int64) error

DeleteAsCodeEventByWorkflowID removes all as_code_event from workflow_id

func DeleteEventsApplicationOnlyFromRepoName

func DeleteEventsApplicationOnlyFromRepoName(ctx context.Context, db gorp.SqlExecutor, fromRepository string, appID int64, appName string) error

func DeleteEventsEnvironmentOnlyFromRepoName

func DeleteEventsEnvironmentOnlyFromRepoName(ctx context.Context, db gorp.SqlExecutor, fromRepository string, envID int64, envName string) error

func DeleteEventsPipelineOnlyFromRepoName

func DeleteEventsPipelineOnlyFromRepoName(ctx context.Context, db gorp.SqlExecutor, fromRepository string, pipID int64, pipName string) error

func LoadEventByWorkflowIDAndPullRequest

func LoadEventByWorkflowIDAndPullRequest(ctx context.Context, db gorp.SqlExecutor, workflowID int64, pullRequestRepo string, pullRequestID int64) (*sdk.AsCodeEvent, error)

LoadEventByWorkflowIDAndPullRequest returns a as code event if exists for given workflow holder and pull request info.

func LoadEventsByWorkflowID

func LoadEventsByWorkflowID(ctx context.Context, db gorp.SqlExecutor, workflowID int64) ([]sdk.AsCodeEvent, error)

LoadEventsByWorkflowID returns as code events for the given workflow.

func LoadEventsByWorkflowIDs

func LoadEventsByWorkflowIDs(ctx context.Context, db gorp.SqlExecutor, workflowIDs []int64) ([]sdk.AsCodeEvent, error)

LoadEventsByWorkflowIDs loads all events attached to a workflow_id

func UpdateAsCodeResult

func UpdateAsCodeResult(ctx context.Context, db *gorp.DbMap, store cache.Store, goRoutines *sdk.GoRoutines, proj sdk.Project, workflowHolder sdk.Workflow, rootApp sdk.Application, ed EntityData, u sdk.Identifiable)

UpdateAsCodeResult pulls repositories operation and the create pullrequest + update workflow

func UpdateEvent

func UpdateEvent(db gorp.SqlExecutor, event *sdk.AsCodeEvent) error

UpdateEvent in database.

func UpsertEvent

func UpsertEvent(db gorp.SqlExecutor, event *sdk.AsCodeEvent) error

UpsertEvent insert or update given ascode event.

Types

type EntityData

type EntityData struct {
	Type          EventType
	ID            int64
	Name          string
	FromRepo      string
	OperationUUID string
}

type EventType

type EventType string

EventType type for as code events.

const (
	PipelineEvent    EventType = "pipeline"
	WorkflowEvent    EventType = "workflow"
	ApplicationEvent EventType = "application"
	EnvironmentEvent EventType = "environment"
)

AsCodeEventType values.

type SyncResult

type SyncResult struct {
	FromRepository string
	Merged         bool
}

func SyncEvents

func SyncEvents(ctx context.Context, db *gorp.DbMap, store cache.Store, proj sdk.Project, workflowHolder sdk.Workflow, u sdk.Identifiable) (SyncResult, error)

SyncEvents checks if workflow as to become ascode.

Jump to

Keyboard shortcuts

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