Return correct user for manual deployments
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
-
Changelog entry for user-facing changes, or community contribution. Check the link for other scenarios. -
Documentation created/updated or follow-up review issue created -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Performance and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers
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)