Port some changes from gitlab-ee!4532 back to CE
What does this MR do?
Port of some changes from https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/4532 to CE.
Why was this MR needed?
To minimize the diff between CE and EE.
Does this MR meet the acceptance criteria?
- Review
-
Has been reviewed by Backend
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Squashed related commits together