pipelineConfig

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WorkflowStarting           = "Starting"
	WorkflowInQueue            = "Queued"
	WorkflowInitiated          = "Initiating"
	WorkflowInProgress         = "Progressing"
	WorkflowAborted            = "Aborted"
	WorkflowFailed             = "Failed"
	WorkflowSucceeded          = "Succeeded"
	WorkflowTimedOut           = "TimedOut"
	WorkflowUnableToFetchState = "UnableToFetch"
	WorkflowTypeDeploy         = "DEPLOY"
	WorkflowTypePre            = "PRE"
	WorkflowTypePost           = "POST"
)
View Source
const (
	WORKFLOW_EXECUTOR_TYPE_AWF    = "AWF"
	WORKFLOW_EXECUTOR_TYPE_SYSTEM = "SYSTEM"
	NEW_DEPLOYMENT_INITIATED      = "A new deployment was initiated before this deployment completed!"
	PIPELINE_DELETED              = "The pipeline has been deleted!"
	FOUND_VULNERABILITY           = "Found vulnerability on image"
	GITOPS_REPO_NOT_CONFIGURED    = "GitOps repository is not configured for the app"
)

Variables

View Source
var ErrorDeploymentSuperseded = errors.New(NEW_DEPLOYMENT_INITIATED)

Functions

This section is empty.

Types

type AppDeploymentStatus added in v0.6.13

type AppDeploymentStatus struct {
	AppId        int    `json:"appId"`
	PipelineId   int    `json:"pipelineId"`
	DeployStatus string `json:"deployStatus"`
	WfrId        int    `json:"wfrId,omitempty"`
}

type AppLabel added in v0.2.23

type AppLabel struct {
	Id        int    `sql:"id,pk"`
	AppId     int    `sql:"app_id,notnull"`
	Key       string `sql:"key,notnull"`
	Value     string `sql:"value,notnull"`
	Propagate bool   `sql:"propagate,notnull"`
	App       app.App
	sql.AuditLog
	// contains filtered or unexported fields
}

type AppLabelRepository added in v0.2.23

type AppLabelRepository interface {
	Create(model *AppLabel, tx *pg.Tx) (*AppLabel, error)
	Update(model *AppLabel) (*AppLabel, error)
	Delete(model *AppLabel, tx *pg.Tx) error
	FindById(id int) (*AppLabel, error)
	FindAllByIds(ids []int) ([]*AppLabel, error)
	FindAll() ([]*AppLabel, error)
	FindByLabelKey(key string) ([]*AppLabel, error)
	FindByAppIdAndKeyAndValue(appId int, key string, value string) (*AppLabel, error)
	FindByLabelValue(label string) ([]*AppLabel, error)
	FindAllByAppId(appId int) ([]*AppLabel, error)
}

type AppLabelRepositoryImpl added in v0.2.23

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

func NewAppLabelRepositoryImpl added in v0.2.23

func NewAppLabelRepositoryImpl(dbConnection *pg.DB) *AppLabelRepositoryImpl

func (AppLabelRepositoryImpl) Create added in v0.2.23

func (impl AppLabelRepositoryImpl) Create(model *AppLabel, tx *pg.Tx) (*AppLabel, error)

func (AppLabelRepositoryImpl) Delete added in v0.2.23

func (impl AppLabelRepositoryImpl) Delete(model *AppLabel, tx *pg.Tx) error

func (AppLabelRepositoryImpl) FindAll added in v0.2.23

func (impl AppLabelRepositoryImpl) FindAll() ([]*AppLabel, error)

func (AppLabelRepositoryImpl) FindAllByAppId added in v0.2.23

func (impl AppLabelRepositoryImpl) FindAllByAppId(appId int) ([]*AppLabel, error)

func (AppLabelRepositoryImpl) FindAllByIds added in v0.2.23

func (impl AppLabelRepositoryImpl) FindAllByIds(ids []int) ([]*AppLabel, error)

func (AppLabelRepositoryImpl) FindByAppIdAndKeyAndValue added in v0.2.23

func (impl AppLabelRepositoryImpl) FindByAppIdAndKeyAndValue(appId int, key string, value string) (*AppLabel, error)

func (AppLabelRepositoryImpl) FindById added in v0.2.23

func (impl AppLabelRepositoryImpl) FindById(id int) (*AppLabel, error)

func (AppLabelRepositoryImpl) FindByLabelKey added in v0.2.23

func (impl AppLabelRepositoryImpl) FindByLabelKey(key string) ([]*AppLabel, error)

func (AppLabelRepositoryImpl) FindByLabelValue added in v0.2.23

func (impl AppLabelRepositoryImpl) FindByLabelValue(label string) ([]*AppLabel, error)

func (AppLabelRepositoryImpl) Update added in v0.2.23

func (impl AppLabelRepositoryImpl) Update(model *AppLabel) (*AppLabel, error)

type BuildTypeCount added in v0.6.6

type BuildTypeCount struct {
	Status string `json:"status"`
	Type   string `json:"type"`
	Count  int    `json:"count"`
}

type CdWorkflow

type CdWorkflow struct {
	Id               int            `sql:"id,pk"`
	CiArtifactId     int            `sql:"ci_artifact_id"`
	PipelineId       int            `sql:"pipeline_id"`
	WorkflowStatus   WorkflowStatus `sql:"workflow_status,notnull"`
	Pipeline         *Pipeline
	CiArtifact       *repository.CiArtifact
	CdWorkflowRunner []CdWorkflowRunner
	sql.AuditLog
	// contains filtered or unexported fields
}

type CdWorkflowConfig

type CdWorkflowConfig struct {
	Id                       int    `sql:"id,pk"`
	CdTimeout                int64  `sql:"cd_timeout"`
	MinCpu                   string `sql:"min_cpu"`
	MaxCpu                   string `sql:"max_cpu"`
	MinMem                   string `sql:"min_mem"`
	MaxMem                   string `sql:"max_mem"`
	MinStorage               string `sql:"min_storage"`
	MaxStorage               string `sql:"max_storage"`
	MinEphStorage            string `sql:"min_eph_storage"`
	MaxEphStorage            string `sql:"max_eph_storage"`
	CdCacheBucket            string `sql:"cd_cache_bucket"`
	CdCacheRegion            string `sql:"cd_cache_region"`
	CdImage                  string `sql:"cd_image"`
	Namespace                string `sql:"wf_namespace"`
	CdPipelineId             int    `sql:"cd_pipeline_id"`
	LogsBucket               string `sql:"logs_bucket"`
	CdArtifactLocationFormat string `sql:"cd_artifact_location_format"`
	// contains filtered or unexported fields
}

type CdWorkflowRepository

type CdWorkflowRepository interface {
	CheckWorkflowRunnerByReferenceId(referenceId string) (bool, error)
	SaveWorkFlow(ctx context.Context, wf *CdWorkflow) error
	UpdateWorkFlow(wf *CdWorkflow) error
	FindById(wfId int) (*CdWorkflow, error)
	FindCdWorkflowMetaByEnvironmentId(appId int, environmentId int, offset int, size int) ([]CdWorkflowRunner, error)
	FindCdWorkflowMetaByPipelineId(pipelineId int, offset int, size int) ([]CdWorkflowRunner, error)
	FindArtifactByPipelineIdAndRunnerType(pipelineId int, runnerType apiBean.WorkflowType, limit int, runnerStatuses []string) ([]CdWorkflowRunner, error)
	SaveWorkFlowRunner(wfr *CdWorkflowRunner) (*CdWorkflowRunner, error)
	UpdateWorkFlowRunner(wfr *CdWorkflowRunner) error
	GetPreviousQueuedRunners(cdWfrId, pipelineId int) ([]*CdWorkflowRunner, error)
	UpdateRunnerStatusToFailedForIds(errMsg string, triggeredBy int32, cdWfrIds ...int) error
	UpdateWorkFlowRunnersWithTxn(wfrs []*CdWorkflowRunner, tx *pg.Tx) error
	UpdateWorkFlowRunners(wfr []*CdWorkflowRunner) error
	FindWorkflowRunnerByCdWorkflowId(wfIds []int) ([]*CdWorkflowRunner, error)
	FindPreviousCdWfRunnerByStatus(pipelineId int, currentWFRunnerId int, status []string) ([]*CdWorkflowRunner, error)
	FindConfigByPipelineId(pipelineId int) (*CdWorkflowConfig, error)
	FindWorkflowRunnerById(wfrId int) (*CdWorkflowRunner, error)
	FindBasicWorkflowRunnerById(wfrId int) (*CdWorkflowRunner, error)
	FindRetriedWorkflowCountByReferenceId(wfrId int) (int, error)
	FindLatestWfrByAppIdAndEnvironmentId(appId int, environmentId int) (*CdWorkflowRunner, error)
	FindLastUnFailedProcessedRunner(appId int, environmentId int) (*CdWorkflowRunner, error)
	IsLatestCDWfr(pipelineId, wfrId int) (bool, error)
	FindLatestCdWorkflowRunnerByEnvironmentIdAndRunnerType(appId int, environmentId int, runnerType apiBean.WorkflowType) (CdWorkflowRunner, error)
	FindAllTriggeredWorkflowCountInLast24Hour() (cdWorkflowCount int, err error)
	GetConnection() *pg.DB

	FindLastPreOrPostTriggeredByPipelineId(pipelineId int) (CdWorkflowRunner, error)
	FindLastPreOrPostTriggeredByEnvironmentId(appId int, environmentId int) (CdWorkflowRunner, error)

	FindByWorkflowIdAndRunnerType(ctx context.Context, wfId int, runnerType apiBean.WorkflowType) (CdWorkflowRunner, error)
	FindLatestByPipelineIdAndRunnerType(pipelineId int, runnerType apiBean.WorkflowType) (CdWorkflowRunner, error)
	SaveWorkFlows(wfs ...*CdWorkflow) error
	IsLatestWf(pipelineId int, wfId int) (bool, error)
	FindLatestCdWorkflowByPipelineId(pipelineIds []int) (*CdWorkflow, error)
	FindLatestCdWorkflowByPipelineIdV2(pipelineIds []int) ([]*CdWorkflow, error)
	FetchAllCdStagesLatestEntity(pipelineIds []int) ([]*CdWorkflowStatus, error)
	FetchAllCdStagesLatestEntityStatus(wfrIds []int) ([]*CdWorkflowRunner, error)
	ExistsByStatus(status string) (bool, error)
	FetchEnvAllCdStagesLatestEntityStatus(wfrIds []int, envID int) ([]*CdWorkflowRunner, error)
	FetchArtifactsByCdPipelineId(pipelineId int, runnerType apiBean.WorkflowType, offset, limit int, searchString string) ([]CdWorkflowRunner, error)
	GetLatestTriggersOfHelmPipelinesStuckInNonTerminalStatuses(getPipelineDeployedWithinHours int) ([]*CdWorkflowRunner, error)
	FindLatestRunnerByPipelineIdsAndRunnerType(ctx context.Context, pipelineIds []int, runnerType apiBean.WorkflowType) ([]CdWorkflowRunner, error)
}

type CdWorkflowRepositoryImpl

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

func NewCdWorkflowRepositoryImpl

func NewCdWorkflowRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *CdWorkflowRepositoryImpl

func (*CdWorkflowRepositoryImpl) CheckWorkflowRunnerByReferenceId added in v0.6.28

func (impl *CdWorkflowRepositoryImpl) CheckWorkflowRunnerByReferenceId(referenceId string) (bool, error)

func (*CdWorkflowRepositoryImpl) ExistsByStatus added in v0.4.3

func (impl *CdWorkflowRepositoryImpl) ExistsByStatus(status string) (bool, error)

func (*CdWorkflowRepositoryImpl) FetchAllCdStagesLatestEntity

func (impl *CdWorkflowRepositoryImpl) FetchAllCdStagesLatestEntity(pipelineIds []int) ([]*CdWorkflowStatus, error)

func (*CdWorkflowRepositoryImpl) FetchAllCdStagesLatestEntityStatus

func (impl *CdWorkflowRepositoryImpl) FetchAllCdStagesLatestEntityStatus(wfrIds []int) ([]*CdWorkflowRunner, error)

func (*CdWorkflowRepositoryImpl) FetchArtifactsByCdPipelineId added in v0.6.2

func (impl *CdWorkflowRepositoryImpl) FetchArtifactsByCdPipelineId(pipelineId int, runnerType apiBean.WorkflowType, offset, limit int, searchString string) ([]CdWorkflowRunner, error)

func (*CdWorkflowRepositoryImpl) FetchArtifactsByCdPipelineIdV2 added in v0.6.26

func (impl *CdWorkflowRepositoryImpl) FetchArtifactsByCdPipelineIdV2(listingFilterOptions apiBean.ArtifactsListFilterOptions) ([]CdWorkflowRunner, int, error)

func (*CdWorkflowRepositoryImpl) FetchEnvAllCdStagesLatestEntityStatus added in v0.7.2

func (impl *CdWorkflowRepositoryImpl) FetchEnvAllCdStagesLatestEntityStatus(wfrIds []int, envID int) ([]*CdWorkflowRunner, error)

func (*CdWorkflowRepositoryImpl) FindAllTriggeredWorkflowCountInLast24Hour added in v0.7.0

func (impl *CdWorkflowRepositoryImpl) FindAllTriggeredWorkflowCountInLast24Hour() (cdWorkflowCount int, err error)

func (*CdWorkflowRepositoryImpl) FindArtifactByPipelineIdAndRunnerType

func (impl *CdWorkflowRepositoryImpl) FindArtifactByPipelineIdAndRunnerType(pipelineId int, runnerType apiBean.WorkflowType, limit int, runnerStatuses []string) ([]CdWorkflowRunner, error)

func (*CdWorkflowRepositoryImpl) FindBasicWorkflowRunnerById added in v0.7.1

func (impl *CdWorkflowRepositoryImpl) FindBasicWorkflowRunnerById(wfrId int) (*CdWorkflowRunner, error)

func (*CdWorkflowRepositoryImpl) FindById

func (impl *CdWorkflowRepositoryImpl) FindById(wfId int) (*CdWorkflow, error)

func (*CdWorkflowRepositoryImpl) FindByWorkflowIdAndRunnerType

func (impl *CdWorkflowRepositoryImpl) FindByWorkflowIdAndRunnerType(ctx context.Context, wfId int, runnerType apiBean.WorkflowType) (CdWorkflowRunner, error)

func (*CdWorkflowRepositoryImpl) FindCdWorkflowMetaByEnvironmentId

func (impl *CdWorkflowRepositoryImpl) FindCdWorkflowMetaByEnvironmentId(appId int, environmentId int, offset int, limit int) ([]CdWorkflowRunner, error)

func (*CdWorkflowRepositoryImpl) FindCdWorkflowMetaByPipelineId

func (impl *CdWorkflowRepositoryImpl) FindCdWorkflowMetaByPipelineId(pipelineId int, offset int, limit int) ([]CdWorkflowRunner, error)

func (*CdWorkflowRepositoryImpl) FindConfigByPipelineId

func (impl *CdWorkflowRepositoryImpl) FindConfigByPipelineId(pipelineId int) (*CdWorkflowConfig, error)

func (*CdWorkflowRepositoryImpl) FindLastPreOrPostTriggeredByEnvironmentId

func (impl *CdWorkflowRepositoryImpl) FindLastPreOrPostTriggeredByEnvironmentId(appId int, environmentId int) (CdWorkflowRunner, error)

func (*CdWorkflowRepositoryImpl) FindLastPreOrPostTriggeredByPipelineId

func (impl *CdWorkflowRepositoryImpl) FindLastPreOrPostTriggeredByPipelineId(pipelineId int) (CdWorkflowRunner, error)

func (*CdWorkflowRepositoryImpl) FindLastUnFailedProcessedRunner added in v0.7.1

func (impl *CdWorkflowRepositoryImpl) FindLastUnFailedProcessedRunner(appId int, environmentId int) (*CdWorkflowRunner, error)

func (*CdWorkflowRepositoryImpl) FindLatestByPipelineIdAndRunnerType added in v0.7.1

func (impl *CdWorkflowRepositoryImpl) FindLatestByPipelineIdAndRunnerType(pipelineId int, runnerType apiBean.WorkflowType) (CdWorkflowRunner, error)

func (*CdWorkflowRepositoryImpl) FindLatestCdWorkflowByPipelineId

func (impl *CdWorkflowRepositoryImpl) FindLatestCdWorkflowByPipelineId(pipelineIds []int) (*CdWorkflow, error)

func (*CdWorkflowRepositoryImpl) FindLatestCdWorkflowByPipelineIdV2

func (impl *CdWorkflowRepositoryImpl) FindLatestCdWorkflowByPipelineIdV2(pipelineIds []int) ([]*CdWorkflow, error)

func (*CdWorkflowRepositoryImpl) FindLatestCdWorkflowRunnerByEnvironmentIdAndRunnerType added in v0.6.11

func (impl *CdWorkflowRepositoryImpl) FindLatestCdWorkflowRunnerByEnvironmentIdAndRunnerType(appId int, environmentId int, runnerType apiBean.WorkflowType) (CdWorkflowRunner, error)

func (*CdWorkflowRepositoryImpl) FindLatestRunnerByPipelineIdsAndRunnerType added in v0.7.0

func (impl *CdWorkflowRepositoryImpl) FindLatestRunnerByPipelineIdsAndRunnerType(ctx context.Context, pipelineIds []int, runnerType apiBean.WorkflowType) ([]CdWorkflowRunner, error)

func (*CdWorkflowRepositoryImpl) FindLatestWfrByAppIdAndEnvironmentId added in v0.5.1

func (impl *CdWorkflowRepositoryImpl) FindLatestWfrByAppIdAndEnvironmentId(appId int, environmentId int) (*CdWorkflowRunner, error)

func (*CdWorkflowRepositoryImpl) FindPreviousCdWfRunnerByStatus

func (impl *CdWorkflowRepositoryImpl) FindPreviousCdWfRunnerByStatus(pipelineId int, currentWFRunnerId int, status []string) ([]*CdWorkflowRunner, error)

func (*CdWorkflowRepositoryImpl) FindRetriedWorkflowCountByReferenceId added in v0.6.24

func (impl *CdWorkflowRepositoryImpl) FindRetriedWorkflowCountByReferenceId(wfrId int) (int, error)

func (*CdWorkflowRepositoryImpl) FindWorkflowRunnerByCdWorkflowId

func (impl *CdWorkflowRepositoryImpl) FindWorkflowRunnerByCdWorkflowId(wfIds []int) ([]*CdWorkflowRunner, error)

func (*CdWorkflowRepositoryImpl) FindWorkflowRunnerById

func (impl *CdWorkflowRepositoryImpl) FindWorkflowRunnerById(wfrId int) (*CdWorkflowRunner, error)

func (*CdWorkflowRepositoryImpl) GetConnection added in v0.5.1

func (impl *CdWorkflowRepositoryImpl) GetConnection() *pg.DB

func (*CdWorkflowRepositoryImpl) GetLatestTriggersOfHelmPipelinesStuckInNonTerminalStatuses added in v0.6.12

func (impl *CdWorkflowRepositoryImpl) GetLatestTriggersOfHelmPipelinesStuckInNonTerminalStatuses(getPipelineDeployedWithinHours int) ([]*CdWorkflowRunner, error)

func (*CdWorkflowRepositoryImpl) GetPreviousQueuedRunners added in v0.7.1

func (impl *CdWorkflowRepositoryImpl) GetPreviousQueuedRunners(cdWfrId, pipelineId int) ([]*CdWorkflowRunner, error)

func (*CdWorkflowRepositoryImpl) IsLatestCDWfr added in v0.6.26

func (impl *CdWorkflowRepositoryImpl) IsLatestCDWfr(pipelineId, wfrId int) (bool, error)

func (*CdWorkflowRepositoryImpl) IsLatestWf

func (impl *CdWorkflowRepositoryImpl) IsLatestWf(pipelineId int, wfId int) (bool, error)

func (*CdWorkflowRepositoryImpl) SaveWorkFlow

func (impl *CdWorkflowRepositoryImpl) SaveWorkFlow(ctx context.Context, wf *CdWorkflow) error

func (*CdWorkflowRepositoryImpl) SaveWorkFlowRunner

func (impl *CdWorkflowRepositoryImpl) SaveWorkFlowRunner(wfr *CdWorkflowRunner) (*CdWorkflowRunner, error)

func (*CdWorkflowRepositoryImpl) SaveWorkFlows

func (impl *CdWorkflowRepositoryImpl) SaveWorkFlows(wfs ...*CdWorkflow) error

func (*CdWorkflowRepositoryImpl) UpdateRunnerStatusToFailedForIds added in v0.7.1

func (impl *CdWorkflowRepositoryImpl) UpdateRunnerStatusToFailedForIds(errMsg string, triggeredBy int32, cdWfrIds ...int) error

func (*CdWorkflowRepositoryImpl) UpdateWorkFlow

func (impl *CdWorkflowRepositoryImpl) UpdateWorkFlow(wf *CdWorkflow) error

func (*CdWorkflowRepositoryImpl) UpdateWorkFlowRunner

func (impl *CdWorkflowRepositoryImpl) UpdateWorkFlowRunner(wfr *CdWorkflowRunner) error

func (*CdWorkflowRepositoryImpl) UpdateWorkFlowRunners

func (impl *CdWorkflowRepositoryImpl) UpdateWorkFlowRunners(wfrs []*CdWorkflowRunner) error

func (*CdWorkflowRepositoryImpl) UpdateWorkFlowRunnersWithTxn added in v0.5.1

func (impl *CdWorkflowRepositoryImpl) UpdateWorkFlowRunnersWithTxn(wfrs []*CdWorkflowRunner, tx *pg.Tx) error

type CdWorkflowRunner

type CdWorkflowRunner struct {
	Id                      int                  `sql:"id,pk"`
	Name                    string               `sql:"name"`
	WorkflowType            apiBean.WorkflowType `sql:"workflow_type"` // pre,post,deploy
	ExecutorType            WorkflowExecutorType `sql:"executor_type"` // awf, system
	Status                  string               `sql:"status"`
	PodStatus               string               `sql:"pod_status"`
	Message                 string               `sql:"message"`
	StartedOn               time.Time            `sql:"started_on"`
	FinishedOn              time.Time            `sql:"finished_on"`
	Namespace               string               `sql:"namespace"`
	LogLocation             string               `sql:"log_file_path"`
	TriggeredBy             int32                `sql:"triggered_by"`
	CdWorkflowId            int                  `sql:"cd_workflow_id"`
	PodName                 string               `sql:"pod_name"`
	BlobStorageEnabled      bool                 `sql:"blob_storage_enabled,notnull"`
	RefCdWorkflowRunnerId   int                  `sql:"ref_cd_workflow_runner_id,notnull"`
	ImagePathReservationIds []int                `sql:"image_path_reservation_ids" pg:",array,notnull"`
	ReferenceId             *string              `sql:"reference_id"`
	CdWorkflow              *CdWorkflow
	sql.AuditLog
	// contains filtered or unexported fields
}

func (*CdWorkflowRunner) IsExternalRun added in v0.6.25

func (c *CdWorkflowRunner) IsExternalRun() bool

type CdWorkflowRunnerWithExtraFields added in v0.6.26

type CdWorkflowRunnerWithExtraFields struct {
	CdWorkflowRunner
	TotalCount int
}

type CdWorkflowStatus

type CdWorkflowStatus struct {
	CiPipelineId               int    `json:"ci_pipeline_id"`
	PipelineId                 int    `json:"pipeline_id"`
	PipelineName               string `json:"pipeline_name,omitempty"`
	DeployStatus               string `json:"deploy_status"`
	PreStatus                  string `json:"pre_status"`
	PostStatus                 string `json:"post_status"`
	WorkflowType               string `json:"workflow_type,omitempty"`
	WfrId                      int    `json:"wfr_id,omitempty"`
	DeploymentAppDeleteRequest bool   `json:"deploymentAppDeleteRequest"`
}

type CdWorkflowWithArtifact

type CdWorkflowWithArtifact struct {
	Id                    int                          `json:"id"`
	CdWorkflowId          int                          `json:"cd_workflow_id"`
	Name                  string                       `json:"name"`
	Status                string                       `json:"status"`
	PodStatus             string                       `json:"pod_status"`
	Message               string                       `json:"message"`
	StartedOn             time.Time                    `json:"started_on"`
	FinishedOn            time.Time                    `json:"finished_on"`
	PipelineId            int                          `json:"pipeline_id"`
	Namespace             string                       `json:"namespace"`
	LogFilePath           string                       `json:"log_file_path"`
	TriggeredBy           int32                        `json:"triggered_by"`
	EmailId               string                       `json:"email_id"`
	Image                 string                       `json:"image"`
	MaterialInfo          string                       `json:"material_info,omitempty"`
	DataSource            string                       `json:"data_source,omitempty"`
	CiArtifactId          int                          `json:"ci_artifact_id,omitempty"`
	WorkflowType          string                       `json:"workflow_type,omitempty"`
	ExecutorType          string                       `json:"executor_type,omitempty"`
	BlobStorageEnabled    bool                         `json:"blobStorageEnabled"`
	GitTriggers           map[int]GitCommit            `json:"gitTriggers"`
	CiMaterials           []CiPipelineMaterialResponse `json:"ciMaterials"`
	ImageReleaseTags      []*repository2.ImageTag      `json:"imageReleaseTags"`
	ImageComment          *repository2.ImageComment    `json:"imageComment"`
	RefCdWorkflowRunnerId int                          `json:"referenceCdWorkflowRunnerId"`
}

type CiArtifactDTO

type CiArtifactDTO struct {
	Id           int    `json:"id"`
	PipelineId   int    `json:"pipelineId"` //id of the ci pipeline from which this webhook was triggered
	Image        string `json:"image"`
	ImageDigest  string `json:"imageDigest"`
	MaterialInfo string `json:"materialInfo"` //git material metadata json array string
	DataSource   string `json:"dataSource"`
	WorkflowId   *int   `json:"workflowId"`
}

type CiBuildConfig added in v0.6.6

type CiBuildConfig struct {
	Id                   int    `sql:"id"`
	Type                 string `sql:"type"`
	CiTemplateId         int    `sql:"ci_template_id"`
	CiTemplateOverrideId int    `sql:"ci_template_override_id"`
	UseRootContext       *bool  `sql:"use_root_context"`
	BuildMetadata        string `sql:"build_metadata"`
	sql.AuditLog
	// contains filtered or unexported fields
}

type CiBuildConfigRepository added in v0.6.6

type CiBuildConfigRepository interface {
	Save(ciBuildConfig *CiBuildConfig) error
	Update(ciBuildConfig *CiBuildConfig) error
	Delete(ciBuildConfigId int) error
	GetCountByBuildType() (map[string]int, error)
}

type CiBuildConfigRepositoryImpl added in v0.6.6

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

func NewCiBuildConfigRepositoryImpl added in v0.6.6

func NewCiBuildConfigRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *CiBuildConfigRepositoryImpl

func (CiBuildConfigRepositoryImpl) Delete added in v0.6.6

func (impl CiBuildConfigRepositoryImpl) Delete(ciBuildConfigId int) error

func (CiBuildConfigRepositoryImpl) GetCountByBuildType added in v0.6.6

func (impl CiBuildConfigRepositoryImpl) GetCountByBuildType() (map[string]int, error)

func (CiBuildConfigRepositoryImpl) Save added in v0.6.6

func (impl CiBuildConfigRepositoryImpl) Save(ciBuildConfig *CiBuildConfig) error

func (CiBuildConfigRepositoryImpl) Update added in v0.6.6

func (impl CiBuildConfigRepositoryImpl) Update(ciBuildConfig *CiBuildConfig) error

type CiEnvMapping added in v0.6.21

type CiEnvMapping struct {
	Id            int  `sql:"id,pk"`
	EnvironmentId int  `sql:"environment_id"`
	CiPipelineId  int  `sql:"ci_pipeline_id"`
	Deleted       bool `sql:"deleted,notnull"`
	CiPipeline    CiPipeline
	Environment   repository.Environment
	sql.AuditLog
	// contains filtered or unexported fields
}

type CiPipeline

type CiPipeline struct {
	Id                       int `sql:"id,pk"`
	AppId                    int `sql:"app_id"`
	App                      *app.App
	CiTemplateId             int    `sql:"ci_template_id"`
	DockerArgs               string `sql:"docker_args"`
	Name                     string `sql:"name"`
	Version                  string `sql:"version"`
	Active                   bool   `sql:"active,notnull"`
	Deleted                  bool   `sql:"deleted,notnull"`
	IsManual                 bool   `sql:"manual,notnull"`
	IsExternal               bool   `sql:"external,notnull"`
	ParentCiPipeline         int    `sql:"parent_ci_pipeline"`
	ScanEnabled              bool   `sql:"scan_enabled,notnull"`
	IsDockerConfigOverridden bool   `sql:"is_docker_config_overridden, notnull"`
	PipelineType             string `sql:"ci_pipeline_type"`
	sql.AuditLog
	CiPipelineMaterials []*CiPipelineMaterial
	CiTemplate          *CiTemplate
	// contains filtered or unexported fields
}

type CiPipelineMaterial

type CiPipelineMaterial struct {
	Id            int    `sql:"id"`
	GitMaterialId int    `sql:"git_material_id"` //id stored in db GitMaterial( foreign key)
	CiPipelineId  int    `sql:"ci_pipeline_id"`
	Path          string `sql:"path"` // defaults to root of git repo
	//depricated was used in gocd remove this
	CheckoutPath string     `sql:"checkout_path"` //path where code will be checked out for single source `./` default for multiSource configured by user
	Type         SourceType `sql:"type"`
	Value        string     `sql:"value"`
	ScmId        string     `sql:"scm_id"`      //id of gocd object
	ScmName      string     `sql:"scm_name"`    //gocd scm name
	ScmVersion   string     `sql:"scm_version"` //gocd scm version
	Active       bool       `sql:"active,notnull"`
	Regex        string     `json:"regex"`
	GitTag       string     `sql:"-"`
	CiPipeline   *CiPipeline
	GitMaterial  *GitMaterial
	sql.AuditLog
	// contains filtered or unexported fields
}

type CiPipelineMaterialRepository

type CiPipelineMaterialRepository interface {
	Save(tx *pg.Tx, pipeline ...*CiPipelineMaterial) error
	Update(tx *pg.Tx, material ...*CiPipelineMaterial) error
	UpdateNotNull(tx *pg.Tx, material ...*CiPipelineMaterial) error
	FindByCiPipelineIdsIn(ids []int) ([]*CiPipelineMaterial, error)
	GetById(id int) (*CiPipelineMaterial, error)
	GetByIdsIncludeDeleted(ids []int) ([]*CiPipelineMaterial, error)
	GetByPipelineId(id int) ([]*CiPipelineMaterial, error)
	GetRegexByPipelineId(id int) ([]*CiPipelineMaterial, error)
	CheckRegexExistsForMaterial(id int) bool
	GetByPipelineIdForRegexAndFixed(id int) ([]*CiPipelineMaterial, error)
	GetCheckoutPath(gitMaterialId int) (string, error)
	GetByPipelineIdAndGitMaterialId(id int, gitMaterialId int) ([]*CiPipelineMaterial, error)
}

type CiPipelineMaterialRepositoryImpl

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

func NewCiPipelineMaterialRepositoryImpl

func NewCiPipelineMaterialRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *CiPipelineMaterialRepositoryImpl

func (CiPipelineMaterialRepositoryImpl) CheckRegexExistsForMaterial added in v0.4.28

func (impl CiPipelineMaterialRepositoryImpl) CheckRegexExistsForMaterial(id int) bool

func (CiPipelineMaterialRepositoryImpl) FindByCiPipelineIdsIn

func (impl CiPipelineMaterialRepositoryImpl) FindByCiPipelineIdsIn(ids []int) ([]*CiPipelineMaterial, error)

func (CiPipelineMaterialRepositoryImpl) GetById

func (CiPipelineMaterialRepositoryImpl) GetByIdsIncludeDeleted added in v0.6.24

func (impl CiPipelineMaterialRepositoryImpl) GetByIdsIncludeDeleted(ids []int) ([]*CiPipelineMaterial, error)

func (CiPipelineMaterialRepositoryImpl) GetByPipelineId

func (impl CiPipelineMaterialRepositoryImpl) GetByPipelineId(id int) ([]*CiPipelineMaterial, error)

func (CiPipelineMaterialRepositoryImpl) GetByPipelineIdAndGitMaterialId added in v0.6.17

func (impl CiPipelineMaterialRepositoryImpl) GetByPipelineIdAndGitMaterialId(id int, gitMaterialId int) ([]*CiPipelineMaterial, error)

func (CiPipelineMaterialRepositoryImpl) GetByPipelineIdForRegexAndFixed added in v0.6.14

func (impl CiPipelineMaterialRepositoryImpl) GetByPipelineIdForRegexAndFixed(id int) ([]*CiPipelineMaterial, error)

func (CiPipelineMaterialRepositoryImpl) GetCheckoutPath added in v0.6.17

func (impl CiPipelineMaterialRepositoryImpl) GetCheckoutPath(gitMaterialId int) (string, error)

func (CiPipelineMaterialRepositoryImpl) GetRegexByPipelineId added in v0.4.28

func (impl CiPipelineMaterialRepositoryImpl) GetRegexByPipelineId(id int) ([]*CiPipelineMaterial, error)

func (CiPipelineMaterialRepositoryImpl) Save

func (impl CiPipelineMaterialRepositoryImpl) Save(tx *pg.Tx, material ...*CiPipelineMaterial) error

func (CiPipelineMaterialRepositoryImpl) Update

func (impl CiPipelineMaterialRepositoryImpl) Update(tx *pg.Tx, materials ...*CiPipelineMaterial) error

func (CiPipelineMaterialRepositoryImpl) UpdateNotNull added in v0.6.17

func (impl CiPipelineMaterialRepositoryImpl) UpdateNotNull(tx *pg.Tx, materials ...*CiPipelineMaterial) error

type CiPipelineMaterialResponse added in v0.6.18

type CiPipelineMaterialResponse struct {
	Id              int                    `json:"id"`
	GitMaterialId   int                    `json:"gitMaterialId"`
	GitMaterialUrl  string                 `json:"gitMaterialUrl"`
	GitMaterialName string                 `json:"gitMaterialName"`
	Type            string                 `json:"type"`
	Value           string                 `json:"value"`
	Active          bool                   `json:"active"`
	History         []*gitSensor.GitCommit `json:"history,omitempty"`
	LastFetchTime   time.Time              `json:"lastFetchTime"`
	IsRepoError     bool                   `json:"isRepoError"`
	RepoErrorMsg    string                 `json:"repoErrorMsg"`
	IsBranchError   bool                   `json:"isBranchError"`
	BranchErrorMsg  string                 `json:"branchErrorMsg"`
	Url             string                 `json:"url"`
	Regex           string                 `json:"regex"`
}

type CiPipelineRepository

type CiPipelineRepository interface {
	sql.TransactionWrapper
	Save(pipeline *CiPipeline, tx *pg.Tx) error
	SaveCiEnvMapping(cienvmapping *CiEnvMapping, tx *pg.Tx) error
	SaveExternalCi(pipeline *ExternalCiPipeline, tx *pg.Tx) (*ExternalCiPipeline, error)
	UpdateExternalCi(pipeline *ExternalCiPipeline, tx *pg.Tx) (*ExternalCiPipeline, error)
	FindExternalCiByCiPipelineId(ciPipelineId int) (*ExternalCiPipeline, error)
	FindExternalCiById(id int) (*ExternalCiPipeline, error)
	FindExternalCiByAppId(appId int) ([]*ExternalCiPipeline, error)
	FindExternalCiByAppIds(appIds []int) ([]*ExternalCiPipeline, error)
	FindCiScriptsByCiPipelineId(ciPipelineId int) ([]*CiPipelineScript, error)
	FindCiScriptsByCiPipelineIds(ciPipelineId []int) ([]*CiPipelineScript, error)
	SaveCiPipelineScript(ciPipelineScript *CiPipelineScript, tx *pg.Tx) error
	UpdateCiPipelineScript(script *CiPipelineScript, tx *pg.Tx) error
	MarkCiPipelineScriptsInactiveByCiPipelineId(ciPipelineId int, tx *pg.Tx) error
	FindByAppId(appId int) (pipelines []*CiPipeline, err error)
	FindCiPipelineByAppIdAndEnvIds(appId int, envIds []int) ([]*CiPipeline, error)
	FindByAppIds(appIds []int) (pipelines []*CiPipeline, err error)
	//find any pipeline by id, includes soft deleted as well
	FindByIdIncludingInActive(id int) (pipeline *CiPipeline, err error)
	//find non deleted pipeline
	FindById(id int) (pipeline *CiPipeline, err error)
	// FindOneWithAppData is to be used for fetching minimum data (including app.App) for CiPipeline for the given CiPipeline.Id
	FindOneWithAppData(id int) (pipeline *CiPipeline, err error)
	FindCiEnvMappingByCiPipelineId(ciPipelineId int) (*CiEnvMapping, error)
	FindParentCiPipelineMapByAppId(appId int) ([]*CiPipeline, []int, error)
	FindByCiAndAppDetailsById(pipelineId int) (pipeline *CiPipeline, err error)
	FindByIdsIn(ids []int) ([]*CiPipeline, error)
	Update(pipeline *CiPipeline, tx *pg.Tx) error
	UpdateCiEnvMapping(cienvmapping *CiEnvMapping, tx *pg.Tx) error
	PipelineExistsByName(names []string) (found []string, err error)
	FindByName(pipelineName string) (pipeline *CiPipeline, err error)
	CheckIfPipelineExistsByNameAndAppId(pipelineName string, appId int) (bool, error)
	FindByLinkedCiCount(parentCiPipelineId int) (int, error)
	FindByParentCiPipelineId(parentCiPipelineId int) ([]*CiPipeline, error)
	FindByParentIdAndType(parentCiPipelineId int, pipelineType string) ([]*CiPipeline, error)

	FetchParentCiPipelinesForDG() ([]*ciPipeline.CiPipelinesMap, error)
	FetchCiPipelinesForDG(parentId int, childCiPipelineIds []int) (*CiPipeline, int, error)
	FinDByParentCiPipelineAndAppId(parentCiPipeline int, appIds []int) ([]*CiPipeline, error)
	FindAllPipelineCreatedCountInLast24Hour() (pipelineCount int, err error)
	FindAllDeletedPipelineCountInLast24Hour() (pipelineCount int, err error)
	FindNumberOfAppsWithCiPipeline(appIds []int) (count int, err error)
	FindAppAndProjectByCiPipelineIds(ciPipelineIds []int) ([]*CiPipeline, error)
	FindCiPipelineConfigsByIds(ids []int) ([]*CiPipeline, error)
	FindByParentCiPipelineIds(parentCiPipelineIds []int) ([]*CiPipeline, error)
	FindWithMinDataByCiPipelineId(id int) (pipeline *CiPipeline, err error)
	FindAppIdsForCiPipelineIds(pipelineIds []int) (map[int]int, error)
	GetCiPipelineByArtifactId(artifactId int) (*CiPipeline, error)
	GetExternalCiPipelineByArtifactId(artifactId int) (*ExternalCiPipeline, error)
	FindLinkedCiCount(ciPipelineId int) (int, error)
	GetLinkedCiPipelines(ctx context.Context, ciPipelineId int) ([]*CiPipeline, error)
	GetDownStreamInfo(ctx context.Context, sourceCiPipelineId int,
		appNameMatch, envNameMatch string, req *pagination.RepositoryRequest) ([]ciPipeline.LinkedCIDetails, int, error)
}

type CiPipelineRepositoryImpl

type CiPipelineRepositoryImpl struct {
	*sql.TransactionUtilImpl
	// contains filtered or unexported fields
}

func NewCiPipelineRepositoryImpl

func NewCiPipelineRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger, TransactionUtilImpl *sql.TransactionUtilImpl) *CiPipelineRepositoryImpl

func (*CiPipelineRepositoryImpl) CheckIfPipelineExistsByNameAndAppId added in v0.6.26

func (impl *CiPipelineRepositoryImpl) CheckIfPipelineExistsByNameAndAppId(pipelineName string, appId int) (bool, error)

func (*CiPipelineRepositoryImpl) FetchCiPipelinesForDG

func (impl *CiPipelineRepositoryImpl) FetchCiPipelinesForDG(parentId int, childCiPipelineIds []int) (*CiPipeline, int, error)

func (*CiPipelineRepositoryImpl) FetchParentCiPipelinesForDG

func (impl *CiPipelineRepositoryImpl) FetchParentCiPipelinesForDG() ([]*ciPipeline.CiPipelinesMap, error)

func (*CiPipelineRepositoryImpl) FinDByParentCiPipelineAndAppId

func (impl *CiPipelineRepositoryImpl) FinDByParentCiPipelineAndAppId(parentCiPipeline int, appIds []int) ([]*CiPipeline, error)

func (*CiPipelineRepositoryImpl) FindAllDeletedPipelineCountInLast24Hour added in v0.7.0

func (impl *CiPipelineRepositoryImpl) FindAllDeletedPipelineCountInLast24Hour() (pipelineCount int, err error)

func (*CiPipelineRepositoryImpl) FindAllPipelineCreatedCountInLast24Hour added in v0.7.0

func (impl *CiPipelineRepositoryImpl) FindAllPipelineCreatedCountInLast24Hour() (pipelineCount int, err error)

func (*CiPipelineRepositoryImpl) FindAppAndProjectByCiPipelineIds added in v0.6.15

func (impl *CiPipelineRepositoryImpl) FindAppAndProjectByCiPipelineIds(ciPipelineIds []int) ([]*CiPipeline, error)

func (*CiPipelineRepositoryImpl) FindAppIdsForCiPipelineIds added in v0.6.17

func (impl *CiPipelineRepositoryImpl) FindAppIdsForCiPipelineIds(pipelineIds []int) (map[int]int, error)

func (*CiPipelineRepositoryImpl) FindByAppId

func (impl *CiPipelineRepositoryImpl) FindByAppId(appId int) (pipelines []*CiPipeline, err error)

func (*CiPipelineRepositoryImpl) FindByAppIds added in v0.6.13

func (impl *CiPipelineRepositoryImpl) FindByAppIds(appIds []int) (pipelines []*CiPipeline, err error)

func (*CiPipelineRepositoryImpl) FindByCiAndAppDetailsById

func (impl *CiPipelineRepositoryImpl) FindByCiAndAppDetailsById(pipelineId int) (pipeline *CiPipeline, err error)

func (*CiPipelineRepositoryImpl) FindById

func (impl *CiPipelineRepositoryImpl) FindById(id int) (pipeline *CiPipeline, err error)

func (*CiPipelineRepositoryImpl) FindByIdIncludingInActive added in v0.6.26

func (impl *CiPipelineRepositoryImpl) FindByIdIncludingInActive(id int) (pipeline *CiPipeline, err error)

func (*CiPipelineRepositoryImpl) FindByIdsIn

func (impl *CiPipelineRepositoryImpl) FindByIdsIn(ids []int) ([]*CiPipeline, error)

func (*CiPipelineRepositoryImpl) FindByLinkedCiCount added in v0.7.2

func (impl *CiPipelineRepositoryImpl) FindByLinkedCiCount(parentCiPipelineId int) (int, error)

func (*CiPipelineRepositoryImpl) FindByName

func (impl *CiPipelineRepositoryImpl) FindByName(pipelineName string) (pipeline *CiPipeline, err error)

func (*CiPipelineRepositoryImpl) FindByParentCiPipelineId

func (impl *CiPipelineRepositoryImpl) FindByParentCiPipelineId(parentCiPipelineId int) ([]*CiPipeline, error)

func (*CiPipelineRepositoryImpl) FindByParentCiPipelineIds added in v0.6.16

func (impl *CiPipelineRepositoryImpl) FindByParentCiPipelineIds(parentCiPipelineIds []int) ([]*CiPipeline, error)

func (*CiPipelineRepositoryImpl) FindByParentIdAndType added in v0.6.26

func (impl *CiPipelineRepositoryImpl) FindByParentIdAndType(parentCiPipelineId int, pipelineType string) ([]*CiPipeline, error)

func (*CiPipelineRepositoryImpl) FindCiEnvMappingByCiPipelineId added in v0.6.21

func (impl *CiPipelineRepositoryImpl) FindCiEnvMappingByCiPipelineId(ciPipelineId int) (*CiEnvMapping, error)

func (*CiPipelineRepositoryImpl) FindCiPipelineByAppIdAndEnvIds added in v0.6.24

func (impl *CiPipelineRepositoryImpl) FindCiPipelineByAppIdAndEnvIds(appId int, envIds []int) ([]*CiPipeline, error)

func (*CiPipelineRepositoryImpl) FindCiPipelineConfigsByIds added in v0.6.16

func (impl *CiPipelineRepositoryImpl) FindCiPipelineConfigsByIds(ids []int) ([]*CiPipeline, error)

func (*CiPipelineRepositoryImpl) FindCiScriptsByCiPipelineId

func (impl *CiPipelineRepositoryImpl) FindCiScriptsByCiPipelineId(ciPipelineId int) ([]*CiPipelineScript, error)

func (*CiPipelineRepositoryImpl) FindCiScriptsByCiPipelineIds added in v0.6.16

func (impl *CiPipelineRepositoryImpl) FindCiScriptsByCiPipelineIds(ciPipelineIds []int) ([]*CiPipelineScript, error)

func (*CiPipelineRepositoryImpl) FindExternalCiByAppId added in v0.6.9

func (impl *CiPipelineRepositoryImpl) FindExternalCiByAppId(appId int) ([]*ExternalCiPipeline, error)

func (*CiPipelineRepositoryImpl) FindExternalCiByAppIds added in v0.6.13

func (impl *CiPipelineRepositoryImpl) FindExternalCiByAppIds(appIds []int) ([]*ExternalCiPipeline, error)

func (*CiPipelineRepositoryImpl) FindExternalCiByCiPipelineId

func (impl *CiPipelineRepositoryImpl) FindExternalCiByCiPipelineId(ciPipelineId int) (*ExternalCiPipeline, error)

func (*CiPipelineRepositoryImpl) FindExternalCiById added in v0.6.9

func (impl *CiPipelineRepositoryImpl) FindExternalCiById(id int) (*ExternalCiPipeline, error)

func (*CiPipelineRepositoryImpl) FindLinkedCiCount added in v0.6.26

func (impl *CiPipelineRepositoryImpl) FindLinkedCiCount(ciPipelineId int) (int, error)

func (*CiPipelineRepositoryImpl) FindNumberOfAppsWithCiPipeline added in v0.4.14

func (impl *CiPipelineRepositoryImpl) FindNumberOfAppsWithCiPipeline(appIds []int) (count int, err error)

func (*CiPipelineRepositoryImpl) FindOneWithAppData added in v0.6.29

func (impl *CiPipelineRepositoryImpl) FindOneWithAppData(id int) (pipeline *CiPipeline, err error)

FindOneWithAppData is to be used for fetching minimum data (including app.App) for CiPipeline for the given CiPipeline.Id

func (*CiPipelineRepositoryImpl) FindParentCiPipelineMapByAppId added in v0.6.17

func (impl *CiPipelineRepositoryImpl) FindParentCiPipelineMapByAppId(appId int) ([]*CiPipeline, []int, error)

func (*CiPipelineRepositoryImpl) FindWithMinDataByCiPipelineId added in v0.6.17

func (impl *CiPipelineRepositoryImpl) FindWithMinDataByCiPipelineId(id int) (pipeline *CiPipeline, err error)

func (*CiPipelineRepositoryImpl) GetCiPipelineByArtifactId added in v0.6.19

func (impl *CiPipelineRepositoryImpl) GetCiPipelineByArtifactId(artifactId int) (*CiPipeline, error)

func (*CiPipelineRepositoryImpl) GetDownStreamInfo added in v0.7.0

func (impl *CiPipelineRepositoryImpl) GetDownStreamInfo(ctx context.Context, sourceCiPipelineId int,
	appNameMatch, envNameMatch string, req *pagination.RepositoryRequest) ([]ciPipeline.LinkedCIDetails, int, error)

func (*CiPipelineRepositoryImpl) GetExternalCiPipelineByArtifactId added in v0.6.19

func (impl *CiPipelineRepositoryImpl) GetExternalCiPipelineByArtifactId(artifactId int) (*ExternalCiPipeline, error)

func (*CiPipelineRepositoryImpl) GetLinkedCiPipelines added in v0.7.0

func (impl *CiPipelineRepositoryImpl) GetLinkedCiPipelines(ctx context.Context, ciPipelineId int) ([]*CiPipeline, error)

func (*CiPipelineRepositoryImpl) MarkCiPipelineScriptsInactiveByCiPipelineId added in v0.4.2

func (impl *CiPipelineRepositoryImpl) MarkCiPipelineScriptsInactiveByCiPipelineId(ciPipelineId int, tx *pg.Tx) error

func (*CiPipelineRepositoryImpl) PipelineExistsByName

func (impl *CiPipelineRepositoryImpl) PipelineExistsByName(names []string) (found []string, err error)

func (*CiPipelineRepositoryImpl) Save

func (impl *CiPipelineRepositoryImpl) Save(pipeline *CiPipeline, tx *pg.Tx) error

func (*CiPipelineRepositoryImpl) SaveCiEnvMapping added in v0.6.21

func (impl *CiPipelineRepositoryImpl) SaveCiEnvMapping(cienvmapping *CiEnvMapping, tx *pg.Tx) error

func (*CiPipelineRepositoryImpl) SaveCiPipelineScript

func (impl *CiPipelineRepositoryImpl) SaveCiPipelineScript(ciPipelineScript *CiPipelineScript, tx *pg.Tx) error

func (*CiPipelineRepositoryImpl) SaveExternalCi

func (impl *CiPipelineRepositoryImpl) SaveExternalCi(pipeline *ExternalCiPipeline, tx *pg.Tx) (*ExternalCiPipeline, error)

func (*CiPipelineRepositoryImpl) Update

func (impl *CiPipelineRepositoryImpl) Update(pipeline *CiPipeline, tx *pg.Tx) error

func (*CiPipelineRepositoryImpl) UpdateCiEnvMapping added in v0.6.21

func (impl *CiPipelineRepositoryImpl) UpdateCiEnvMapping(cienvmapping *CiEnvMapping, tx *pg.Tx) error

func (*CiPipelineRepositoryImpl) UpdateCiPipelineScript

func (impl *CiPipelineRepositoryImpl) UpdateCiPipelineScript(script *CiPipelineScript, tx *pg.Tx) error

func (*CiPipelineRepositoryImpl) UpdateExternalCi

func (impl *CiPipelineRepositoryImpl) UpdateExternalCi(pipeline *ExternalCiPipeline, tx *pg.Tx) (*ExternalCiPipeline, error)

type CiPipelineScript

type CiPipelineScript struct {
	Id             int    `sql:"id,pk"`
	Name           string `sql:"name"`
	Index          int    `sql:"index"`
	CiPipelineId   int    `sql:"ci_pipeline_id"`
	Script         string `sql:"script"`
	Stage          string `sql:"stage"`
	OutputLocation string `sql:"output_location"`
	Active         bool   `sql:"active,notnull"`
	sql.AuditLog
	// contains filtered or unexported fields
}

type CiTemplate

type CiTemplate struct {
	Id                        int     `sql:"id"`
	AppId                     int     `sql:"app_id"`             //foreign key of app
	DockerRegistryId          *string `sql:"docker_registry_id"` //foreign key of registry
	DockerRepository          string  `sql:"docker_repository"`
	DockerfilePath            string  `sql:"dockerfile_path"`
	Args                      string  `sql:"args"` //json string format of map[string]string
	TargetPlatform            string  `sql:"target_platform,notnull"`
	BeforeDockerBuild         string  `sql:"before_docker_build"` //json string  format of []*Task
	AfterDockerBuild          string  `sql:"after_docker_build"`  //json string  format of []*Task
	TemplateName              string  `sql:"template_name"`
	Version                   string  `sql:"version"` //gocd etage
	Active                    bool    `sql:"active,notnull"`
	GitMaterialId             int     `sql:"git_material_id"`
	BuildContextGitMaterialId int     `sql:"build_context_git_material_id"`
	DockerBuildOptions        string  `sql:"docker_build_options"` //json string format of map[string]string
	CiBuildConfigId           int     `sql:"ci_build_config_id"`
	//BuildContext              string   `sql:"build_context,notnull"`
	sql.AuditLog
	App            *app.App
	DockerRegistry *dockerRegistryRepository.DockerArtifactStore
	GitMaterial    *GitMaterial
	CiBuildConfig  *CiBuildConfig
	// contains filtered or unexported fields
}

type CiTemplateOverride added in v0.6.0

type CiTemplateOverride struct {
	Id                        int    `sql:"id"`
	CiPipelineId              int    `sql:"ci_pipeline_id"`
	DockerRegistryId          string `sql:"docker_registry_id"`
	DockerRepository          string `sql:"docker_repository"`
	DockerfilePath            string `sql:"dockerfile_path"`
	GitMaterialId             int    `sql:"git_material_id"`
	BuildContextGitMaterialId int    `sql:"build_context_git_material_id"`
	Active                    bool   `sql:"active,notnull"`
	CiBuildConfigId           int    `sql:"ci_build_config_id"`
	sql.AuditLog
	GitMaterial    *GitMaterial
	DockerRegistry *repository.DockerArtifactStore
	CiBuildConfig  *CiBuildConfig
	// contains filtered or unexported fields
}

type CiTemplateOverrideRepository added in v0.6.0

type CiTemplateOverrideRepository interface {
	Save(templateOverrideConfig *CiTemplateOverride) (*CiTemplateOverride, error)
	Update(templateOverrideConfig *CiTemplateOverride) (*CiTemplateOverride, error)
	FindByAppId(appId int) ([]*CiTemplateOverride, error)
	FindByCiPipelineIds(ciPipelineIds []int) ([]*CiTemplateOverride, error)
	FindByCiPipelineId(ciPipelineId int) (*CiTemplateOverride, error)
}

type CiTemplateOverrideRepositoryImpl added in v0.6.0

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

func NewCiTemplateOverrideRepositoryImpl added in v0.6.0

func NewCiTemplateOverrideRepositoryImpl(dbConnection *pg.DB,
	logger *zap.SugaredLogger) *CiTemplateOverrideRepositoryImpl

func (*CiTemplateOverrideRepositoryImpl) FindByAppId added in v0.6.0

func (repo *CiTemplateOverrideRepositoryImpl) FindByAppId(appId int) ([]*CiTemplateOverride, error)

func (*CiTemplateOverrideRepositoryImpl) FindByCiPipelineId added in v0.6.0

func (repo *CiTemplateOverrideRepositoryImpl) FindByCiPipelineId(ciPipelineId int) (*CiTemplateOverride, error)

func (*CiTemplateOverrideRepositoryImpl) FindByCiPipelineIds added in v0.6.16

func (repo *CiTemplateOverrideRepositoryImpl) FindByCiPipelineIds(ciPipelineIds []int) ([]*CiTemplateOverride, error)

func (*CiTemplateOverrideRepositoryImpl) Save added in v0.6.0

func (repo *CiTemplateOverrideRepositoryImpl) Save(templateOverrideConfig *CiTemplateOverride) (*CiTemplateOverride, error)

func (*CiTemplateOverrideRepositoryImpl) Update added in v0.6.0

func (repo *CiTemplateOverrideRepositoryImpl) Update(templateOverrideConfig *CiTemplateOverride) (*CiTemplateOverride, error)

type CiTemplateRepository

type CiTemplateRepository interface {
	Save(material *CiTemplate) error
	FindByAppId(appId int) (ciTemplate *CiTemplate, err error)
	Update(material *CiTemplate) error
	FindByDockerRegistryId(dockerRegistryId string) (ciTemplates []*CiTemplate, err error)
	FindNumberOfAppsWithDockerConfigured(appIds []int) (int, error)
	FindByAppIds(appIds []int) ([]*CiTemplate, error)
}

type CiTemplateRepositoryImpl

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

func NewCiTemplateRepositoryImpl

func NewCiTemplateRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *CiTemplateRepositoryImpl

func (CiTemplateRepositoryImpl) FindByAppId

func (impl CiTemplateRepositoryImpl) FindByAppId(appId int) (ciTemplate *CiTemplate, err error)

func (CiTemplateRepositoryImpl) FindByAppIds added in v0.6.16

func (impl CiTemplateRepositoryImpl) FindByAppIds(appIds []int) ([]*CiTemplate, error)

func (CiTemplateRepositoryImpl) FindByDockerRegistryId added in v0.3.15

func (impl CiTemplateRepositoryImpl) FindByDockerRegistryId(dockerRegistryId string) (ciTemplates []*CiTemplate, err error)

func (CiTemplateRepositoryImpl) FindNumberOfAppsWithDockerConfigured added in v0.4.14

func (impl CiTemplateRepositoryImpl) FindNumberOfAppsWithDockerConfigured(appIds []int) (int, error)

func (CiTemplateRepositoryImpl) Save

func (impl CiTemplateRepositoryImpl) Save(material *CiTemplate) error

func (CiTemplateRepositoryImpl) Update

func (impl CiTemplateRepositoryImpl) Update(material *CiTemplate) error

type CiWorkflow

type CiWorkflow struct {
	Id                      int                  `sql:"id,pk"`
	Name                    string               `sql:"name"`
	Status                  string               `sql:"status"`
	PodStatus               string               `sql:"pod_status"`
	Message                 string               `sql:"message"`
	StartedOn               time.Time            `sql:"started_on"`
	FinishedOn              time.Time            `sql:"finished_on"`
	CiPipelineId            int                  `sql:"ci_pipeline_id"`
	Namespace               string               `sql:"namespace"`
	BlobStorageEnabled      bool                 `sql:"blob_storage_enabled,notnull"`
	LogLocation             string               `sql:"log_file_path"`
	GitTriggers             map[int]GitCommit    `sql:"git_triggers"`
	TriggeredBy             int32                `sql:"triggered_by"`
	CiArtifactLocation      string               `sql:"ci_artifact_location"`
	PodName                 string               `sql:"pod_name"`
	CiBuildType             string               `sql:"ci_build_type"`
	EnvironmentId           int                  `sql:"environment_id"`
	ReferenceCiWorkflowId   int                  `sql:"ref_ci_workflow_id"`
	ParentCiWorkFlowId      int                  `sql:"parent_ci_workflow_id"`
	ExecutorType            WorkflowExecutorType `sql:"executor_type"` //awf, system
	ImagePathReservationId  int                  `sql:"image_path_reservation_id"`
	ImagePathReservationIds []int                `sql:"image_path_reservation_ids" pg:",array"`
	CiPipeline              *CiPipeline
	// contains filtered or unexported fields
}

func (*CiWorkflow) InProgress added in v0.6.26

func (ciWorkflow *CiWorkflow) InProgress() bool

func (*CiWorkflow) IsExternalRunInJobType added in v0.6.25

func (ciWorkflow *CiWorkflow) IsExternalRunInJobType() bool

type CiWorkflowConfig

type CiWorkflowConfig struct {
	Id                       int    `sql:"id,pk"`
	CiTimeout                int64  `sql:"ci_timeout"`
	MinCpu                   string `sql:"min_cpu"`
	MaxCpu                   string `sql:"max_cpu"`
	MinMem                   string `sql:"min_mem"`
	MaxMem                   string `sql:"max_mem"`
	MinStorage               string `sql:"min_storage"`
	MaxStorage               string `sql:"max_storage"`
	MinEphStorage            string `sql:"min_eph_storage"`
	MaxEphStorage            string `sql:"max_eph_storage"`
	CiCacheBucket            string `sql:"ci_cache_bucket"`
	CiCacheRegion            string `sql:"ci_cache_region"`
	CiImage                  string `sql:"ci_image"`
	Namespace                string `sql:"wf_namespace"`
	CiPipelineId             int    `sql:"ci_pipeline_id"`
	LogsBucket               string `sql:"logs_bucket"`
	CiArtifactLocationFormat string `sql:"ci_artifact_location_format"`
	// contains filtered or unexported fields
}

type CiWorkflowRepository

type CiWorkflowRepository interface {
	SaveWorkFlowConfig(config *CiWorkflowConfig) error
	FindConfigByPipelineId(pipelineId int) (*CiWorkflowConfig, error)

	SaveWorkFlow(wf *CiWorkflow) error
	FindLastTriggeredWorkflow(pipelineId int) (*CiWorkflow, error)
	UpdateWorkFlow(wf *CiWorkflow) error
	FindByStatusesIn(activeStatuses []string) ([]*CiWorkflow, error)
	FindByPipelineId(pipelineId int, offset int, size int) ([]WorkflowWithArtifact, error)
	FindById(id int) (*CiWorkflow, error)
	FindRetriedWorkflowCountByReferenceId(id int) (int, error)
	FindCiWorkflowGitTriggersById(id int) (workflow *CiWorkflow, err error)
	FindCiWorkflowGitTriggersByIds(ids []int) ([]*CiWorkflow, error)
	FindByName(name string) (*CiWorkflow, error)

	FindLastTriggeredWorkflowByCiIds(pipelineId []int) (ciWorkflow []*CiWorkflow, err error)
	FindLastTriggeredWorkflowByArtifactId(ciArtifactId int) (ciWorkflow *CiWorkflow, err error)
	FindAllLastTriggeredWorkflowByArtifactId(ciArtifactId []int) (ciWorkflow []*CiWorkflow, err error)
	FindAllTriggeredWorkflowCountInLast24Hour() (ciWorkflowCount int, err error)
	FindLastTriggeredWorkflowGitTriggersByArtifactId(ciArtifactId int) (ciWorkflow *CiWorkflow, err error)
	FindLastTriggeredWorkflowGitTriggersByArtifactIds(ciArtifactIds []int) ([]*WorkflowWithArtifact, error)
	ExistsByStatus(status string) (bool, error)
	FindBuildTypeAndStatusDataOfLast1Day() []*BuildTypeCount
	FIndCiWorkflowStatusesByAppId(appId int) ([]*CiWorkflowStatus, error)
}

type CiWorkflowRepositoryImpl

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

func NewCiWorkflowRepositoryImpl

func NewCiWorkflowRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *CiWorkflowRepositoryImpl

func (*CiWorkflowRepositoryImpl) ExistsByStatus added in v0.4.3

func (impl *CiWorkflowRepositoryImpl) ExistsByStatus(status string) (bool, error)

func (*CiWorkflowRepositoryImpl) FIndCiWorkflowStatusesByAppId added in v0.6.17

func (impl *CiWorkflowRepositoryImpl) FIndCiWorkflowStatusesByAppId(appId int) ([]*CiWorkflowStatus, error)

func (*CiWorkflowRepositoryImpl) FindAllLastTriggeredWorkflowByArtifactId added in v0.6.18

func (impl *CiWorkflowRepositoryImpl) FindAllLastTriggeredWorkflowByArtifactId(ciArtifactIds []int) (ciWorkflows []*CiWorkflow, err error)

func (*CiWorkflowRepositoryImpl) FindAllTriggeredWorkflowCountInLast24Hour added in v0.7.0

func (impl *CiWorkflowRepositoryImpl) FindAllTriggeredWorkflowCountInLast24Hour() (ciWorkflowCount int, err error)

func (*CiWorkflowRepositoryImpl) FindBuildTypeAndStatusDataOfLast1Day added in v0.6.6

func (impl *CiWorkflowRepositoryImpl) FindBuildTypeAndStatusDataOfLast1Day() []*BuildTypeCount

func (*CiWorkflowRepositoryImpl) FindById

func (impl *CiWorkflowRepositoryImpl) FindById(id int) (*CiWorkflow, error)

func (*CiWorkflowRepositoryImpl) FindByName

func (impl *CiWorkflowRepositoryImpl) FindByName(name string) (*CiWorkflow, error)

func (*CiWorkflowRepositoryImpl) FindByPipelineId

func (impl *CiWorkflowRepositoryImpl) FindByPipelineId(pipelineId int, offset int, limit int) ([]WorkflowWithArtifact, error)

FindByPipelineId gets only those workflowWithArtifact whose parent_ci_workflow_id is null, this is done to accommodate multiple ci_artifacts through a single workflow(parent), making child workflows for other ci_artifacts (this has been done due to design understanding and db constraint) single workflow single ci-artifact

func (*CiWorkflowRepositoryImpl) FindByStatusesIn

func (impl *CiWorkflowRepositoryImpl) FindByStatusesIn(activeStatuses []string) ([]*CiWorkflow, error)

func (*CiWorkflowRepositoryImpl) FindCiWorkflowGitTriggersById added in v0.6.17

func (impl *CiWorkflowRepositoryImpl) FindCiWorkflowGitTriggersById(id int) (ciWorkflow *CiWorkflow, err error)

func (*CiWorkflowRepositoryImpl) FindCiWorkflowGitTriggersByIds added in v0.6.26

func (impl *CiWorkflowRepositoryImpl) FindCiWorkflowGitTriggersByIds(ids []int) ([]*CiWorkflow, error)

func (*CiWorkflowRepositoryImpl) FindConfigByPipelineId

func (impl *CiWorkflowRepositoryImpl) FindConfigByPipelineId(pipelineId int) (*CiWorkflowConfig, error)

func (*CiWorkflowRepositoryImpl) FindLastTriggeredWorkflow

func (impl *CiWorkflowRepositoryImpl) FindLastTriggeredWorkflow(pipelineId int) (ciWorkflow *CiWorkflow, err error)

func (*CiWorkflowRepositoryImpl) FindLastTriggeredWorkflowByArtifactId

func (impl *CiWorkflowRepositoryImpl) FindLastTriggeredWorkflowByArtifactId(ciArtifactId int) (ciWorkflow *CiWorkflow, err error)

func (*CiWorkflowRepositoryImpl) FindLastTriggeredWorkflowByCiIds

func (impl *CiWorkflowRepositoryImpl) FindLastTriggeredWorkflowByCiIds(pipelineId []int) (ciWorkflow []*CiWorkflow, err error)

func (*CiWorkflowRepositoryImpl) FindLastTriggeredWorkflowGitTriggersByArtifactId added in v0.6.17

func (impl *CiWorkflowRepositoryImpl) FindLastTriggeredWorkflowGitTriggersByArtifactId(ciArtifactId int) (ciWorkflow *CiWorkflow, err error)

func (*CiWorkflowRepositoryImpl) FindLastTriggeredWorkflowGitTriggersByArtifactIds added in v0.6.26

func (impl *CiWorkflowRepositoryImpl) FindLastTriggeredWorkflowGitTriggersByArtifactIds(ciArtifactIds []int) ([]*WorkflowWithArtifact, error)

func (*CiWorkflowRepositoryImpl) FindRetriedWorkflowCountByReferenceId added in v0.6.24

func (impl *CiWorkflowRepositoryImpl) FindRetriedWorkflowCountByReferenceId(id int) (int, error)

func (*CiWorkflowRepositoryImpl) SaveWorkFlow

func (impl *CiWorkflowRepositoryImpl) SaveWorkFlow(wf *CiWorkflow) error

func (*CiWorkflowRepositoryImpl) SaveWorkFlowConfig

func (impl *CiWorkflowRepositoryImpl) SaveWorkFlowConfig(config *CiWorkflowConfig) error

func (*CiWorkflowRepositoryImpl) UpdateWorkFlow

func (impl *CiWorkflowRepositoryImpl) UpdateWorkFlow(wf *CiWorkflow) error

type CiWorkflowStatus

type CiWorkflowStatus struct {
	CiPipelineId      int    `json:"ciPipelineId"`
	CiPipelineName    string `json:"ciPipelineName,omitempty"`
	CiStatus          string `json:"ciStatus"`
	StorageConfigured bool   `json:"storageConfigured"`
	CiWorkflowId      int    `json:"ciWorkflowId,omitempty"`
}

type DeploymentObject added in v0.6.26

type DeploymentObject struct {
	DeploymentType models.DeploymentType `sql:"deployment_type"`
	PipelineId     int                   `sql:"pipeline_id"`
	Status         string                `sql:"status"`
}

type ExternalCiPipeline

type ExternalCiPipeline struct {
	Id          int    `sql:"id,pk"`
	AppId       int    `sql:"app_id"`
	Active      bool   `sql:"active,notnull"`
	AccessToken string `sql:"access_token"`
	sql.AuditLog
	// contains filtered or unexported fields
}

type GitCommit

type GitCommit struct {
	Commit                 string //git hash
	Author                 string
	Date                   time.Time
	Message                string
	Changes                []string
	WebhookData            WebhookData
	CiConfigureSourceValue string
	GitRepoUrl             string
	GitRepoName            string
	CiConfigureSourceType  SourceType
}

type GitMaterial

type GitMaterial struct {
	Id              int      `sql:"id,pk"`
	AppId           int      `sql:"app_id,notnull"`
	GitProviderId   int      `sql:"git_provider_id,notnull"`
	Active          bool     `sql:"active,notnull"`
	Url             string   `sql:"url,omitempty"`
	Name            string   `sql:"name, omitempty"`
	CheckoutPath    string   `sql:"checkout_path, omitempty"`
	FetchSubmodules bool     `sql:"fetch_submodules,notnull"`
	FilterPattern   []string `sql:"filter_pattern"`
	sql.AuditLog
	App         *app.App
	GitProvider *repository.GitProvider
	// contains filtered or unexported fields
}

TODO: add support for submodule

type MaterialRepository

type MaterialRepository interface {
	MaterialExists(url string) (bool, error)
	SaveMaterial(tx *pg.Tx, material *GitMaterial) error
	UpdateMaterial(tx *pg.Tx, material *GitMaterial) error
	Update(materials []*GitMaterial) error
	FindByAppId(appId int) ([]*GitMaterial, error)
	FindById(Id int) (*GitMaterial, error)
	FindByAppIdAndGitMaterialId(appId, id int) (*GitMaterial, error)
	UpdateMaterialScmId(material *GitMaterial) error
	FindByAppIdAndCheckoutPath(appId int, checkoutPath string) (*GitMaterial, error)
	FindByGitProviderId(gitProviderId int) (materials []*GitMaterial, err error)
	MarkMaterialDeleted(tx *pg.Tx, material *GitMaterial) error
	FindNumberOfAppsWithGitRepo(appIds []int) (int, error)
	FindByAppIds(appIds []int) ([]*GitMaterial, error)
}

type MaterialRepositoryImpl

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

func NewMaterialRepositoryImpl

func NewMaterialRepositoryImpl(dbConnection *pg.DB) *MaterialRepositoryImpl

func (MaterialRepositoryImpl) FindByAppId

func (repo MaterialRepositoryImpl) FindByAppId(appId int) ([]*GitMaterial, error)

func (MaterialRepositoryImpl) FindByAppIdAndCheckoutPath added in v0.3.6

func (repo MaterialRepositoryImpl) FindByAppIdAndCheckoutPath(appId int, checkoutPath string) (*GitMaterial, error)

func (MaterialRepositoryImpl) FindByAppIdAndGitMaterialId added in v0.6.23

func (repo MaterialRepositoryImpl) FindByAppIdAndGitMaterialId(appId, id int) (*GitMaterial, error)

func (MaterialRepositoryImpl) FindByAppIds added in v0.6.16

func (repo MaterialRepositoryImpl) FindByAppIds(appId []int) ([]*GitMaterial, error)

func (MaterialRepositoryImpl) FindByGitProviderId added in v0.3.15

func (repo MaterialRepositoryImpl) FindByGitProviderId(gitProviderId int) (materials []*GitMaterial, err error)

func (MaterialRepositoryImpl) FindById

func (repo MaterialRepositoryImpl) FindById(Id int) (*GitMaterial, error)

func (MaterialRepositoryImpl) FindNumberOfAppsWithGitRepo added in v0.4.14

func (repo MaterialRepositoryImpl) FindNumberOfAppsWithGitRepo(appIds []int) (int, error)

func (MaterialRepositoryImpl) MarkMaterialDeleted added in v0.3.15

func (repo MaterialRepositoryImpl) MarkMaterialDeleted(tx *pg.Tx, material *GitMaterial) error

func (MaterialRepositoryImpl) MaterialExists

func (repo MaterialRepositoryImpl) MaterialExists(url string) (bool, error)

func (MaterialRepositoryImpl) SaveMaterial

func (repo MaterialRepositoryImpl) SaveMaterial(tx *pg.Tx, material *GitMaterial) error

func (MaterialRepositoryImpl) Update

func (impl MaterialRepositoryImpl) Update(materials []*GitMaterial) error

func (MaterialRepositoryImpl) UpdateMaterial

func (repo MaterialRepositoryImpl) UpdateMaterial(tx *pg.Tx, material *GitMaterial) error

func (MaterialRepositoryImpl) UpdateMaterialScmId

func (repo MaterialRepositoryImpl) UpdateMaterialScmId(material *GitMaterial) error

type Pipeline

type Pipeline struct {
	Id                            int `sql:"id,pk"`
	AppId                         int `sql:"app_id,notnull"`
	App                           app.App
	CiPipelineId                  int         `sql:"ci_pipeline_id"`
	TriggerType                   TriggerType `sql:"trigger_type,notnull"` // automatic, manual
	EnvironmentId                 int         `sql:"environment_id"`
	Name                          string      `sql:"pipeline_name,notnull"`
	Deleted                       bool        `sql:"deleted,notnull"`
	PreStageConfig                string      `sql:"pre_stage_config_yaml"`
	PostStageConfig               string      `sql:"post_stage_config_yaml"`
	PreTriggerType                TriggerType `sql:"pre_trigger_type"`                   // automatic, manual
	PostTriggerType               TriggerType `sql:"post_trigger_type"`                  // automatic, manual
	PreStageConfigMapSecretNames  string      `sql:"pre_stage_config_map_secret_names"`  // configmap names
	PostStageConfigMapSecretNames string      `sql:"post_stage_config_map_secret_names"` // secret names
	RunPreStageInEnv              bool        `sql:"run_pre_stage_in_env"`               // secret names
	RunPostStageInEnv             bool        `sql:"run_post_stage_in_env"`              // secret names
	DeploymentAppCreated          bool        `sql:"deployment_app_created,notnull"`
	DeploymentAppType             string      `sql:"deployment_app_type,notnull"` // Deprecated;
	DeploymentAppName             string      `sql:"deployment_app_name"`
	DeploymentAppDeleteRequest    bool        `sql:"deployment_app_delete_request,notnull"`
	Environment                   repository.Environment
	sql.AuditLog
	// contains filtered or unexported fields
}

type PipelineRepository

type PipelineRepository interface {
	Save(pipeline []*Pipeline, tx *pg.Tx) error
	Update(pipeline *Pipeline, tx *pg.Tx) error
	FindActiveByAppId(appId int) (pipelines []*Pipeline, err error)
	Delete(id int, userId int32, tx *pg.Tx) error
	MarkPartiallyDeleted(id int, userId int32, tx *pg.Tx) error
	FindByName(pipelineName string) (pipeline *Pipeline, err error)
	PipelineExists(pipelineName string) (bool, error)
	FindById(id int) (pipeline *Pipeline, err error)
	FindByIdEvenIfInactive(id int) (pipeline *Pipeline, err error)
	GetPostStageConfigById(id int) (pipeline *Pipeline, err error)
	FindAppAndEnvDetailsByPipelineId(id int) (pipeline *Pipeline, err error)
	FindActiveByEnvIdAndDeploymentType(environmentId int, deploymentAppType string, exclusionList []int, includeApps []int) ([]*Pipeline, error)
	FindByIdsIn(ids []int) ([]*Pipeline, error)
	FindByCiPipelineIdsIn(ciPipelineIds []int) ([]*Pipeline, error)
	FindAutomaticByCiPipelineId(ciPipelineId int) (pipelines []*Pipeline, err error)
	GetByEnvOverrideId(envOverrideId int) ([]Pipeline, error)
	GetByEnvOverrideIdAndEnvId(envOverrideId, envId int) (Pipeline, error)
	FindActiveByAppIdAndEnvironmentId(appId int, environmentId int) (pipelines []*Pipeline, err error)
	UniqueAppEnvironmentPipelines() ([]*Pipeline, error)
	FindByCiPipelineId(ciPipelineId int) (pipelines []*Pipeline, err error)
	FindByParentCiPipelineId(ciPipelineId int) (pipelines []*Pipeline, err error)
	FindByPipelineTriggerGitHash(gitHash string) (pipeline *Pipeline, err error)
	FindByIdsInAndEnvironment(ids []int, environmentId int) ([]*Pipeline, error)
	FindActiveByAppIdAndEnvironmentIdV2() (pipelines []*Pipeline, err error)
	GetConnection() *pg.DB
	FindAllPipelineCreatedCountInLast24Hour() (pipelineCount int, err error)
	FindAllDeletedPipelineCountInLast24Hour() (pipelineCount int, err error)
	FindActiveByEnvId(envId int) (pipelines []*Pipeline, err error)
	FindActivePipelineAppIdsByEnvId(envId int) ([]int, error)
	FindActivePipelineByEnvId(envId int) (pipelines []*Pipeline, err error)
	FindActiveByEnvIds(envId []int) (pipelines []*Pipeline, err error)
	FindActiveByInFilter(envId int, appIdIncludes []int) (pipelines []*Pipeline, err error)
	FindActivePipelineAppIdsByInFilter(envId int, appIdIncludes []int) ([]int, error)
	FindActiveByNotFilter(envId int, appIdExcludes []int) (pipelines []*Pipeline, err error)
	FindAllPipelinesByChartsOverrideAndAppIdAndChartId(chartOverridden bool, appId int, chartId int) (pipelines []*Pipeline, err error)
	FindActiveByAppIdAndPipelineId(appId int, pipelineId int) ([]*Pipeline, error)
	FindActiveByAppIdAndEnvId(appId int, envId int) (*Pipeline, error)
	SetDeploymentAppCreatedInPipeline(deploymentAppCreated bool, pipelineId int, userId int32) error
	UpdateCdPipelineDeploymentAppInFilter(deploymentAppType string, cdPipelineIdIncludes []int, userId int32, deploymentAppCreated bool, delete bool) error
	UpdateCdPipelineAfterDeployment(deploymentAppType string, cdPipelineIdIncludes []int, userId int32, delete bool) error
	FindNumberOfAppsWithCdPipeline(appIds []int) (count int, err error)
	GetAppAndEnvDetailsForDeploymentAppTypePipeline(deploymentAppType string, clusterIds []int) ([]*Pipeline, error)
	GetArgoPipelinesHavingTriggersStuckInLastPossibleNonTerminalTimelines(pendingSinceSeconds int, timeForDegradation int) ([]*Pipeline, error)
	GetArgoPipelinesHavingLatestTriggerStuckInNonTerminalStatuses(deployedBeforeMinutes int, getPipelineDeployedWithinHours int) ([]*Pipeline, error)
	FindIdsByAppIdsAndEnvironmentIds(appIds, environmentIds []int) (ids []int, err error)
	FindIdsByProjectIdsAndEnvironmentIds(projectIds, environmentIds []int) ([]int, error)

	GetArgoPipelineByArgoAppName(argoAppName string) (Pipeline, error)
	FindActiveByAppIds(appIds []int) (pipelines []*Pipeline, err error)
	FindAppAndEnvironmentAndProjectByPipelineIds(pipelineIds []int) (pipelines []*Pipeline, err error)
	FilterDeploymentDeleteRequestedPipelineIds(cdPipelineIds []int) (map[int]bool, error)
	FindDeploymentTypeByPipelineIds(cdPipelineIds []int) (map[int]DeploymentObject, error)
	UpdateCiPipelineId(tx *pg.Tx, pipelineIds []int, ciPipelineId int) error
	UpdateOldCiPipelineIdToNewCiPipelineId(tx *pg.Tx, oldCiPipelineId, newCiPipelineId int) error
	// FindWithEnvironmentByCiIds Possibility of duplicate environment names when filtered by unique pipeline ids
	FindWithEnvironmentByCiIds(ctx context.Context, cIPipelineIds []int) ([]*Pipeline, error)
	FindDeploymentAppTypeByAppIdAndEnvId(appId, envId int) (string, error)
	FindByAppIdToEnvIdsMapping(appIdToEnvIds map[int][]int) ([]*Pipeline, error)
	FindDeploymentAppTypeByIds(ids []int) (pipelines []*Pipeline, err error)
}

type PipelineRepositoryImpl

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

func NewPipelineRepositoryImpl

func NewPipelineRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *PipelineRepositoryImpl

func (PipelineRepositoryImpl) Delete

func (impl PipelineRepositoryImpl) Delete(id int, userId int32, tx *pg.Tx) error

func (PipelineRepositoryImpl) FilterDeploymentDeleteRequestedPipelineIds added in v0.6.17

func (impl PipelineRepositoryImpl) FilterDeploymentDeleteRequestedPipelineIds(cdPipelineIds []int) (map[int]bool, error)

func (PipelineRepositoryImpl) FindActiveByAppId

func (impl PipelineRepositoryImpl) FindActiveByAppId(appId int) (pipelines []*Pipeline, err error)

func (PipelineRepositoryImpl) FindActiveByAppIdAndEnvId added in v0.7.1

func (impl PipelineRepositoryImpl) FindActiveByAppIdAndEnvId(appId int, envId int) (*Pipeline, error)

func (PipelineRepositoryImpl) FindActiveByAppIdAndEnvironmentId

func (impl PipelineRepositoryImpl) FindActiveByAppIdAndEnvironmentId(appId int, environmentId int) (pipelines []*Pipeline, err error)

func (PipelineRepositoryImpl) FindActiveByAppIdAndEnvironmentIdV2

func (impl PipelineRepositoryImpl) FindActiveByAppIdAndEnvironmentIdV2() (pipelines []*Pipeline, err error)

func (PipelineRepositoryImpl) FindActiveByAppIdAndPipelineId added in v0.4.8

func (impl PipelineRepositoryImpl) FindActiveByAppIdAndPipelineId(appId int, pipelineId int) ([]*Pipeline, error)

func (PipelineRepositoryImpl) FindActiveByAppIds added in v0.6.13

func (impl PipelineRepositoryImpl) FindActiveByAppIds(appIds []int) (pipelines []*Pipeline, err error)

func (PipelineRepositoryImpl) FindActiveByEnvId added in v0.3.15

func (impl PipelineRepositoryImpl) FindActiveByEnvId(envId int) (pipelines []*Pipeline, err error)

func (PipelineRepositoryImpl) FindActiveByEnvIdAndDeploymentType added in v0.6.13

func (impl PipelineRepositoryImpl) FindActiveByEnvIdAndDeploymentType(environmentId int,
	deploymentAppType string, exclusionList []int, includeApps []int) ([]*Pipeline, error)

FindActiveByEnvIdAndDeploymentType takes in environment id and current deployment app type and fetches and returns a list of pipelines matching the same excluding given app ids.

func (PipelineRepositoryImpl) FindActiveByEnvIds added in v0.6.17

func (impl PipelineRepositoryImpl) FindActiveByEnvIds(envIds []int) (pipelines []*Pipeline, err error)

func (PipelineRepositoryImpl) FindActiveByInFilter added in v0.6.1

func (impl PipelineRepositoryImpl) FindActiveByInFilter(envId int, appIdIncludes []int) (pipelines []*Pipeline, err error)

func (PipelineRepositoryImpl) FindActiveByNotFilter added in v0.6.1

func (impl PipelineRepositoryImpl) FindActiveByNotFilter(envId int, appIdExcludes []int) (pipelines []*Pipeline, err error)

func (PipelineRepositoryImpl) FindActivePipelineAppIdsByEnvId added in v0.7.2

func (impl PipelineRepositoryImpl) FindActivePipelineAppIdsByEnvId(envId int) ([]int, error)

func (PipelineRepositoryImpl) FindActivePipelineAppIdsByInFilter added in v0.7.2

func (impl PipelineRepositoryImpl) FindActivePipelineAppIdsByInFilter(envId int, appIdIncludes []int) ([]int, error)

func (PipelineRepositoryImpl) FindActivePipelineByEnvId added in v0.6.26

func (impl PipelineRepositoryImpl) FindActivePipelineByEnvId(envId int) (pipelines []*Pipeline, err error)

func (PipelineRepositoryImpl) FindAllDeletedPipelineCountInLast24Hour added in v0.7.0

func (impl PipelineRepositoryImpl) FindAllDeletedPipelineCountInLast24Hour() (pipelineCount int, err error)

func (PipelineRepositoryImpl) FindAllPipelineCreatedCountInLast24Hour added in v0.7.0

func (impl PipelineRepositoryImpl) FindAllPipelineCreatedCountInLast24Hour() (pipelineCount int, err error)

func (PipelineRepositoryImpl) FindAllPipelinesByChartsOverrideAndAppIdAndChartId added in v0.3.21

func (impl PipelineRepositoryImpl) FindAllPipelinesByChartsOverrideAndAppIdAndChartId(hasConfigOverridden bool, appId int, chartId int) (pipelines []*Pipeline, err error)

func (PipelineRepositoryImpl) FindAppAndEnvDetailsByPipelineId added in v0.6.17

func (impl PipelineRepositoryImpl) FindAppAndEnvDetailsByPipelineId(id int) (pipeline *Pipeline, err error)

func (PipelineRepositoryImpl) FindAppAndEnvironmentAndProjectByPipelineIds added in v0.6.15

func (impl PipelineRepositoryImpl) FindAppAndEnvironmentAndProjectByPipelineIds(pipelineIds []int) (pipelines []*Pipeline, err error)

func (PipelineRepositoryImpl) FindAutomaticByCiPipelineId

func (impl PipelineRepositoryImpl) FindAutomaticByCiPipelineId(ciPipelineId int) (pipelines []*Pipeline, err error)

func (PipelineRepositoryImpl) FindByAppIdToEnvIdsMapping added in v0.7.2

func (impl PipelineRepositoryImpl) FindByAppIdToEnvIdsMapping(appIdToEnvIds map[int][]int) ([]*Pipeline, error)

func (PipelineRepositoryImpl) FindByCiPipelineId

func (impl PipelineRepositoryImpl) FindByCiPipelineId(ciPipelineId int) (pipelines []*Pipeline, err error)

func (PipelineRepositoryImpl) FindByCiPipelineIdsIn

func (impl PipelineRepositoryImpl) FindByCiPipelineIdsIn(ciPipelineIds []int) ([]*Pipeline, error)

func (PipelineRepositoryImpl) FindByEnvOverrideId deprecated

func (impl PipelineRepositoryImpl) FindByEnvOverrideId(envOverrideId int) (pipeline []Pipeline, err error)

Deprecated:

func (PipelineRepositoryImpl) FindById

func (impl PipelineRepositoryImpl) FindById(id int) (pipeline *Pipeline, err error)

func (PipelineRepositoryImpl) FindByIdEvenIfInactive added in v0.7.0

func (impl PipelineRepositoryImpl) FindByIdEvenIfInactive(id int) (pipeline *Pipeline, err error)

func (PipelineRepositoryImpl) FindByIdsIn

func (impl PipelineRepositoryImpl) FindByIdsIn(ids []int) ([]*Pipeline, error)

func (PipelineRepositoryImpl) FindByIdsInAndEnvironment

func (impl PipelineRepositoryImpl) FindByIdsInAndEnvironment(ids []int, environmentId int) ([]*Pipeline, error)

func (PipelineRepositoryImpl) FindByName

func (impl PipelineRepositoryImpl) FindByName(pipelineName string) (pipeline *Pipeline, err error)

func (PipelineRepositoryImpl) FindByParentCiPipelineId added in v0.3.12

func (impl PipelineRepositoryImpl) FindByParentCiPipelineId(ciPipelineId int) (pipelines []*Pipeline, err error)

func (PipelineRepositoryImpl) FindByPipelineTriggerGitHash

func (impl PipelineRepositoryImpl) FindByPipelineTriggerGitHash(gitHash string) (pipeline *Pipeline, err error)

func (PipelineRepositoryImpl) FindDeploymentAppTypeByAppIdAndEnvId added in v0.7.2

func (impl PipelineRepositoryImpl) FindDeploymentAppTypeByAppIdAndEnvId(appId, envId int) (string, error)

func (PipelineRepositoryImpl) FindDeploymentAppTypeByIds added in v0.7.2

func (impl PipelineRepositoryImpl) FindDeploymentAppTypeByIds(ids []int) (pipelines []*Pipeline, err error)

func (PipelineRepositoryImpl) FindDeploymentTypeByPipelineIds added in v0.6.26

func (impl PipelineRepositoryImpl) FindDeploymentTypeByPipelineIds(cdPipelineIds []int) (map[int]DeploymentObject, error)

func (PipelineRepositoryImpl) FindIdsByAppIdsAndEnvironmentIds added in v0.6.4

func (impl PipelineRepositoryImpl) FindIdsByAppIdsAndEnvironmentIds(appIds, environmentIds []int) ([]int, error)

func (PipelineRepositoryImpl) FindIdsByProjectIdsAndEnvironmentIds added in v0.6.4

func (impl PipelineRepositoryImpl) FindIdsByProjectIdsAndEnvironmentIds(projectIds, environmentIds []int) ([]int, error)

func (PipelineRepositoryImpl) FindNumberOfAppsWithCdPipeline added in v0.4.14

func (impl PipelineRepositoryImpl) FindNumberOfAppsWithCdPipeline(appIds []int) (count int, err error)

func (PipelineRepositoryImpl) FindWithEnvironmentByCiIds added in v0.7.0

func (impl PipelineRepositoryImpl) FindWithEnvironmentByCiIds(ctx context.Context, cIPipelineIds []int) ([]*Pipeline, error)

func (PipelineRepositoryImpl) GetAppAndEnvDetailsForDeploymentAppTypePipeline added in v0.4.15

func (impl PipelineRepositoryImpl) GetAppAndEnvDetailsForDeploymentAppTypePipeline(deploymentAppType string, clusterIds []int) ([]*Pipeline, error)

func (PipelineRepositoryImpl) GetArgoPipelineByArgoAppName added in v0.6.11

func (impl PipelineRepositoryImpl) GetArgoPipelineByArgoAppName(argoAppName string) (Pipeline, error)

func (PipelineRepositoryImpl) GetArgoPipelinesHavingLatestTriggerStuckInNonTerminalStatuses added in v0.6.11

func (impl PipelineRepositoryImpl) GetArgoPipelinesHavingLatestTriggerStuckInNonTerminalStatuses(getPipelineDeployedBeforeMinutes int, getPipelineDeployedWithinHours int) ([]*Pipeline, error)

func (PipelineRepositoryImpl) GetArgoPipelinesHavingTriggersStuckInLastPossibleNonTerminalTimelines added in v0.6.11

func (impl PipelineRepositoryImpl) GetArgoPipelinesHavingTriggersStuckInLastPossibleNonTerminalTimelines(pendingSinceSeconds int, timeForDegradation int) ([]*Pipeline, error)

func (PipelineRepositoryImpl) GetByEnvOverrideId

func (impl PipelineRepositoryImpl) GetByEnvOverrideId(envOverrideId int) ([]Pipeline, error)

func (PipelineRepositoryImpl) GetByEnvOverrideIdAndEnvId added in v0.3.21

func (impl PipelineRepositoryImpl) GetByEnvOverrideIdAndEnvId(envOverrideId, envId int) (Pipeline, error)

func (PipelineRepositoryImpl) GetConnection

func (impl PipelineRepositoryImpl) GetConnection() *pg.DB

func (PipelineRepositoryImpl) GetPostStageConfigById added in v0.6.17

func (impl PipelineRepositoryImpl) GetPostStageConfigById(id int) (pipeline *Pipeline, err error)

func (PipelineRepositoryImpl) MarkPartiallyDeleted added in v0.7.1

func (impl PipelineRepositoryImpl) MarkPartiallyDeleted(id int, userId int32, tx *pg.Tx) error

func (PipelineRepositoryImpl) PipelineExists

func (impl PipelineRepositoryImpl) PipelineExists(pipelineName string) (bool, error)

func (PipelineRepositoryImpl) Save

func (impl PipelineRepositoryImpl) Save(pipeline []*Pipeline, tx *pg.Tx) error

func (PipelineRepositoryImpl) SetDeploymentAppCreatedInPipeline added in v0.6.17

func (impl PipelineRepositoryImpl) SetDeploymentAppCreatedInPipeline(deploymentAppCreated bool, pipelineId int, userId int32) error

func (PipelineRepositoryImpl) UniqueAppEnvironmentPipelines

func (impl PipelineRepositoryImpl) UniqueAppEnvironmentPipelines() ([]*Pipeline, error)

func (PipelineRepositoryImpl) Update

func (impl PipelineRepositoryImpl) Update(pipeline *Pipeline, tx *pg.Tx) error

func (PipelineRepositoryImpl) UpdateCdPipelineAfterDeployment added in v0.6.17

func (impl PipelineRepositoryImpl) UpdateCdPipelineAfterDeployment(deploymentAppType string,
	cdPipelineIdIncludes []int, userId int32, isDeleted bool) error

func (PipelineRepositoryImpl) UpdateCdPipelineDeploymentAppInFilter added in v0.6.13

func (impl PipelineRepositoryImpl) UpdateCdPipelineDeploymentAppInFilter(deploymentAppType string,
	cdPipelineIdIncludes []int, userId int32, deploymentAppCreated bool, isDeleted bool) error

UpdateCdPipelineDeploymentAppInFilter takes in deployment app type and list of cd pipeline ids and updates the deploymentAppType and sets deployment_app_created to false in the table for given ids.

func (PipelineRepositoryImpl) UpdateCiPipelineId added in v0.7.2

func (impl PipelineRepositoryImpl) UpdateCiPipelineId(tx *pg.Tx, pipelineIds []int, ciPipelineId int) error

func (PipelineRepositoryImpl) UpdateOldCiPipelineIdToNewCiPipelineId added in v0.6.26

func (impl PipelineRepositoryImpl) UpdateOldCiPipelineIdToNewCiPipelineId(tx *pg.Tx, oldCiPipelineId, newCiPipelineId int) error

type PipelineStatusSyncDetail added in v0.6.11

type PipelineStatusSyncDetail struct {
	Id                           int       `sql:"id,pk"`
	InstalledAppVersionHistoryId int       `sql:"installed_app_version_history_id,type:integer"`
	CdWorkflowRunnerId           int       `sql:"cd_workflow_runner_id,type:integer"`
	LastSyncedAt                 time.Time `sql:"last_synced_at"`
	SyncCount                    int       `sql:"sync_count"`
	sql.AuditLog
	// contains filtered or unexported fields
}

type PipelineStatusSyncDetailRepository added in v0.6.11

type PipelineStatusSyncDetailRepository interface {
	Save(model *PipelineStatusSyncDetail) error
	Update(model *PipelineStatusSyncDetail) error
	GetByCdWfrId(cdWfrId int) (*PipelineStatusSyncDetail, error)
	GetByInstalledAppVersionHistoryId(installedAppVersionHistoryId int) (*PipelineStatusSyncDetail, error)
	GetOfLatestCdWfrByCdPipelineId(pipelineId int) (*PipelineStatusSyncDetail, error)
	GetOfLatestInstalledAppVersionHistoryByInstalledAppVersionId(installedAppVersionId int) (*PipelineStatusSyncDetail, error)
}

type PipelineStatusSyncDetailRepositoryImpl added in v0.6.11

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

func NewPipelineStatusSyncDetailRepositoryImpl added in v0.6.11

func NewPipelineStatusSyncDetailRepositoryImpl(dbConnection *pg.DB,
	logger *zap.SugaredLogger) *PipelineStatusSyncDetailRepositoryImpl

func (*PipelineStatusSyncDetailRepositoryImpl) GetByCdWfrId added in v0.6.11

func (*PipelineStatusSyncDetailRepositoryImpl) GetByInstalledAppVersionHistoryId added in v0.6.17

func (impl *PipelineStatusSyncDetailRepositoryImpl) GetByInstalledAppVersionHistoryId(installedAppVersionHistoryId int) (*PipelineStatusSyncDetail, error)

func (*PipelineStatusSyncDetailRepositoryImpl) GetOfLatestCdWfrByCdPipelineId added in v0.6.11

func (impl *PipelineStatusSyncDetailRepositoryImpl) GetOfLatestCdWfrByCdPipelineId(pipelineId int) (*PipelineStatusSyncDetail, error)

func (*PipelineStatusSyncDetailRepositoryImpl) GetOfLatestInstalledAppVersionHistoryByInstalledAppVersionId added in v0.6.17

func (impl *PipelineStatusSyncDetailRepositoryImpl) GetOfLatestInstalledAppVersionHistoryByInstalledAppVersionId(installedAppVersionId int) (*PipelineStatusSyncDetail, error)

func (*PipelineStatusSyncDetailRepositoryImpl) Save added in v0.6.11

func (*PipelineStatusSyncDetailRepositoryImpl) Update added in v0.6.11

type PipelineStatusTimeline added in v0.4.28

type PipelineStatusTimeline struct {
	Id                           int                           `sql:"id,pk"`
	InstalledAppVersionHistoryId int                           `sql:"installed_app_version_history_id,type:integer"`
	CdWorkflowRunnerId           int                           `sql:"cd_workflow_runner_id,type:integer"`
	Status                       timelineStatus.TimelineStatus `sql:"status"`
	StatusDetail                 string                        `sql:"status_detail"`
	StatusTime                   time.Time                     `sql:"status_time"`
	sql.AuditLog
	// contains filtered or unexported fields
}

type PipelineStatusTimelineRepository added in v0.4.28

type PipelineStatusTimelineRepository interface {
	SaveTimelines(timelines []*PipelineStatusTimeline) error
	SaveTimelinesWithTxn(timelines []*PipelineStatusTimeline, tx *pg.Tx) error
	UpdateTimelines(timelines []*PipelineStatusTimeline) error
	UpdateTimelinesWithTxn(timelines []*PipelineStatusTimeline, tx *pg.Tx) error
	FetchTimelinesByPipelineId(pipelineId int) ([]*PipelineStatusTimeline, error)
	// FetchTimelinesByWfrId - Gets the exposed timelines for Helm Applications,
	// ignoring internalTimelineStatusList in sql query as it is not handled at FE
	FetchTimelinesByWfrId(wfrId int) ([]*PipelineStatusTimeline, error)
	FetchTimelineByWfrIdAndStatus(wfrId int, status timelineStatus.TimelineStatus) (*PipelineStatusTimeline, error)
	FetchTimelineByInstalledAppVersionHistoryIdAndStatus(installedAppVersionHistoryId int, status timelineStatus.TimelineStatus) (*PipelineStatusTimeline, error)
	FetchTimelineByWfrIdAndStatuses(wfrId int, statuses []timelineStatus.TimelineStatus) ([]*PipelineStatusTimeline, error)
	FetchTimelineByInstalledAppVersionHistoryIdAndPipelineStatuses(installedAppVersionHistoryId int, statuses []timelineStatus.TimelineStatus) ([]*PipelineStatusTimeline, error)
	GetLastStatusPublishedTimeForWfrId(wfrId int) (time.Time, error)
	FetchTimelinesForWfrIdExcludingStatuses(wfrId int, statuses ...timelineStatus.TimelineStatus) ([]*PipelineStatusTimeline, error)
	CheckIfTerminalStatusTimelinePresentByWfrId(wfrId int) (bool, error)
	CheckIfTimelineStatusPresentByWfrId(wfrId int, status timelineStatus.TimelineStatus) (bool, error)
	CheckIfTerminalStatusTimelinePresentByInstalledAppVersionHistoryId(installedAppVersionHistoryId int) (bool, error)
	CheckIfTimelineStatusPresentByInstalledAppVersionHistoryId(installedAppVersionHistoryId int, status timelineStatus.TimelineStatus) (bool, error)
	DeleteByCdWfrIdAndTimelineStatuses(cdWfrId int, status []timelineStatus.TimelineStatus) error
	DeleteByCdWfrIdAndTimelineStatusesWithTxn(cdWfrId int, status []timelineStatus.TimelineStatus, tx *pg.Tx) error
	// FetchTimelinesByInstalledAppVersionHistoryId - Gets the exposed timelines for Helm Applications,
	// ignoring internalTimelineStatusList in sql query as it is not handled at FE
	FetchTimelinesByInstalledAppVersionHistoryId(installedAppVersionHistoryId int) ([]*PipelineStatusTimeline, error)
	FetchLatestTimelinesByInstalledAppVersionHistoryId(installedAppVersionHistoryId int) (*PipelineStatusTimeline, error)
	GetConnection() *pg.DB
}

type PipelineStatusTimelineRepositoryImpl added in v0.4.28

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

func NewPipelineStatusTimelineRepositoryImpl added in v0.4.28

func NewPipelineStatusTimelineRepositoryImpl(dbConnection *pg.DB,
	logger *zap.SugaredLogger) *PipelineStatusTimelineRepositoryImpl

func (*PipelineStatusTimelineRepositoryImpl) CheckIfTerminalStatusTimelinePresentByInstalledAppVersionHistoryId added in v0.6.17

func (impl *PipelineStatusTimelineRepositoryImpl) CheckIfTerminalStatusTimelinePresentByInstalledAppVersionHistoryId(installedAppVersionHistoryId int) (bool, error)

func (*PipelineStatusTimelineRepositoryImpl) CheckIfTerminalStatusTimelinePresentByWfrId added in v0.5.1

func (impl *PipelineStatusTimelineRepositoryImpl) CheckIfTerminalStatusTimelinePresentByWfrId(wfrId int) (bool, error)

func (*PipelineStatusTimelineRepositoryImpl) CheckIfTimelineStatusPresentByInstalledAppVersionHistoryId added in v0.7.1

func (impl *PipelineStatusTimelineRepositoryImpl) CheckIfTimelineStatusPresentByInstalledAppVersionHistoryId(installedAppVersionHistoryId int, status timelineStatus.TimelineStatus) (bool, error)

func (*PipelineStatusTimelineRepositoryImpl) CheckIfTimelineStatusPresentByWfrId added in v0.7.1

func (impl *PipelineStatusTimelineRepositoryImpl) CheckIfTimelineStatusPresentByWfrId(wfrId int, status timelineStatus.TimelineStatus) (bool, error)

func (*PipelineStatusTimelineRepositoryImpl) DeleteByCdWfrIdAndTimelineStatuses added in v0.6.11

func (impl *PipelineStatusTimelineRepositoryImpl) DeleteByCdWfrIdAndTimelineStatuses(cdWfrId int, status []timelineStatus.TimelineStatus) error

func (*PipelineStatusTimelineRepositoryImpl) DeleteByCdWfrIdAndTimelineStatusesWithTxn added in v0.6.11

func (impl *PipelineStatusTimelineRepositoryImpl) DeleteByCdWfrIdAndTimelineStatusesWithTxn(cdWfrId int, status []timelineStatus.TimelineStatus, tx *pg.Tx) error

func (*PipelineStatusTimelineRepositoryImpl) FetchLatestTimelinesByInstalledAppVersionHistoryId added in v0.6.17

func (impl *PipelineStatusTimelineRepositoryImpl) FetchLatestTimelinesByInstalledAppVersionHistoryId(installedAppVersionHistoryId int) (*PipelineStatusTimeline, error)

func (*PipelineStatusTimelineRepositoryImpl) FetchTimelineByInstalledAppVersionHistoryIdAndPipelineStatuses added in v0.6.17

func (impl *PipelineStatusTimelineRepositoryImpl) FetchTimelineByInstalledAppVersionHistoryIdAndPipelineStatuses(installedAppVersionHistoryId int, statuses []timelineStatus.TimelineStatus) ([]*PipelineStatusTimeline, error)

func (*PipelineStatusTimelineRepositoryImpl) FetchTimelineByInstalledAppVersionHistoryIdAndStatus added in v0.6.17

func (impl *PipelineStatusTimelineRepositoryImpl) FetchTimelineByInstalledAppVersionHistoryIdAndStatus(installedAppVersionHistoryId int, status timelineStatus.TimelineStatus) (*PipelineStatusTimeline, error)

func (*PipelineStatusTimelineRepositoryImpl) FetchTimelineByWfrIdAndStatus added in v0.5.1

func (impl *PipelineStatusTimelineRepositoryImpl) FetchTimelineByWfrIdAndStatus(wfrId int, status timelineStatus.TimelineStatus) (*PipelineStatusTimeline, error)

func (*PipelineStatusTimelineRepositoryImpl) FetchTimelineByWfrIdAndStatuses added in v0.6.11

func (impl *PipelineStatusTimelineRepositoryImpl) FetchTimelineByWfrIdAndStatuses(wfrId int, statuses []timelineStatus.TimelineStatus) ([]*PipelineStatusTimeline, error)

func (*PipelineStatusTimelineRepositoryImpl) FetchTimelinesByInstalledAppVersionHistoryId added in v0.6.17

func (impl *PipelineStatusTimelineRepositoryImpl) FetchTimelinesByInstalledAppVersionHistoryId(installedAppVersionHistoryId int) ([]*PipelineStatusTimeline, error)

func (*PipelineStatusTimelineRepositoryImpl) FetchTimelinesByPipelineId added in v0.4.28

func (impl *PipelineStatusTimelineRepositoryImpl) FetchTimelinesByPipelineId(pipelineId int) ([]*PipelineStatusTimeline, error)

func (*PipelineStatusTimelineRepositoryImpl) FetchTimelinesByWfrId added in v0.4.28

func (impl *PipelineStatusTimelineRepositoryImpl) FetchTimelinesByWfrId(wfrId int) ([]*PipelineStatusTimeline, error)

func (*PipelineStatusTimelineRepositoryImpl) FetchTimelinesForWfrIdExcludingStatuses added in v0.7.1

func (impl *PipelineStatusTimelineRepositoryImpl) FetchTimelinesForWfrIdExcludingStatuses(wfrId int, statuses ...timelineStatus.TimelineStatus) ([]*PipelineStatusTimeline, error)

func (*PipelineStatusTimelineRepositoryImpl) GetConnection added in v0.6.28

func (impl *PipelineStatusTimelineRepositoryImpl) GetConnection() *pg.DB

func (*PipelineStatusTimelineRepositoryImpl) GetLastStatusPublishedTimeForWfrId added in v0.7.1

func (impl *PipelineStatusTimelineRepositoryImpl) GetLastStatusPublishedTimeForWfrId(wfrId int) (time.Time, error)

func (*PipelineStatusTimelineRepositoryImpl) SaveTimelines added in v0.6.11

func (impl *PipelineStatusTimelineRepositoryImpl) SaveTimelines(timelines []*PipelineStatusTimeline) error

func (*PipelineStatusTimelineRepositoryImpl) SaveTimelinesWithTxn added in v0.5.1

func (impl *PipelineStatusTimelineRepositoryImpl) SaveTimelinesWithTxn(timelines []*PipelineStatusTimeline, tx *pg.Tx) error

func (*PipelineStatusTimelineRepositoryImpl) UpdateTimelines added in v0.6.11

func (impl *PipelineStatusTimelineRepositoryImpl) UpdateTimelines(timelines []*PipelineStatusTimeline) error

func (*PipelineStatusTimelineRepositoryImpl) UpdateTimelinesWithTxn added in v0.6.11

func (impl *PipelineStatusTimelineRepositoryImpl) UpdateTimelinesWithTxn(timelines []*PipelineStatusTimeline, tx *pg.Tx) error

type PipelineStatusTimelineResources added in v0.6.11

type PipelineStatusTimelineResources struct {
	Id                           int                   `sql:"id,pk"`
	InstalledAppVersionHistoryId int                   `sql:"installed_app_version_history_id,type:integer"`
	CdWorkflowRunnerId           int                   `sql:"cd_workflow_runner_id,type:integer"`
	ResourceName                 string                `sql:"resource_name"`
	ResourceKind                 string                `sql:"resource_kind"`
	ResourceGroup                string                `sql:"resource_group"`
	ResourcePhase                string                `sql:"resource_phase"`
	ResourceStatus               string                `sql:"resource_status"`
	StatusMessage                string                `sql:"status_message"`
	TimelineStage                ResourceTimelineStage `sql:"timeline_stage"`
	sql.AuditLog
	// contains filtered or unexported fields
}

type PipelineStatusTimelineResourcesRepository added in v0.6.11

type PipelineStatusTimelineResourcesRepository interface {
	SaveTimelineResources(timelineResources []*PipelineStatusTimelineResources) error
	SaveTimelineResourcesWithTxn(timelineResources []*PipelineStatusTimelineResources, tx *pg.Tx) error
	UpdateTimelineResources(timelineResources []*PipelineStatusTimelineResources) error
	UpdateTimelineResourcesWithTxn(timelineResources []*PipelineStatusTimelineResources, tx *pg.Tx) error
	GetByCdWfrIdAndTimelineStage(cdWfrId int) ([]*PipelineStatusTimelineResources, error)
	GetByInstalledAppVersionHistoryIdAndTimelineStage(installedAppVersionHistoryId int) ([]*PipelineStatusTimelineResources, error)
	GetByCdWfrIds(cdWfrIds []int) ([]*PipelineStatusTimelineResources, error)
}

type PipelineStatusTimelineResourcesRepositoryImpl added in v0.6.11

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

func NewPipelineStatusTimelineResourcesRepositoryImpl added in v0.6.11

func NewPipelineStatusTimelineResourcesRepositoryImpl(dbConnection *pg.DB,
	logger *zap.SugaredLogger) *PipelineStatusTimelineResourcesRepositoryImpl

func (*PipelineStatusTimelineResourcesRepositoryImpl) GetByCdWfrIdAndTimelineStage added in v0.6.11

func (impl *PipelineStatusTimelineResourcesRepositoryImpl) GetByCdWfrIdAndTimelineStage(cdWfrId int) ([]*PipelineStatusTimelineResources, error)

func (*PipelineStatusTimelineResourcesRepositoryImpl) GetByCdWfrIds added in v0.6.17

func (*PipelineStatusTimelineResourcesRepositoryImpl) GetByInstalledAppVersionHistoryIdAndTimelineStage added in v0.6.17

func (impl *PipelineStatusTimelineResourcesRepositoryImpl) GetByInstalledAppVersionHistoryIdAndTimelineStage(installedAppVersionHistoryId int) ([]*PipelineStatusTimelineResources, error)

func (*PipelineStatusTimelineResourcesRepositoryImpl) SaveTimelineResources added in v0.6.11

func (impl *PipelineStatusTimelineResourcesRepositoryImpl) SaveTimelineResources(timelineResources []*PipelineStatusTimelineResources) error

func (*PipelineStatusTimelineResourcesRepositoryImpl) SaveTimelineResourcesWithTxn added in v0.6.11

func (impl *PipelineStatusTimelineResourcesRepositoryImpl) SaveTimelineResourcesWithTxn(timelineResources []*PipelineStatusTimelineResources, tx *pg.Tx) error

func (*PipelineStatusTimelineResourcesRepositoryImpl) UpdateTimelineResources added in v0.6.11

func (impl *PipelineStatusTimelineResourcesRepositoryImpl) UpdateTimelineResources(timelineResources []*PipelineStatusTimelineResources) error

func (*PipelineStatusTimelineResourcesRepositoryImpl) UpdateTimelineResourcesWithTxn added in v0.6.11

func (impl *PipelineStatusTimelineResourcesRepositoryImpl) UpdateTimelineResourcesWithTxn(timelineResources []*PipelineStatusTimelineResources, tx *pg.Tx) error

type PipelineType

type PipelineType string

type ResourceTimelineStage added in v0.6.11

type ResourceTimelineStage string
const (
	TIMELINE_RESOURCE_STAGE_KUBECTL_APPLY ResourceTimelineStage = "KUBECTL_APPLY"
)

type SourceType

type SourceType string
const (
	SOURCE_TYPE_BRANCH_FIXED SourceType = "SOURCE_TYPE_BRANCH_FIXED"
	SOURCE_TYPE_BRANCH_REGEX SourceType = "SOURCE_TYPE_BRANCH_REGEX"
	SOURCE_TYPE_TAG_ANY      SourceType = "SOURCE_TYPE_TAG_ANY"
	SOURCE_TYPE_WEBHOOK      SourceType = "WEBHOOK"
)

type TriggerType

type TriggerType string // HOW pipeline should be triggered
const TRIGGER_TYPE_AUTOMATIC TriggerType = "AUTOMATIC"
const TRIGGER_TYPE_MANUAL TriggerType = "MANUAL"

func (TriggerType) ToString added in v0.7.1

func (t TriggerType) ToString() string

type TriggerWorkflowStatus

type TriggerWorkflowStatus struct {
	CdWorkflowStatus []*CdWorkflowStatus `json:"cdWorkflowStatus"`
	CiWorkflowStatus []*CiWorkflowStatus `json:"ciWorkflowStatus"`
}

type WebhookData added in v0.2.22

type WebhookData struct {
	Id              int               `json:"id"`
	EventActionType string            `json:"eventActionType"`
	Data            map[string]string `json:"data"`
}

type WorkflowExecutorType

type WorkflowExecutorType string

type WorkflowStatus

type WorkflowStatus int
const (
	WF_UNKNOWN WorkflowStatus = iota
	REQUEST_ACCEPTED
	ENQUEUED
	QUE_ERROR
	WF_STARTED
	DROPPED_STALE
	DEQUE_ERROR
	TRIGGER_ERROR
)

func (WorkflowStatus) String

func (a WorkflowStatus) String() string

type WorkflowWithArtifact

type WorkflowWithArtifact struct {
	Id                      int                  `json:"id"`
	Name                    string               `json:"name"`
	PodName                 string               `json:"podName"`
	Status                  string               `json:"status"`
	PodStatus               string               `json:"pod_status"`
	Message                 string               `json:"message"`
	StartedOn               time.Time            `json:"started_on"`
	FinishedOn              time.Time            `json:"finished_on"`
	CiPipelineId            int                  `json:"ci_pipeline_id"`
	Namespace               string               `json:"namespace"`
	LogFilePath             string               `json:"log_file_path"`
	GitTriggers             map[int]GitCommit    `json:"git_triggers"`
	TriggeredBy             int32                `json:"triggered_by"`
	EmailId                 string               `json:"email_id"`
	Image                   string               `json:"image"`
	CiArtifactLocation      string               `json:"ci_artifact_location"`
	CiArtifactId            int                  `json:"ci_artifact_d"`
	BlobStorageEnabled      bool                 `json:"blobStorageEnabled"`
	CiBuildType             string               `json:"ci_build_type"`
	IsArtifactUploaded      bool                 `json:"is_artifact_uploaded"`
	EnvironmentId           int                  `json:"environmentId"`
	EnvironmentName         string               `json:"environmentName"`
	RefCiWorkflowId         int                  `json:"referenceCiWorkflowId"`
	ParentCiWorkflowId      int                  `json:"parent_ci_workflow_id"`
	ExecutorType            WorkflowExecutorType `json:"executor_type"` //awf, system
	ImagePathReservationId  int                  `json:"image_path_reservation_id"`
	ImagePathReservationIds []int                `json:"image_path_reservation_ids" pg:",array"`
}

Directories

Path Synopsis
adapter
bean
Package mock_pipelineConfig is a generated GoMock package.
Package mock_pipelineConfig is a generated GoMock package.

Jump to

Keyboard shortcuts

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