pipelineConfig

package
v0.6.18 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WorkflowStarting           = "Starting"
	WorkflowInProgress         = "Progressing"
	WorkflowAborted            = "Aborted"
	WorkflowFailed             = "Failed"
	WorkflowSucceeded          = "Succeeded"
	WorkflowTimedOut           = "TimedOut"
	WorkflowUnableToFetchState = "UnableToFetch"
)
View Source
const (
	TIMELINE_DESCRIPTION_DEPLOYMENT_INITIATED string = "Deployment initiated successfully."
	TIMELINE_DESCRIPTION_VULNERABLE_IMAGE     string = "Deployment failed: Vulnerability policy violated."
	TIMELINE_DESCRIPTION_MANIFEST_GENERATED   string = "HELM_PACKAGE_GENERATED"
)
View Source
const WORKFLOW_EXECUTOR_TYPE_AWF = "AWF"
View Source
const WORKFLOW_EXECUTOR_TYPE_SYSTEM = "SYSTEM"

Variables

View Source
var TimelineStatusDescription string

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 {
	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 bean.WorkflowType, limit int) ([]CdWorkflowRunner, error)

	SaveWorkFlowRunner(wfr *CdWorkflowRunner) (*CdWorkflowRunner, error)
	UpdateWorkFlowRunner(wfr *CdWorkflowRunner) 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)
	FindLatestWfrByAppIdAndEnvironmentId(appId int, environmentId int) (*CdWorkflowRunner, error)
	FindLatestCdWorkflowRunnerByEnvironmentIdAndRunnerType(appId int, environmentId int, runnerType bean.WorkflowType) (CdWorkflowRunner, error)

	GetConnection() *pg.DB

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

	FindByWorkflowIdAndRunnerType(ctx context.Context, wfId int, runnerType bean.WorkflowType) (CdWorkflowRunner, error)
	FindLastStatusByPipelineIdAndRunnerType(pipelineId int, runnerType bean.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)

	FetchArtifactsByCdPipelineId(pipelineId int, runnerType bean.WorkflowType, offset, limit int) ([]CdWorkflowRunner, error)

	GetLatestTriggersOfHelmPipelinesStuckInNonTerminalStatuses() ([]*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) 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 bean.WorkflowType, offset, limit int) ([]CdWorkflowRunner, error)

func (*CdWorkflowRepositoryImpl) FindArtifactByPipelineIdAndRunnerType

func (impl *CdWorkflowRepositoryImpl) FindArtifactByPipelineIdAndRunnerType(pipelineId int, runnerType bean.WorkflowType, limit 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 bean.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) FindLastStatusByPipelineIdAndRunnerType

func (impl *CdWorkflowRepositoryImpl) FindLastStatusByPipelineIdAndRunnerType(pipelineId int, runnerType bean.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 bean.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) 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() ([]*CdWorkflowRunner, 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) 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(wfr []*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       bean.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"`
	CdWorkflow         *CdWorkflow
	sql.AuditLog
	// contains filtered or unexported fields
}

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"`
}

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 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"`
	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)
	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) 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 {
	Save(pipeline *CiPipeline, 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)
	FindByAppIds(appIds []int) (pipelines []*CiPipeline, err error)
	//find non deleted pipeline
	FindById(id int) (pipeline *CiPipeline, err 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
	PipelineExistsByName(names []string) (found []string, err error)
	FindByName(pipelineName string) (pipeline *CiPipeline, err error)
	FindByParentCiPipelineId(parentCiPipelineId int) ([]*CiPipeline, error)

	FetchParentCiPipelinesForDG() ([]*CiPipelinesMap, error)
	FetchCiPipelinesForDG(parentId int, childCiPipelineIds []int) (*CiPipeline, int, error)
	FinDByParentCiPipelineAndAppId(parentCiPipeline int, appIds []int) ([]*CiPipeline, error)
	FindAllPipelineInLast24Hour() (pipelines []*CiPipeline, 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)
}

type CiPipelineRepositoryImpl

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

func NewCiPipelineRepositoryImpl

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

func (CiPipelineRepositoryImpl) FetchCiPipelinesForDG

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

func (CiPipelineRepositoryImpl) FetchParentCiPipelinesForDG

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

func (*CiPipelineRepositoryImpl) FinDByParentCiPipelineAndAppId

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

func (CiPipelineRepositoryImpl) FindAllPipelineInLast24Hour added in v0.2.14

func (impl CiPipelineRepositoryImpl) FindAllPipelineInLast24Hour() (pipelines []*CiPipeline, 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) FindByIdsIn

func (impl CiPipelineRepositoryImpl) FindByIdsIn(ids []int) ([]*CiPipeline, 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) 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) FindNumberOfAppsWithCiPipeline added in v0.4.14

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

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) 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) 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) 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 CiPipelinesMap

type CiPipelinesMap struct {
	Id               int `json:"id"`
	ParentCiPipeline int `json:"parentCiPipeline"`
}

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"`
	CiPipeline         *CiPipeline
	// contains filtered or unexported fields
}

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)
	FindCiWorkflowGitTriggersById(id int) (workflow *CiWorkflow, err 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)
	FindLastTriggeredWorkflowGitTriggersByArtifactId(ciArtifactId int) (ciWorkflow *CiWorkflow, err 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) 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)

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) 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) 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"`
}

type ConnectedPipelinesMap

type ConnectedPipelinesMap struct {
	Id    int `json:"id"`
	Count int `json:"count"`
}

type DbMigrationConfig

type DbMigrationConfig struct {
	Id            int           `sql:"id"`
	DbConfigId    int           `sql:"db_config_id"`
	PipelineId    int           `sql:"pipeline_id"`
	GitMaterialId int           `sql:"git_material_id"`
	ScriptSource  string        `sql:"script_source"` //location of file in git. relative to git root
	MigrationTool MigrationTool `sql:"migration_tool"`
	Active        bool          `sql:"active"`
	sql.AuditLog
	DbConfig    *repository.DbConfig
	GitMaterial *GitMaterial
	// contains filtered or unexported fields
}

type DbMigrationConfigRepository

type DbMigrationConfigRepository interface {
	Save(config *DbMigrationConfig) error
	FindByPipelineId(pipelineId int) (config *DbMigrationConfig, err error)
	Update(config *DbMigrationConfig) error
}

type DbMigrationConfigRepositoryImpl

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

func NewDbMigrationConfigRepositoryImpl

func NewDbMigrationConfigRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) *DbMigrationConfigRepositoryImpl

func (DbMigrationConfigRepositoryImpl) FindByPipelineId

func (impl DbMigrationConfigRepositoryImpl) FindByPipelineId(pipelineId int) (config *DbMigrationConfig, err error)

func (DbMigrationConfigRepositoryImpl) Save

func (DbMigrationConfigRepositoryImpl) Update

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(material *GitMaterial) error
	UpdateMaterial(material *GitMaterial) error
	Update(materials []*GitMaterial) error
	FindByAppId(appId int) ([]*GitMaterial, error)
	FindById(Id int) (*GitMaterial, error)
	UpdateMaterialScmId(material *GitMaterial) error
	FindByAppIdAndCheckoutPath(appId int, checkoutPath string) (*GitMaterial, error)
	FindByGitProviderId(gitProviderId int) (materials []*GitMaterial, err error)
	MarkMaterialDeleted(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) 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(material *GitMaterial) error

func (MaterialRepositoryImpl) MaterialExists

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

func (MaterialRepositoryImpl) SaveMaterial

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

func (MaterialRepositoryImpl) Update

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

func (MaterialRepositoryImpl) UpdateMaterial

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

func (MaterialRepositoryImpl) UpdateMaterialScmId

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

type MigrationTool

type MigrationTool string
const MIGRATION_TOOL_MIGRATE MigrationTool = "migrate"

func (MigrationTool) IsValid

func (t MigrationTool) IsValid() bool

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"` //helm, acd
	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
	FindByName(pipelineName string) (pipeline *Pipeline, err error)
	PipelineExists(pipelineName string) (bool, error)
	FindById(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)
	UndoDelete(id int) 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
	FindAllPipelineInLast24Hour() (pipelines []*Pipeline, err error)
	FindActiveByEnvId(envId int) (pipelines []*Pipeline, err error)
	FindActiveByEnvIds(envId []int) (pipelines []*Pipeline, err error)
	FindActiveByInFilter(envId int, appIdIncludes []int) (pipelines []*Pipeline, err 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)
	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)
	GetPartiallyDeletedPipelineByStatus(appId int, envId int) (Pipeline, error)
	FindActiveByAppIds(appIds []int) (pipelines []*Pipeline, err error)
	FindAppAndEnvironmentAndProjectByPipelineIds(pipelineIds []int) (pipelines []*Pipeline, err error)
	FilterDeploymentDeleteRequestedPipelineIds(cdPipelineIds []int) (map[int]bool, 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) 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) FindAllPipelineInLast24Hour added in v0.2.14

func (impl PipelineRepositoryImpl) FindAllPipelineInLast24Hour() (pipelines []*Pipeline, 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) 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) 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) 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) 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) GetPartiallyDeletedPipelineByStatus added in v0.6.13

func (impl PipelineRepositoryImpl) GetPartiallyDeletedPipelineByStatus(appId int, envId int) (Pipeline, error)

func (PipelineRepositoryImpl) GetPostStageConfigById added in v0.6.17

func (impl PipelineRepositoryImpl) GetPostStageConfigById(id int) (pipeline *Pipeline, err 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) UndoDelete

func (impl PipelineRepositoryImpl) UndoDelete(id int) 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 deployment_app_type and sets deployment_app_created to false in the table for given ids.

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 `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(wfrId int) ([]*PipelineStatusTimeline, error)
	FetchTimelineByWfrIdAndStatus(wfrId int, status TimelineStatus) (*PipelineStatusTimeline, error)
	FetchTimelineByInstalledAppVersionHistoryIdAndStatus(installedAppVersionHistoryId int, status TimelineStatus) (*PipelineStatusTimeline, error)
	FetchTimelineByWfrIdAndStatuses(wfrId int, statuses []TimelineStatus) ([]*PipelineStatusTimeline, error)
	FetchTimelineByInstalledAppVersionHistoryIdAndPipelineStatuses(installedAppVersionHistoryId int, statuses []TimelineStatus) ([]*PipelineStatusTimeline, error)
	FetchLatestTimelineByWfrId(wfrId int) (*PipelineStatusTimeline, error)
	CheckIfTerminalStatusTimelinePresentByWfrId(wfrId int) (bool, error)
	CheckIfTerminalStatusTimelinePresentByInstalledAppVersionHistoryId(installedAppVersionHistoryId int) (bool, error)
	FetchLatestTimelineByAppIdAndEnvId(appId, envId int) (*PipelineStatusTimeline, error)
	DeleteByCdWfrIdAndTimelineStatuses(cdWfrId int, status []TimelineStatus) error
	DeleteByCdWfrIdAndTimelineStatusesWithTxn(cdWfrId int, status []TimelineStatus, tx *pg.Tx) error
	FetchTimelinesByInstalledAppVersionHistoryId(installedAppVersionHistoryId int) ([]*PipelineStatusTimeline, error)
	FetchLatestTimelinesByInstalledAppVersionHistoryId(installedAppVersionHistoryId int) (*PipelineStatusTimeline, error)
}

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) DeleteByCdWfrIdAndTimelineStatuses added in v0.6.11

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

func (*PipelineStatusTimelineRepositoryImpl) DeleteByCdWfrIdAndTimelineStatusesWithTxn added in v0.6.11

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

func (*PipelineStatusTimelineRepositoryImpl) FetchLatestTimelineByAppIdAndEnvId added in v0.6.4

func (impl *PipelineStatusTimelineRepositoryImpl) FetchLatestTimelineByAppIdAndEnvId(appId, envId int) (*PipelineStatusTimeline, error)

func (*PipelineStatusTimelineRepositoryImpl) FetchLatestTimelineByWfrId added in v0.6.11

func (impl *PipelineStatusTimelineRepositoryImpl) FetchLatestTimelineByWfrId(wfrId int) (*PipelineStatusTimeline, 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) ([]*PipelineStatusTimeline, error)

func (*PipelineStatusTimelineRepositoryImpl) FetchTimelineByInstalledAppVersionHistoryIdAndStatus added in v0.6.17

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

func (*PipelineStatusTimelineRepositoryImpl) FetchTimelineByWfrIdAndStatus added in v0.5.1

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

func (*PipelineStatusTimelineRepositoryImpl) FetchTimelineByWfrIdAndStatuses added in v0.6.11

func (impl *PipelineStatusTimelineRepositoryImpl) FetchTimelineByWfrIdAndStatuses(wfrId int, statuses []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) 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 TimelineStatus added in v0.4.28

type TimelineStatus = string
const (
	TIMELINE_STATUS_DEPLOYMENT_INITIATED   TimelineStatus = "DEPLOYMENT_INITIATED"
	TIMELINE_STATUS_GIT_COMMIT             TimelineStatus = "GIT_COMMIT"
	TIMELINE_STATUS_GIT_COMMIT_FAILED      TimelineStatus = "GIT_COMMIT_FAILED"
	TIMELINE_STATUS_KUBECTL_APPLY_STARTED  TimelineStatus = "KUBECTL_APPLY_STARTED"
	TIMELINE_STATUS_KUBECTL_APPLY_SYNCED   TimelineStatus = "KUBECTL_APPLY_SYNCED"
	TIMELINE_STATUS_APP_HEALTHY            TimelineStatus = "HEALTHY"
	TIMELINE_STATUS_DEPLOYMENT_FAILED      TimelineStatus = "FAILED"
	TIMELINE_STATUS_FETCH_TIMED_OUT        TimelineStatus = "TIMED_OUT"
	TIMELINE_STATUS_UNABLE_TO_FETCH_STATUS TimelineStatus = "UNABLE_TO_FETCH_STATUS"
	TIMELINE_STATUS_DEPLOYMENT_SUPERSEDED  TimelineStatus = "DEPLOYMENT_SUPERSEDED"
	TIMELINE_STATUS_MANIFEST_GENERATED     TimelineStatus = "MANIFEST_GENERATED"
)

type TriggerType

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

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
	EventActionType string
	Data            map[string]string
}

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"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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