GitLab FOSS merge requestshttps://staging.gitlab.com/gitlab-org/gitlab-foss/-/merge_requests2017-09-27T12:20:13Zhttps://staging.gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/12424Store merge request ref_fetched status in the database2017-09-27T12:20:13Zusername-removed-378947Store merge request ref_fetched status in the database## What does this MR do?
It introduces `ref_fetched` database field for merge request, so we can cache the value and avoid hitting git when displaying a merge request.
## Are there points in the code the reviewer needs to double check?...## What does this MR do?
It introduces `ref_fetched` database field for merge request, so we can cache the value and avoid hitting git when displaying a merge request.
## Are there points in the code the reviewer needs to double check?
## Why was this MR needed?
:airplane_departure: :train2:
## Does this MR meet the acceptance criteria?
- [x] [Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) added, if necessary
- ~~[ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)~~
- ~~[ ] API support added~~
- Tests
- [x] Added for this feature/bug
- [ ] All builds are passing
- [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if it does - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)
## What are the relevant issue numbers?
Closes #340529.4username-removed-443319username-removed-443319https://staging.gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/12369Change gitlab_sign_in to sign_in2017-09-04T08:12:44ZRobert SpeicherChange gitlab_sign_in to sign_inThe exciting conclusion of https://gitlab.com/gitlab-org/gitlab-ce/issues/30196#note_31552752!
I changed a few of our biggest offenders by hand and ran before-and-afters, just to give an idea of the improvement we should expect:
```she...The exciting conclusion of https://gitlab.com/gitlab-org/gitlab-ce/issues/30196#note_31552752!
I changed a few of our biggest offenders by hand and ran before-and-afters, just to give an idea of the improvement we should expect:
```shell
$ be rspec spec/features/discussion_comments/
Finished in 4 minutes 19.7 seconds (files took 11.88 seconds to load)
Finished in 2 minutes 30.2 seconds (files took 10.52 seconds to load)
$ be rspec spec/features/projects/pipelines/pipelines_spec.rb
Finished in 3 minutes 41.7 seconds (files took 14.56 seconds to load)
Finished in 2 minutes 21.2 seconds (files took 13.88 seconds to load)
$ be rspec spec/features/issues/user_uses_slash_commands_spec.rb
Finished in 6 minutes 47 seconds (files took 17.55 seconds to load)
Finished in 4 minutes 1.4 seconds (files took 12.44 seconds to load)
(also includes removal of duped specs in 17196a2ff31)
$ be rspec spec/features/merge_requests/user_uses_slash_commands_spec.rb
Finished in 3 minutes 40.9 seconds (files took 18.16 seconds to load)
Finished in 2 minutes 45 seconds (files took 11.8 seconds to load)
```
TODO:
- [x] Fix specs broken by this change
- [x] `gitlab_sign_out` to `sign_out`
- [x] `gitlab_sign_out_direct` to `sign_out`
- [x] Remove `gitlab_sign_out_direct` definition
- [x] Fix specs again
- [x] EE version, do it all over again :tada: :arrow_right: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/22559.4Douwe MaanDouwe Maanhttps://staging.gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/12324Fix GitHub importer performance on branch existence check2017-06-21T21:18:23Zusername-removed-283999douglas@gitlab.comFix GitHub importer performance on branch existence checkFixes https://gitlab.com/gitlab-org/gitlab-ce/issues/33259Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/332599.3username-removed-443319username-removed-443319https://staging.gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/12323Perform project housekeeping after importing projects2017-06-28T08:30:02Zusername-removed-283999douglas@gitlab.comPerform project housekeeping after importing projectsFixes #34019Fixes #340199.3username-removed-443319username-removed-443319https://staging.gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/12298Upgrade to webpack v3.4.02017-08-08T12:11:00Zusername-removed-636429Upgrade to webpack v3.4.0Upgrading to webpack v3 promises several improvements including:
- scope hoisting (removing many unnecessary closures and improving runtime performance)
- build performance improvements
While it works pretty much out of the box, many o...Upgrading to webpack v3 promises several improvements including:
- scope hoisting (removing many unnecessary closures and improving runtime performance)
- build performance improvements
While it works pretty much out of the box, many of the plugins we use have not yet been updated to recognize the v3.x semver as a valid peer dependency. As a result, `yarn check` will fail until we update the following packages:
- [x] babel-loader
- [x] stats-webpack-plugin
- [x] eslint-import-resolver-webpack
- [x] karma-webpack
- [x] webpack-dev-server
- [x] worker-loader
- [x] webpack-dev-middleware
Closes #339029.4username-removed-636429username-removed-636429https://staging.gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/12273Add index for head pipeline2017-06-21T12:55:17ZKamil TrzcińśkiAdd index for head pipelineFollowing https://gitlab.com/gitlab-org/gitlab-ce/issues/33856Following https://gitlab.com/gitlab-org/gitlab-ce/issues/338569.3yorickpeterse-stagingyorickpeterse-staginghttps://staging.gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/12270Reduce wait timings for Sidekiq jobs2017-08-17T11:44:57Zyorickpeterse-stagingReduce wait timings for Sidekiq jobs## What does this MR do?
This reduces the time spent waiting for Sidekiq jobs to complete in various places.
## Why was this MR needed?
Creating a project can time out if it takes more than 60 seconds for an authorized projects job to...## What does this MR do?
This reduces the time spent waiting for Sidekiq jobs to complete in various places.
## Why was this MR needed?
Creating a project can time out if it takes more than 60 seconds for an authorized projects job to complete, producing an HTTP 500 in the process. Further, AuthorizedProjectsWorker jobs usually seem to take around 10 seconds with only very little time spent doing actual work. Reducing the wait interval should hopefully reduce the time spent in these jobs.
## Does this MR meet the acceptance criteria?
- [x] [Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) added, if necessary
- [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)
cc @dblessing since you ran into users experiencing the mentioned problems.9.3username-removed-128633username-removed-128633https://staging.gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/12252Make issuable sidebar setSidebarHeight more efficient2017-07-02T18:01:15Zusername-removed-408230Make issuable sidebar setSidebarHeight more efficient1. Moves logic for `setSidebarHeight` into `sidebar_height_manager` to allow for better code sharing with bulk update sidebar.
2. Makes `setSidebarHeight` more efficient, by preventing its being called when sidebar state hasn't changed.1. Moves logic for `setSidebarHeight` into `sidebar_height_manager` to allow for better code sharing with bulk update sidebar.
2. Makes `setSidebarHeight` more efficient, by preventing its being called when sidebar state hasn't changed.9.4Tim ZallmannTim Zallmannhttps://staging.gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/12212Speed up used languages calculation on charts page2017-06-16T11:34:42Zusername-removed-443319Speed up used languages calculation on charts page## What does this MR do?
Fix our last user of `Rugged::Repository#fetch_attributes`: https://performance.gitlab.net/dashboard/db/method-calls-by-action-and-worker?orgId=1&var-method=Rugged::Repository%23fetch_attributes
## Are there po...## What does this MR do?
Fix our last user of `Rugged::Repository#fetch_attributes`: https://performance.gitlab.net/dashboard/db/method-calls-by-action-and-worker?orgId=1&var-method=Rugged::Repository%23fetch_attributes
## Are there points in the code the reviewer needs to double check?
Well, do we want to monkey-patch this? We should probably also make this chart load async, and cache the chart data, but this is an easier change :slight_smile:
## Why was this MR needed?
https://gitlab.com/gitlab-org/gitlab_git/commit/340e111e040ae847b614d35b4d3173ec48329015 wasn't being used in one place, from a library: https://github.com/github/linguist/blob/v4.7.0/lib/linguist/lazy_blob.rb#L33-L36 I think we can be reasonably confident that this will still produce correct results, and even if they differ slightly, we don't document these special Linguist attributes :shrug:9.4username-removed-128633username-removed-128633https://staging.gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/12162Instrument MergeRequestDiff#load_commits2017-06-16T16:53:25Zusername-removed-443319Instrument MergeRequestDiff#load_commitsThis instrumentation isn't needed strictly for performance measurements, but
just to see which controller actions call this method at all. See
https://gitlab.com/gitlab-org/gitlab-ce/issues/30224#note_32306159 for more
details.This instrumentation isn't needed strictly for performance measurements, but
just to see which controller actions call this method at all. See
https://gitlab.com/gitlab-org/gitlab-ce/issues/30224#note_32306159 for more
details.9.3username-removed-443319username-removed-443319https://staging.gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/12135Refactor ProjectsFinder#init_collection and GroupProjectsFinder#init_collection2017-06-21T09:15:48Zyorickpeterse-stagingRefactor ProjectsFinder#init_collection and GroupProjectsFinder#init_collection## What does this MR do?
This refactors `ProjectsFinder#init_collection` so it doesn't rely on a UNION any more, producing simpler queries in the process. This also refactors `GroupProjectsFinder#init_collection` in a similar fashion, t...## What does this MR do?
This refactors `ProjectsFinder#init_collection` so it doesn't rely on a UNION any more, producing simpler queries in the process. This also refactors `GroupProjectsFinder#init_collection` in a similar fashion, though it still uses a UNION as this produced better queries compared to using `OR` statements.
This fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/33632.
## Query Difference
Code such as this:
```ruby
ProjectsFinder.new(current_user: User.find(1), params: { starred: true }).execute
```
Would produce SQL such as this:
```sql
SELECT projects.*
FROM projects
WHERE projects.pending_delete = 'f'
AND (
projects.id IN (
SELECT projects.id
FROM projects
INNER JOIN users_star_projects ON users_star_projects.project_id = projects.id
INNER JOIN project_authorizations ON projects.id = project_authorizations.project_id
WHERE projects.pending_delete = 'f'
AND project_authorizations.user_id = 1
AND users_star_projects.user_id = 1
UNION
SELECT projects.id
FROM projects
INNER JOIN users_star_projects ON users_star_projects.project_id = projects.id
WHERE projects.visibility_level IN (20, 10)
AND users_star_projects.user_id = 1
)
)
ORDER BY projects.id DESC;
```
With these changes the above query is reduced down to this instead:
```sql
SELECT projects.*
FROM projects
INNER JOIN users_star_projects
ON users_star_projects.project_id = projects.id
WHERE projects.pending_delete = 'f'
AND (
EXISTS (
SELECT 1
FROM project_authorizations
WHERE project_authorizations.user_id = 1
AND (project_id = projects.id)
)
OR projects.visibility_level IN (20,10)
)
AND users_star_projects.user_id = 1
ORDER BY projects.id DESC;
```
The plan of this query (on GitLab.com) is:
```
QUERY PLAN
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Nested Loop (cost=0.72..42.15 rows=1 width=510) (actual time=0.039..0.059 rows=2 loops=1)
-> Index Only Scan Backward using index_users_star_projects_on_user_id_and_project_id on users_star_projects (cost=0.29..8.33 rows=2 width=4) (actual time=0.011..0.012 rows=2 loops=1)
Index Cond: (user_id = 1)
Heap Fetches: 0
-> Index Scan using projects_pkey on projects (cost=0.43..16.90 rows=1 width=510) (actual time=0.020..0.021 rows=1 loops=2)
Index Cond: (id = users_star_projects.project_id)
Filter: ((NOT pending_delete) AND ((alternatives: SubPlan 1 or hashed SubPlan 2) OR (visibility_level = ANY ('{20,10}'::integer[]))))
SubPlan 1
-> Index Only Scan using index_project_authorizations_on_user_id_project_id_access_level on project_authorizations (cost=0.43..8.45 rows=1 width=0) (actual time=0.008..0.008 rows=0 loops=2)
Index Cond: ((user_id = 1) AND (project_id = projects.id))
Heap Fetches: 0
SubPlan 2
-> Index Only Scan using index_project_authorizations_on_user_id_project_id_access_level on project_authorizations project_authorizations_1 (cost=0.43..9.62 rows=68 width=4) (never executed)
Index Cond: (user_id = 1)
Heap Fetches: 0
Planning time: 0.575 ms
Execution time: 0.211 ms
```
I am a little bit surprised about the sub plans here so I'll see if I can somehow get rid of those.
## Does this MR meet the acceptance criteria?
- [x] [Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) added, if necessary
- Tests
- [x] Added for this feature/bug
- [x] All builds are passing
- [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)9.3username-removed-128633username-removed-128633https://staging.gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/12103Render add-diff-note with server and optimize styles2017-07-17T18:58:26Zusername-removed-408230Render add-diff-note with server and optimize stylesThis MR address a few performance bottlenecks related to the add-diff-note button that occur on MRs with large diffs. Specifically, this MR:
1. moves the rendering of the button back to the server, and shows/hides it using `opacity` r...This MR address a few performance bottlenecks related to the add-diff-note button that occur on MRs with large diffs. Specifically, this MR:
1. moves the rendering of the button back to the server, and shows/hides it using `opacity` rather than `display`
2. removes the transform applied to the button on hover (`scale`) because it automatically triggers a reflow. This is a UX matter, but there's no way to use this property that won't trigger a reflow.
3. refactors `diff.js` and `file_comment_button.js` to avoid unnecessary computation and event handling.
**Performance Impact:**
On MRs with a large diff (1k lines changed), when hovering over diff lines:
1. increases FPS from 1-2 to 30-40
2. decreases CPU usage from 75-90% to < 10%
Obviously, results may vary, as these were collected on a single machine. Similar improvements occur as diff size increases (I tested up to 37.5k lines).
Visually the difference looks like this:
**Before:**
![2017-06-12_20.01.32](/uploads/914d77398e9190925f0064891ef1e8bc/2017-06-12_20.01.32.gif)
**After:**
![2017-06-12_20.02.29](/uploads/b6b996676e7c637c15fdc3ed6a67b593/2017-06-12_20.02.29.gif)
9.4Phil Hughesme@iamphill.comPhil Hughesme@iamphill.comhttps://staging.gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/12099Add index to ci_builds for created_at and project2017-06-15T11:48:21ZZeger-Jan van de Wegzegerjan@gitlab.comAdd index to ci_builds for created_at and project## Does this MR meet the acceptance criteria?
- [X] [Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) added, if necessary
- Tests
- [ ] Added for this feature/bug
- [ ] All builds are passing
## What are the ...## Does this MR meet the acceptance criteria?
- [X] [Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) added, if necessary
- Tests
- [ ] Added for this feature/bug
- [ ] All builds are passing
## What are the relevant issue numbers?
Hope its a fix for gitlab-org/gitlab-ce#32407, but not closing it until its clear.Zeger-Jan van de Wegzegerjan@gitlab.comZeger-Jan van de Wegzegerjan@gitlab.comhttps://staging.gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/12097Address Performance Issues for Large Diff MRs2017-06-28T18:23:03Zusername-removed-408230Address Performance Issues for Large Diff MRs### Known causes of lag at scale
- Injecting add diff note into the DOM (Fixed: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/12103)
- transform/transition styles of add-diff-note (Fixed: https://gitlab.com/gitlab-org/gitlab...### Known causes of lag at scale
- Injecting add diff note into the DOM (Fixed: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/12103)
- transform/transition styles of add-diff-note (Fixed: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/12103)
- setSidebarHeight on scroll
- Fixed position elements
- Tooltips being injected into the DOM
- Autosize JS on text input
- initTimeagoTimeout running every second
- large lag on initial diff load
Closes #304049.4https://staging.gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/12075Test todos_count_format helper at the correct level to improve speed2017-06-12T09:06:56ZRobert SpeicherTest todos_count_format helper at the correct level to improve speedInstead of an integration test that creates 101 Todo records to test a
simple view helper, just unit test the helper.Instead of an integration test that creates 101 Todo records to test a
simple view helper, just unit test the helper.9.4username-removed-128633username-removed-128633https://staging.gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/12032Enable webpack code splitting2017-07-28T17:53:45Zusername-removed-636429Enable webpack code splitting## What does this MR do?
Starts work on #33391 by enabling and testing webpack code splitting (using the es2015 dynamic `import()` method)
- [x] use babel as the eslint parser to prevent it from complaining about stage 2 ECMAScript syn...## What does this MR do?
Starts work on #33391 by enabling and testing webpack code splitting (using the es2015 dynamic `import()` method)
- [x] use babel as the eslint parser to prevent it from complaining about stage 2 ECMAScript syntax like `import()`
- [x] test that async imports can correctly find and load code-split chunks when using a non-default root url (`relative_url_root` setting) - closes #32989
- [x] convert emoji picker into a relative url chunk (after refactor in !12432)
## Are there points in the code the reviewer needs to double check?
- eslint should not choke when it encounters `import()`
- emoji picker and PDF file preview should still work when testing with a `relative_url_root` setting
- this may be tested in staging
## Why was this MR needed?
see #33391 for a full explanation
## Screenshots (if relevant)
n/a
## Does this MR meet the acceptance criteria?
- [x] [Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) added, if necessary
- [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- ~~[ ] API support added~~
- Tests
- ~~[ ] Added for this feature/bug~~
- [x] All builds are passing
- [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if it does - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)
## What are the relevant issue numbers?
related to #33391
closes #329899.4username-removed-636429username-removed-636429https://staging.gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/12014Fix GitHub importer performance on branch existence check2017-06-21T00:43:50ZJames LopezFix GitHub importer performance on branch existence checkFixes https://gitlab.com/gitlab-org/gitlab-ce/issues/33259Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/332599.4username-removed-283999douglas@gitlab.comusername-removed-283999douglas@gitlab.comhttps://staging.gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/11940Limit non-administrators to adding 100 members at a time to groups and projects2017-06-06T20:46:16ZNick ThomasLimit non-administrators to adding 100 members at a time to groups and projects## What does this MR do?
Introduces a 100-member limit when adding users as members to groups or projects
## Are there points in the code the reviewer needs to double check?
The number was chosen entirely arbitrarily in #27148
## Wh...## What does this MR do?
Introduces a 100-member limit when adding users as members to groups or projects
## Are there points in the code the reviewer needs to double check?
The number was chosen entirely arbitrarily in #27148
## Why was this MR needed?
Allowing unprivileged users to specify arbitrarily large amounts of work for GitLab to do is a security risk
## Screenshots (if relevant)
## Does this MR meet the acceptance criteria?
- [ ] [Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) added, if necessary
- [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- [ ] API support added
- Tests
- [X] Added for this feature/bug
- [ ] All builds are passing
- [X] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [X] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [X] Branch has no merge conflicts with `master` (if it does - rebase it please)
- [X] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)
## What are the relevant issue numbers?
Closes #271489.3Douwe MaanDouwe Maanhttps://staging.gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/11910Implement "Block pipelines on protected branches"2019-09-20T03:21:01Zusername-removed-423915Implement "Block pipelines on protected branches"## What does this MR do?
Forbid creating/cancelling/retrying pipeline/jobs if:
* It's a tag and it's protected and the user cannot create the tag
* It's a branch and it's protected and the user cannot merge or push to the branch
...## What does this MR do?
Forbid creating/cancelling/retrying pipeline/jobs if:
* It's a tag and it's protected and the user cannot create the tag
* It's a branch and it's protected and the user cannot merge or push to the branch
## Does this MR meet the acceptance criteria?
- [x] [Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) added, if necessary
- Tests
- [x] Added for this feature/bug
## What are the relevant issue numbers?
Closes #30634, #346169.5Kamil TrzcińśkiKamil Trzcińśkihttps://staging.gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/11894redesign caching of application settings2017-06-06T19:29:41Zusername-removed-178117techguru@byiq.comredesign caching of application settings## What does this MR do?
Decreases number of round-trips to Redis and PostgreSQL by caching Application Settings. It also avoids calling ActiveRecord before (1) the DB is available, (2) the ApplicationSetting table is available, or (...## What does this MR do?
Decreases number of round-trips to Redis and PostgreSQL by caching Application Settings. It also avoids calling ActiveRecord before (1) the DB is available, (2) the ApplicationSetting table is available, or (3) while migrations are pending
## Why was this MR needed?
Design of caching for Application Settings was not being adhered to and approximately
10% of the DB transaction volume was checking the migration status of the DB and/or the availability of the ApplicationSetting table.
## Does this MR meet the acceptance criteria?
~~- [ ] [Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) added, if necessary~~
~~- [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)~~
~~- [ ] API support added~~
- Tests
- [x] Added for this feature/bug
- [x] All builds are passing
- [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if it does - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)
## What are the relevant issue numbers?
#33279, #33278, https://gitlab.com/gitlab-com/infrastructure/issues/19309.3username-removed-128633username-removed-128633