Skip to content

Return correct user for manual deployments

Krasimir Angelov requested to merge 66037-deployment-user into master

What does this MR do?

Currently for deployments that were created from jobs started manually we show the user who created deployment instead of the user that actually started the job.

This MR add new Deployment#deployed_by method that will return the deployable user instead (if there is one).

This is one way to solve the issue at hand, the other will be to update the deployment user (and not just the deployable one - https://gitlab.com/gitlab-org/gitlab-ce/blob/ba30e5dee21adf4e6282026441f7c9224be6fa2b/app/services/ci/play_build_service.rb#L13) when manual job is started. Not sure will this have any side effects though (and we'll have to update existing records).

Does this MR meet the acceptance criteria?

Conformity

Performance and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Related to #66037 (moved)

Edited by Krasimir Angelov

Merge request reports