Skip to content

Commit 08570eb

Browse files
committed
GetCiPipelineByIdWithDefaultTag change
1 parent bf2b3c5 commit 08570eb

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

api/restHandler/app/pipeline/configure/BuildPipelineRestHandler.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1283,13 +1283,12 @@ func (handler *PipelineConfigRestHandlerImpl) GetCIPipelineById(w http.ResponseW
12831283
}
12841284
}
12851285

1286-
ciPipeline, err := handler.pipelineBuilder.GetCiPipelineById(pipelineId)
1286+
ciPipeline, err := handler.pipelineBuilder.GetCiPipelineByIdWithDefaultTag(pipelineId)
12871287
if err != nil {
1288-
handler.Logger.Infow("service error, GetCIPipelineById", "err", err, "appId", appId, "pipelineId", pipelineId)
1288+
handler.Logger.Infow("service error, GetCiPipelineByIdWithDefaultTag", "err", err, "appId", appId, "pipelineId", pipelineId)
12891289
common.WriteJsonResp(w, err, nil, http.StatusInternalServerError)
12901290
return
12911291
}
1292-
ciPipeline.DefaultTag = []string{"{git_hash}", "{ci_pipeline_id}", "{global_counter}"}
12931292
common.WriteJsonResp(w, err, ciPipeline, http.StatusOK)
12941293
}
12951294

pkg/pipeline/BuildPipelineConfigService.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ type CiPipelineConfigService interface {
6363
//If any errors occur during the retrieval process CI pipeline configuration remains nil.
6464
//If you want less detail of ciPipeline ,Please refer GetCiPipelineMin
6565
GetCiPipeline(appId int) (ciConfig *bean.CiConfigRequest, err error)
66+
// GetCiPipelineByIdWithDefaultTag : Retrieve ciPipeline for given ciPipelineId with defaultTagData
67+
GetCiPipelineByIdWithDefaultTag(pipelineId int) (ciPipeline *bean.CiPipeline, err error)
6668
//GetCiPipelineById : Retrieve ciPipeline for given ciPipelineId
6769
GetCiPipelineById(pipelineId int) (ciPipeline *bean.CiPipeline, err error)
6870
//GetTriggerViewCiPipeline : retrieves a detailed view of the CI pipelines configured for a specific application (appId).
@@ -688,6 +690,16 @@ func (impl *CiPipelineConfigServiceImpl) GetCiPipeline(appId int) (ciConfig *bea
688690
return ciConfig, err
689691
}
690692

693+
func (impl *CiPipelineConfigServiceImpl) GetCiPipelineByIdWithDefaultTag(pipelineId int) (ciPipeline *bean.CiPipeline, err error) {
694+
ciPipeline, err = impl.GetCiPipelineById(pipelineId)
695+
if err != nil {
696+
impl.logger.Infow("service error, GetCIPipelineById", "pipelineId", pipelineId, "err", err)
697+
return nil, err
698+
}
699+
ciPipeline.DefaultTag = []string{"{git_hash}", "{ci_pipeline_id}", "{global_counter}"}
700+
return ciPipeline, nil
701+
}
702+
691703
func (impl *CiPipelineConfigServiceImpl) GetCiPipelineById(pipelineId int) (ciPipeline *bean.CiPipeline, err error) {
692704
pipeline, err := impl.ciPipelineRepository.FindById(pipelineId)
693705
if err != nil && !util.IsErrNoRows(err) {

0 commit comments

Comments
 (0)