Fix diff comments not showing up in activity feed
## What does this MR do?
It fixes the detection of note events to check for `Note` and `LegacyDiffNote`.
## Are there points in the code the reviewer needs to double check?
No? /cc @DouweM (since I believe you introduced `LegacyDiffNote`
## Why was this MR needed?
To fix#19092.
## What are the relevant issue numbers?
Fixes#19092.
## Does this MR meet the acceptance criteria?
- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- Tests
- [x] Added for this feature/bug
- [ ] All builds are passing
- [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 you do - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)
See merge request !5069
(cherry picked from commit b5b17d00ed)
Renable import button when import process fail due to the namespace already been taken
Closes#19435
## Screenshots (if relevant)
Before:
<br/><br/>
After:

See merge request !5053
(cherry picked from commit d6efef0f2a)
Fix emoji paths in relative root configurations
## What does this MR do?
If a site specifies a relative URL root, emoji files would omit the path from the URL, leading to lots of 404s.
## Are there points in the code the reviewer needs to double check?
At first, I tried to use `ActionView::Helpers::AssetUrlHelper.asset_url` since this is what it's intended to do. But this helper function is extremely slow, and it took minutes to generate the URLs for the hundreds of links needed for each emoji.
## Why was this MR needed?
Because emojis were broken in relative URL installations
## What are the relevant issue numbers?
#15642
## Does this MR meet the acceptance criteria?
- [X] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- Tests
- [X] Added for this feature/bug
- [x] All builds are passing
- [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 you do - rebase it please)
- [X] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)
See merge request !5027
(cherry picked from commit 88dbc4d110)
Fixing problems with events for import/export
Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/19202
A couple of issues related to target being missing in exported `Events` (as being polymorphic and not have `ActiveRecord` relationships is a bit more tricky than normal models) plus as the export was in JSON, the import retrieves hashed fields as stringified hashes and not symbolized - so fixed that as well, which was the cause of https://gitlab.com/gitlab-org/gitlab-ce/issues/19202
Also fixed / refactored tests
:simpl
Import/Export Version has been bumped to 0.1.1 as theses changes to events won't work very well with old exports - forcing users to generate a new export in the new version.
See merge request !4987
(cherry picked from commit c368cb605b)
Fixed 'use shortcuts' button on docs
## What does this MR do?
Exposes 'onToggleHelp() to window object through `showHelp()` so a help panel can be toggled globally using `showHelp()`.
## Are there points in the code the reviewer needs to double check?
Is this the best implementation? I actually think this is tidier than doing something like `onclick="new Shortcuts().onToggleHelp"` or `$.trigger 'keydown', char: '?'` but let me know.
## Why was this MR needed?
Docs UX
## What are the relevant issue numbers?
Closes#19157.
## Screenshots (if relevant)
## Does this MR meet the acceptance criteria?
- [ ] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- [ ] [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
- [ ] All builds are passing
- [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 you do - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)
Closes#19157
See merge request !4979
(cherry picked from commit 48843c0d85)
Admin should be able to turn shared runners into specific ones:
## What does this MR do?
Make sure admins could turn shared runners into specific runners.
## Are there points in the code the reviewer needs to double check?
Is this the desired behaviour?
## Why was this MR needed?
Closes#19039Closes#19272

See merge request !4961
(cherry picked from commit b569f842b3)
Improve the request / withdraw access button
It implements the design proposed in #18310.
No.
To close#18310.
Closes#18310.
| Medium | Large |
| ----------- | ------- |
|  |  |
| Medium | Large |
| ----------- | ------- |
|  |  |
| Medium | Large |
| ----------- | ------- |
|  |  |
| Medium | Large |
| ----------- | ------- |
|  |  |
- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- [x] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- Tests
- [x] All builds are passing
- [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 you do - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)
See merge request !4860
(cherry picked from commit c578fb064c)
Merge branch 'doc-mysql-priv' into 'master'
## What does this MR do?
Update missing mysql user permissions.
## Why was this MR needed?
This should also be in the `8-9-stable` branch.
See merge request !5086
Updated breakpoint for sidebar pinning
Updates the breakpoint for sidebar pinning to 1024px.
Think we will have the same issue as before when picking into stable with `$window` not being defined.
See merge request !5019
(cherry picked from commit c5d164d1df)
Expiry date on pinned nav cookie
Adds an expiry date far into the future for the pinned nav cookie so that it survives logout & browser closing.
See merge request !5009
(cherry picked from commit 73196fbd65)
Handle external issues in IssueReferenceFilter
Rendering issue references such as `#1` was broken for projects using an external issues tracker.
See gitlab-org/gitlab-ce#19036
See merge request !4988
(cherry picked from commit 6e82c0e06e)
Fix restore warning message
## What does this MR do?
Fix the restore Rake task so it properly outputs the database warning. This is a pretty important warning and it was not even being output. After this fix, the output looks like the screenshot below.

See merge request !4980
(cherry picked from commit 0144dce7ee)
Fixed comit avatar alignment
## What does this MR do?
Fixes the alignment of the avatar on https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG
Also fixes potential issues in other places.
## Screenshots (if relevant)

See merge request !4933
(cherry picked from commit 8cada02d49)
Fixed URL on label button when filtering
## What does this MR do?
Gives the filtered labels the correct URL. Previously they tried to link to `labels#show` whereas now it links to the correct filter path.
## What are the relevant issue numbers?
Closes#19005
See merge request !4897
(cherry picked from commit d3d9df5a10)
File Browser navigation fixes
Fixes a double request being made when clicking the file name when navigating through file browser and also fixes opening a file in a new tab or when doing ctrl + click.
Closes#19050
**Before**

**After**

See merge request !4891
(cherry picked from commit b32a6add8f)
Resolve "Sub nav isn't showing on file view"
## What does this MR do?
Adds subnav to `Repository` > `File` view
## What are the relevant issue numbers?
Closes#19003
Part of #18844
## Screenshots (if relevant)

cc @dzaporozhets
See merge request !4890
(cherry picked from commit 2efee5f641)
Fixed search field blur not removing focus
## What does this MR do?
Adds a blur event to remove focus styling from the search input.
Any particular reason we were looking for clicks on the document? I can't see why we would be.
## What are the relevant issue numbers?
Closes#18670
## Screenshots (if relevant)

See merge request !4704
(cherry picked from commit c051630aa8)
Ensure logged-out users can't see private refs
https://gitlab.com/gitlab-org/gitlab-ce/issues/18033
I'm still not sure what to do about the CHANGELOG on security issues - should I add to a patch release? This issue was assigned to 8.10.
See merge request !1974
(cherry picked from commit 3a6ebb1fd6)
Fix privilege escalation issue with OAuth external users
Related to https://gitlab.com/gitlab-org/gitlab-ce/issues/19312
This MR fixes a privilege escalation issue, where manually set external users would be reverted back to internal users if they logged in via OAuth and that provider was not in the `external_providers` list.
/cc @douwe
See merge request !1975
(cherry picked from commit 5e6342b7ac)
Fixes missing avatar on system notes
Closes#17295

See merge request !4954
(cherry picked from commit 9e8fdead17)
Removed fade when filtering results
## What does this MR do?
Removes the `opacity` change when filtering results seeing as we now do `Turbolinks.visit` it isn't required.
Best way to see issue - filter issues & then go back. Will still have opacity styling.
See merge request !4932
(cherry picked from commit bef4294c58)
Fixed avatar alignment in new MR view
## What does this MR do?
Fixes the alignment of the avatar in new MR view.
Closes#19076
## Screenshots (if relevant)

See merge request !4901
(cherry picked from commit 3611ee5663)
Fix encrypted data backwards compatibility after upgrading attr_encrypted gem
Adds missing attribute to attr_encrypted so it is fully backwards-compatible. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/19073
See merge request !4963
(cherry picked from commit 2c3f3cb392)
Resolve "Pin should show up at 1280px min"
Decreased window min width for pinned sidebar
Closes #19171
Part of #19200

See merge request !4947
(cherry picked from commit bbbd0e6c81)
Switched mobile button icons to ellipsis and angle
## What does this MR do?
Switches the mobile button icons
## What are the relevant issue numbers?
Closes#19170
Part of #19200
## Screenshots (if relevant)

See merge request !4944
(cherry picked from commit abc6004fae)
Better debugging for memory killer middleware
This adds more info to the warning messages output by `MemoryKiller`.
Previously only the PID was showed, making it difficult to debug issues like https://gitlab.com/gitlab-org/gitlab-ce/issues/19124
This adds the worker class and job ID to the log messages.
See merge request !4936
(cherry picked from commit 3659992cd5)
Remove duplicate new page btn from edit wiki
## What does this MR do?
Removes duplicate button on wiki page
## What are the relevant issue numbers?
Closes#19075
## Screenshots (if relevant)


See merge request !4904
(cherry picked from commit 121c5c837f)
Use clock_gettime for all performance timestamps
This MR adjusts the performance monitoring code to use `Process.clock_gettime` (thus `clock_gettime(3)`) instead of `Time.now`.
Using `Time.now` / `Time.new` adds more overhead than `Process.clock_gettime`, it also doesn't provide a way of getting timestamps in nanoseconds (which `Process.clock_gettime` does allow).
See merge request !4899
(cherry picked from commit 53ad9522c4)
Update omniauth-saml to 1.6.0 to address a security vulnerability in ruby-saml
## What does this MR do?
Updates `omniauth-saml` to bring in the new `ruby-saml` dependency that addresses [CVE-2016-5697](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-5697)
Fixes#19206
See merge request !4951