Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: default PipelineType given #5668

Merged
merged 2 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions pkg/pipeline/BuildPipelineConfigService.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,16 @@ func (impl *CiPipelineConfigServiceImpl) patchCiPipelineUpdateSource(baseCiConfi
impl.logger.Errorw("error in fetching pipeline", "id", modifiedCiPipeline.Id, "err", err)
return nil, err
}
// updating PipelineType from db if not present in request
if modifiedCiPipeline.PipelineType == "" {
if CiPipeline.PipelineType(pipeline.PipelineType) != "" {
modifiedCiPipeline.PipelineType = CiPipeline.PipelineType(pipeline.PipelineType)
} else {
// updating default pipelineType if not present in request
modifiedCiPipeline.PipelineType = CiPipeline.DefaultPipelineType

}
}
if !modifiedCiPipeline.PipelineType.IsValidPipelineType() {
impl.logger.Debugw(" Invalid PipelineType", "PipelineType", modifiedCiPipeline.PipelineType)
errorMessage := fmt.Sprintf(CiPipeline.PIPELINE_TYPE_IS_NOT_VALID, modifiedCiPipeline.Name)
Expand Down
3 changes: 3 additions & 0 deletions pkg/pipeline/bean/CiPipeline/CiBuildConfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ const PIPELINE_TYPE_IS_NOT_VALID = "PipelineType is not valid for pipeline %s"

type PipelineType string

// default PipelineType
const DefaultPipelineType = CI_BUILD

const (
CI_BUILD PipelineType = "CI_BUILD"
LINKED PipelineType = "LINKED"
Expand Down
Loading