Skip to content

Commit

Permalink
fix: Update cd pipeline create empty pre post cd steps (#4113)
Browse files Browse the repository at this point in the history
* check for active ci_pipeline_material

* check for len of steps

* check for len of steps
  • Loading branch information
Ashish-devtron committed Oct 17, 2023
1 parent 81e24a0 commit ffb2390
Showing 1 changed file with 6 additions and 4 deletions.
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

0 comments on commit ffb2390

Please sign in to comment.