Skip to content

Commit c3b8a32

Browse files
fix: app detail deployed by (#6032)
* modified the deployed by value in appDetail Card * also took account for the deleted user * added comment * added the new field in Deployment Container bean * resolved the comments
1 parent 6501b56 commit c3b8a32

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

api/bean/AppView.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ type DeploymentDetailContainer struct {
186186
DeploymentConfig *bean.DeploymentConfig `json:"-"`
187187
IsPipelineTriggered bool `json:"isPipelineTriggered"`
188188
ReleaseMode string `json:"releaseMode"`
189+
LastDeployedById int `json:"-" sql:"last_deployed_by_id"`
189190
}
190191

191192
type AppDetailContainer struct {

cmd/external-app/wire_gen.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/sql/repository/AppListingRepository.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ func (impl AppListingRepositoryImpl) FetchMinDetailOtherEnvironment(appId int) (
699699
func (impl AppListingRepositoryImpl) DeploymentDetailByArtifactId(ciArtifactId int, envId int) (bean.DeploymentDetailContainer, error) {
700700
impl.Logger.Debug("reached at AppListingRepository:")
701701
var deploymentDetail bean.DeploymentDetailContainer
702-
query := "SELECT env.id AS environment_id, env.environment_name, env.default, pco.created_on as last_deployed_time, a.app_name" +
702+
query := "SELECT env.id AS environment_id, env.environment_name, env.default, pco.created_on as last_deployed_time, pco.updated_by as last_deployed_by_id, a.app_name" +
703703
" FROM pipeline_config_override pco" +
704704
" INNER JOIN pipeline p on p.id = pco.pipeline_id" +
705705
" INNER JOIN environment env ON env.id=p.environment_id" +

pkg/pipeline/CiHandler.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1517,7 +1517,9 @@ func (impl *CiHandlerImpl) FetchMaterialInfoByArtifactId(ciArtifactId int, envId
15171517
}
15181518
}
15191519

1520-
triggeredByUserEmailId, err = impl.userService.GetActiveEmailById(workflow.TriggeredBy)
1520+
//getting the user including both active and inactive both
1521+
// as there arises case of having the deleted user had triggered the deployment
1522+
triggeredByUserEmailId, err = impl.userService.GetEmailById(int32(deployDetail.LastDeployedById))
15211523
if err != nil && !util.IsErrNoRows(err) {
15221524
impl.Logger.Errorw("err", "err", err)
15231525
return &types.GitTriggerInfoResponse{}, err

0 commit comments

Comments
 (0)