Skip to content

Commit 635250e

Browse files
committed
removed redundant function:
1 parent 7ca1d48 commit 635250e

File tree

1 file changed

+0
-77
lines changed

1 file changed

+0
-77
lines changed

pkg/pipeline/AppArtifactManager.go

Lines changed: 0 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -212,83 +212,6 @@ func (impl *AppArtifactManagerImpl) BuildArtifactsForCIParent(cdPipelineId int,
212212
return ciArtifacts, nil
213213
}
214214

215-
func (impl *AppArtifactManagerImpl) FetchArtifactForRollback(cdPipelineId, appId, offset, limit int, searchString string) (bean2.CiArtifactResponse, error) {
216-
var deployedCiArtifacts []bean2.CiArtifactBean
217-
var deployedCiArtifactsResponse bean2.CiArtifactResponse
218-
219-
cdWfrs, err := impl.cdWorkflowRepository.FetchArtifactsByCdPipelineId(cdPipelineId, bean.CD_WORKFLOW_TYPE_DEPLOY, offset, limit, searchString)
220-
if err != nil {
221-
impl.logger.Errorw("error in getting artifacts for rollback by cdPipelineId", "err", err, "cdPipelineId", cdPipelineId)
222-
return deployedCiArtifactsResponse, err
223-
}
224-
var ids []int32
225-
for _, item := range cdWfrs {
226-
ids = append(ids, item.TriggeredBy)
227-
}
228-
userEmails := make(map[int32]string)
229-
users, err := impl.userService.GetByIds(ids)
230-
if err != nil {
231-
impl.logger.Errorw("unable to fetch users by ids", "err", err, "ids", ids)
232-
}
233-
for _, item := range users {
234-
userEmails[item.Id] = item.EmailId
235-
}
236-
237-
imageTagsDataMap, err := impl.imageTaggingService.GetTagsDataMapByAppId(appId)
238-
if err != nil {
239-
impl.logger.Errorw("error in getting image tagging data with appId", "err", err, "appId", appId)
240-
return deployedCiArtifactsResponse, err
241-
}
242-
artifactIds := make([]int, 0)
243-
244-
for _, cdWfr := range cdWfrs {
245-
ciArtifact := &repository.CiArtifact{}
246-
if cdWfr.CdWorkflow != nil && cdWfr.CdWorkflow.CiArtifact != nil {
247-
ciArtifact = cdWfr.CdWorkflow.CiArtifact
248-
}
249-
if ciArtifact == nil {
250-
continue
251-
}
252-
mInfo, err := parseMaterialInfo([]byte(ciArtifact.MaterialInfo), ciArtifact.DataSource)
253-
if err != nil {
254-
mInfo = []byte("[]")
255-
impl.logger.Errorw("error in parsing ciArtifact material info", "err", err, "ciArtifact", ciArtifact)
256-
}
257-
userEmail := userEmails[cdWfr.TriggeredBy]
258-
deployedCiArtifacts = append(deployedCiArtifacts, bean2.CiArtifactBean{
259-
Id: ciArtifact.Id,
260-
Image: ciArtifact.Image,
261-
MaterialInfo: mInfo,
262-
DeployedTime: formatDate(cdWfr.StartedOn, bean2.LayoutRFC3339),
263-
WfrId: cdWfr.Id,
264-
DeployedBy: userEmail,
265-
})
266-
artifactIds = append(artifactIds, ciArtifact.Id)
267-
}
268-
imageCommentsDataMap, err := impl.imageTaggingService.GetImageCommentsDataMapByArtifactIds(artifactIds)
269-
if err != nil {
270-
impl.logger.Errorw("error in getting GetImageCommentsDataMapByArtifactIds", "err", err, "appId", appId, "artifactIds", artifactIds)
271-
return deployedCiArtifactsResponse, err
272-
}
273-
274-
for i, _ := range deployedCiArtifacts {
275-
if imageTaggingResp := imageTagsDataMap[deployedCiArtifacts[i].Id]; imageTaggingResp != nil {
276-
deployedCiArtifacts[i].ImageReleaseTags = imageTaggingResp
277-
}
278-
if imageCommentResp := imageCommentsDataMap[deployedCiArtifacts[i].Id]; imageCommentResp != nil {
279-
deployedCiArtifacts[i].ImageComment = imageCommentResp
280-
}
281-
}
282-
283-
deployedCiArtifactsResponse.CdPipelineId = cdPipelineId
284-
if deployedCiArtifacts == nil {
285-
deployedCiArtifacts = []bean2.CiArtifactBean{}
286-
}
287-
deployedCiArtifactsResponse.CiArtifacts = deployedCiArtifacts
288-
289-
return deployedCiArtifactsResponse, nil
290-
}
291-
292215
func (impl *AppArtifactManagerImpl) FetchArtifactForRollbackV2(cdPipelineId, appId, offset, limit int, searchString string, app *bean2.CreateAppDTO, deploymentPipeline *pipelineConfig.Pipeline) (bean2.CiArtifactResponse, error) {
293216
var deployedCiArtifactsResponse bean2.CiArtifactResponse
294217
imageTagsDataMap, err := impl.imageTaggingService.GetTagsDataMapByAppId(appId)

0 commit comments

Comments
 (0)