Commit Graph
15084 Commits
Author SHA1 Message Date
Sean McGivern f680eca912 Don't allow merges with new commits
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.
2016-06-01 20:34:41 +01:00
Robert Speicher 3d3c9c75aa Merge branch 'style/enable-semicolon-rubocop-cop' into 'master'
Enable Style/Semicolon rubocop style cop

Don't use semicolons to terminate expressions.

See #17478.

See merge request !4351
2016-06-01 17:41:19 +00:00
Robert Speicher 164fc34eb2 Merge branch 'rubocop/enable-style-for-cop' into 'master'
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
2016-06-01 17:36:42 +00:00
Dmitriy Zaporozhets 4621531a40 Merge branch 'dz-one-ci-cd-tab' into 'master'
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
2016-06-01 16:53:21 +00:00
Douwe Maan 2d084dd848 Merge branch 'separate-banzai-references' into 'master'
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
2016-06-01 15:51:59 +00:00
Yorick Peterse 580d250166 Refactor Participable
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.
2016-06-01 16:22:35 +02:00
Douwe Maan ef6fe42ec0 Merge branch 'fix-cancelable-retryable' into 'master'
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
2016-06-01 14:21:03 +00:00
Rémy Coutable 4581e71c44 Merge branch 'fix/error-500-in-pipeline-when-fork' into 'master'
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
2016-06-01 12:37:51 +00:00
Douwe Maan d1c537ad32 Merge branch 'long.polyglot/gitlab-ce-issue_17479_todos_not_remove_when_leave_project' 2016-06-01 13:39:56 +02:00
Douwe Maan 9d88a3a1dd Merge branch 'emails-on-push-use-sidekiq-mailers' into 'master'
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
2016-06-01 11:07:25 +00:00
Douwe Maan 173d83cae9 Merge branch 'prefer-to_reference' into 'master'
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
2016-06-01 10:57:26 +00:00
Douwe Maan 3416bc53fb Merge branch 'rs-remember-me-2fa' into 'master'
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
2016-06-01 10:57:05 +00:00
Douwe Maan 4a50e1f051 Merge branch 'current-settings-use-request-store-during-request' 2016-06-01 12:55:00 +02:00
Grzegorz Bizon d133175b39 User internal pipeline to access project in views 2016-06-01 12:01:49 +02:00
Grzegorz Bizon 0319d5b632 Enable Style/For rubocop cop
Do not use for, unless you know exactly why.

See #17478
2016-06-01 11:18:11 +02:00
Rémy Coutable 46ac3107a4 Merge branch 'issue_15557' into 'master'
Fix error 500 when sorting issues by milestone due date and filtering by labels

fixes #15557 

See merge request !4327
2016-06-01 08:42:36 +00:00
Dmitriy Zaporozhets cb261abee1 Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce 2016-06-01 11:34:45 +03:00
Dmitriy Zaporozhets 8959de25d7 Merge branch 'rs-event-common-has-tooltip' into 'master'
Add tooltips for common Event feed entries

This adds tooltips to the event target for events like "opened merge
request !XYZ"

After https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4090#note_11712839, several references in the event feed had titles but were still missing tooltips.

See merge request !4371
2016-06-01 08:34:29 +00:00
Grzegorz Bizon face87b7bb Enable Style/Semicolon rubocop style cop
See #17478
2016-06-01 08:45:14 +02:00
Jacob Schatz 473ea1e974 Merge branch '17756-close-btn' into 'master'
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
2016-05-31 22:51:33 +00:00
Felipe Artur 56f3b243ce Add leading comment space cop 2016-05-31 19:33:46 -03:00
Stan Hu 47b60b6cfe Make EmailsOnPushWorker use Sidekiq mailers queue
EmailsOnPushWorker was using the default queue, which made it impossible
to prioritize MergeWorker and other key workers with a separate Sidekiq
process.
2016-05-31 15:06:08 -07:00
Annabel Dunstone 1648316eff New style for close buttons 2016-05-31 14:23:27 -06:00
Connor Shea 7f4f959e9b Upgrade Kaminari from 0.16.3 to 0.17.0.
Changelog: https://github.com/amatsuda/kaminari/blob/master/CHANGELOG.rdoc#0170

Deprecates num_pages in favor of total_pages and includes Rails 5 support.
2016-05-31 14:14:16 -06:00
Robert Speicher 613bcdc626 Merge branch 'data_leak' into 'master'
Confidential notes data leak

Fixes part of https://gitlab.com/gitlab-org/gitlab-ee/issues/575

See merge request !1967
2016-05-31 19:35:13 +00:00
Valery Sizov 9154586ce5 Confidential notes data leak 2016-05-31 21:32:53 +03:00
Rémy Coutable c12c77eb25 Merge branch 'feature/improve_wiki_page_events' into 'master'
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 #17506

Fixes #17507

See merge request !4138
2016-05-31 18:10:23 +00:00
Gabriel Mazetto 04084996e5 Codestyle changes 2016-05-31 11:24:58 -03:00
Gabriel Mazetto aaaed331ba Fix hook data for Wiki Page event
Added "wiki" section and removed "repository"
2016-05-31 11:24:58 -03:00
Felipe Artur 30e61ed79c Fix error 500 when sorting issues by milestone due date and filtering by labels 2016-05-31 10:35:57 -03:00
Kamil Trzcinski bc621eef54 Pipelines can be canceled only when there are running builds 2016-05-31 15:26:00 +02:00
Lin Jen-Shin 538b2d687e Use Snippet#to_reference directly 2016-05-31 13:03:30 +00:00
Kamil Trzcinski 7b0e2bbc80 Fix the use of CurrentSettings in ContainerRegistryAuthenticationService 2016-05-31 13:48:05 +02:00
Kamil Trzcinski 846d111f1d Add Application Setting to configure Container Registry token expire delay (default 5min) 2016-05-31 13:23:13 +02:00
Rémy Coutable ba81c91255 Merge branch 'patch/wiki_page_events' into 'master'
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

--- 

![new_webhook_UI](/uploads/63ef24b4ccef13ac7a5fda83e9ce64ad/new_webhook_UI.png)

See merge request !4135
2016-05-31 08:34:38 +00:00
Stan Hu 9951243bf4 Merge branch 'make-container-registry-authentication-service-compatible-with-older-docker' into 'master'
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
2016-05-31 03:18:33 +00:00
Robert Speicher 7c4acf0068 Add tooltips for common Event feed entries
This adds tooltips to the event target for events like "opened merge
request !XYZ"
2016-05-30 23:10:30 -04:00
Robert Speicher a602df3031 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
2016-05-30 22:25:35 -04:00
Gabriel Mazetto ab17e4b74f Small fixes and added to the changelog 2016-05-30 17:41:27 -03:00
Gabriel Mazetto e3311178a3 Add Admin UI to enable Wiki Page events webhook in projects 2016-05-30 16:12:50 -03:00
Robert Speicher de20bd5b31 Merge branch 'rubocop/enable-space-before-comma-cop' into 'master'
Enable Style/SpaceBeforeComma rubocop cop

No spaces before commas.

See #17478

See merge request !4360
2016-05-30 18:22:48 +00:00
Robert Speicher e7586cfbdc Merge branch 'rubocop/enable-negatedif-style-cop' into 'master'
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
2016-05-30 17:59:10 +00:00
Robert Speicher ea32937630 Merge branch 'rubocop/enable-literal-in-condition-cop' into 'master'
Enable Lint/LiteralInCondition rubocop cop

Detects literals used in conditions.

See #17478

See merge request !4354
2016-05-30 17:56:15 +00:00
Robert Speicher 7a6d069f41 Merge branch 'style/enable-multiline-if-then-rubocop-cop' into 'master'
Enable Style/MultilineIfThen rubocop cop

Do not use then for multi-line if.

See #7478.

See merge request !4353
2016-05-30 17:47:59 +00:00
Robert Speicher 1a59b350d8 Merge branch 'style/enable-method-def-parentheses-rubocop-cop' into 'master'
Enable Style/MethodDefParentheses rubocop cop

Use def with parentheses when there are parameters.

See #17478

See merge request !4352
2016-05-30 17:46:22 +00:00
Robert Speicher 38e0e399de Merge branch 'style/enable-while-until-do-rubocop-style-cop' into 'master'
Enable Style/WhileUntilDo rubocop style cop

Checks for redundant `do` after `while` or `until`.

See #17478

See merge request !4350
2016-05-30 17:36:30 +00:00
Robert Speicher 8cb7759b92 Merge branch 'style/enable-rubocop-end-of-line-cop' into 'master'
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
2016-05-30 17:27:48 +00:00
Robert Speicher c61cf41def Merge branch 'style/enable-block-alignment-rubocop-lint' into 'master'
Enable Lint/BlockAlignment Rubocop cop

See #17478

See merge request !4346
2016-05-30 17:26:57 +00:00
Long Nguyen aeb5262d42 Add changelog and code refactor 2016-05-30 22:32:07 +07:00
Long Nguyen 41f8e6a4d7 Merge branch 'master' of https://gitlab.com/gitlab-org/gitlab-ce into issue_17479_todos_not_remove_when_leave_project 2016-05-30 22:24:43 +07:00