Skip to content

Commit 5e0d32f

Browse files
Ash-expShivam-nagar23
authored andcommitted
fixed: deployment history user details (#3873)
1 parent b522a64 commit 5e0d32f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

pkg/appStore/deployment/tool/gitops/AppStoreDeploymentArgoCdService.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -394,11 +394,15 @@ func (impl AppStoreDeploymentArgoCdServiceImpl) GetDeploymentHistory(ctx context
394394
return result, err
395395
}
396396
for _, updateHistory := range versionHistory {
397-
user, err := impl.userService.GetById(updateHistory.CreatedBy)
398-
if err != nil {
397+
emailId := "anonymous"
398+
user, err := impl.userService.GetByIdIncludeDeleted(updateHistory.CreatedBy)
399+
if err != nil && !util.IsErrNoRows(err) {
399400
impl.Logger.Errorw("error while fetching user Details", "error", err)
400401
return result, err
401402
}
403+
if user != nil {
404+
emailId = user.EmailId
405+
}
402406
history = append(history, &client.HelmAppDeploymentDetail{
403407
ChartMetadata: &client.ChartMetadata{
404408
ChartName: installedAppVersionModel.AppStoreApplicationVersion.AppStore.Name,
@@ -407,7 +411,7 @@ func (impl AppStoreDeploymentArgoCdServiceImpl) GetDeploymentHistory(ctx context
407411
Home: installedAppVersionModel.AppStoreApplicationVersion.Home,
408412
Sources: sources,
409413
},
410-
DeployedBy: user.EmailId,
414+
DeployedBy: emailId,
411415
DockerImages: []string{installedAppVersionModel.AppStoreApplicationVersion.AppVersion},
412416
DeployedAt: &timestamp.Timestamp{
413417
Seconds: updateHistory.CreatedOn.Unix(),

0 commit comments

Comments
 (0)