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: Update cd pipeline create empty pre post cd steps #4113

Merged
merged 9 commits into from
Oct 17, 2023
10 changes: 6 additions & 4 deletions pkg/pipeline/PipelineStageService.go
Original file line number Diff line number Diff line change
Expand Up @@ -964,10 +964,12 @@ func (impl *PipelineStageServiceImpl) UpdatePipelineStage(stageReq *bean.Pipelin
if err == pg.ErrNoRows || createNewPipStage {
//no stage found, creating new stage
stageReq.Id = 0
err = impl.CreatePipelineStage(stageReq, stageType, pipelineId, userId)
if err != nil {
impl.logger.Errorw("error in creating new pipeline stage", "err", err, "pipelineStageReq", stageReq)
return err
if len(stageReq.Steps) > 0 {
err = impl.CreatePipelineStage(stageReq, stageType, pipelineId, userId)
if err != nil {
impl.logger.Errorw("error in creating new pipeline stage", "err", err, "pipelineStageReq", stageReq)
return err
}
}
} else {
//stageId found, to handle as an update request
Expand Down