Set a `sha` parameter on the MR form. If this doesn't match the HEAD of
the source branch when the form is submitted, show a warning (like with
a merge conflict) and don't merge the branch.
Enable Style/For rubocop cop
> Do not use `for`, unless you know exactly why. Most of the time iterators should be used instead. `for` is implemented in terms of `each` (so you're adding a level of indirection), but with a twist - `for` doesn't introduce a new scope (unlike `each`) and variables defined in its block will be visible outside it.
See #17478
See merge request !4397
Merge Builds and Pipelines tab into one
Based on https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4053#note_12064642. Main idea is to keep all CI-related pages under one tab. So we can keep top navigation clean.
First I tried `CI/CD` naming but it looked weird so I just used Pipelines as tab name. I did not change project settings naming.
cc @ayufan @markpundsack @jschatz1
See merge request !4340
Separate reference gathering from rendering
This is a required step to allow batch processing when gathering references. This in turn would allow grabbing (for example) all mentioned users of an issue/merge request using a single query.
cc @rspeicher @DouweM
See merge request !3969
There are several changes to this module:
1. The use of an explicit stack in Participable#participants
2. Proc behaviour has been changed
3. Batch permissions checking
== Explicit Stack
Participable#participants no longer uses recursion to process "self" and
all child objects, instead it uses an Array and processes objects in
breadth-first order. This allows us to for example create a single
Gitlab::ReferenceExtractor instance and pass this to any Procs. Re-using
a ReferenceExtractor removes the need for running potentially many SQL
queries every time a Proc is called on a new object.
== Proc Behaviour Changed
Previously a Proc in Participable was expected to return an Array of
User instances. This has been changed and instead it's now expected that
a Proc modifies the Gitlab::ReferenceExtractor passed to it. The return
value of the Proc is ignored.
== Permissions Checking
The method Participable#participants uses
Ability.users_that_can_read_project to check if the returned users have
access to the project of "self" _without_ running multiple SQL queries
for every user.
Fix cancelability and retriablity of pipeline with generic statuses
Currently it's not possible to cancel or retry generic status since this is external thing to GitLab.
This fixes shown actions of pipelines containing only these actions.
See merge request !4380
Use project that belongs to pipeline in view
## What does this MR do?
This MR makes project in pipelines view match the one that pipeline has been created for.
Closes#17943
See merge request !4376
Make EmailsOnPushWorker use Sidekiq mailers queue
A customer was having issues with EmailsOnPushWorker clogging the Sidekiq queues and merge requests not being handled quickly. While researching whether it would possible to spin up a separate Sidekiq task just to handle merge requests and other key functions, I found that this worker was using the default Sidekiq queue. Moving to the `mailers` queue makes it possible to de-prioritize this worker and give more weight to the others.
See merge request !4390
Use `Snippet#to_reference` directly
## What does this MR do?
Instead of hard coding snippet reference, we could just use the existing method for that.
## Why was this MR needed?
To address https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4338#note_12166325 from @DouweM
/cc @jschatz1
See merge request !4379
Pass the "Remember me" value to the 2FA token form
Prior, if a user had 2FA enabled and checked the "Remember me" field,
the setting was ignored because the OTP input was on a new form and the
value was never passed.
Closes#18000
See merge request !4369
New style for close buttons
## What does this MR do?
Adds new style for all `Close` buttons
## What are the relevant issue numbers?
Closes#17756
## Screenshots (if relevant)
<img src="/uploads/a1d4cb8c22facb4c170e9cf3b4ae439a/Screen_Shot_2016-05-31_at_2.26.42_PM.png" width="800px">
<img src="/uploads/d567694d79ec6bd5da0ff2faf8b262b0/Screen_Shot_2016-05-31_at_2.26.09_PM.png" width="800px">
<img src="/uploads/f5e23d8031427079a334d4e03da466b0/Screen_Shot_2016-05-31_at_2.29.01_PM.png" width="800px">
cc @dzaporozhets
See merge request !4388
EmailsOnPushWorker was using the default queue, which made it impossible
to prioritize MergeWorker and other key workers with a separate Sidekiq
process.
Include Wiki attributes in Wiki page events webhook
The hook data we are sending is not 100% correct (we send details of the project, but should also send details of the "ProjectWiki" attributes like URLs and repositories relative to the wiki itself).
This is a follow up to #17506Fixes#17507
See merge request !4138
Enable Wiki Page events from Webhook admin UI in a Project
* Added UI to enable page wiki events
* Documentation for this event in Webhooks page
Fixes#17506
---

See merge request !4135
Make authentication service for Container Registry to be compatible with < Docker 1.11
This removes the usage of `offline_token` which is only present when using `Docker 1.11.x` instead we relay on `scope`. This should make it compatible with any client starting from 1.6 (I did test only 1.8 and up).
Right now we return 403 if unauthorized user doesn't have access to anything. In all other cases we return token, but with empty `access`, which simply disallow requested action.
See merge request !4363
Prior, if a user had 2FA enabled and checked the "Remember me" field,
the setting was ignored because the OTP input was on a new form and the
value was never passed.
Closes#18000
Enable Style/NegatedIf Rubocop cop
Favor `unless` over `if` for negative conditions (or control flow ||).
```ruby
# bad
do_something if !some_condition
# bad
do_something if not some_condition
# good
do_something unless some_condition
# good
some_condition || do_something
```
See #17478
See merge request !4355
Enable Style/EndOfLine Rubocop style cop
Use Unix-style line endings.
Removed carriage return character from end of each line in `app/controllers/projects/find_file_controller.rb`
See #17478
See merge request !4347