Commit Graph
2857 Commits
Author SHA1 Message Date
Yorick Peterse 31e28ebceb Load related MRs/branches asynchronously
Currently this works by loading the HAML partials via XHR. While this is
not the nicest setup it _is_ the easiest setup using the tools we
currently have.

Loading this data asynchronously doesn't make loading the related
MRs/branches itself faster, it merely ensures that loading the issue
itself is not slowed down.

Fixes gitlab-org/gitlab-ce#14949
2016-04-13 17:24:21 +02:00
Dmitriy Zaporozhets ab4ea3720c Merge branch 'rs-archive-cache-worker-cron' into 'master'
Move RepositoryArchiveCacheWorker to sidekiq-cron

Closes #15105

See merge request !3663
2016-04-13 12:53:01 +00:00
Douwe Maan 4516f40dfe Merge branch 'decouple-member-notification' into 'master'
Decouple membership and notifications

This allow you to have notification setting per project even if you are member of group. 
It also creates background for having notification settings in project you are not member of. 


- [x] Make it work
- [x] Migrations
- [x] CHANGELOG
- [x] More tests
- [x] API

For #3359 

After this merge request there is still some work to be done: 

* create migration that remove duplicates in notification settings table and create uniq index (8.8 probably)
* remove notification_level field from Member model in 9.0
* make proper API for notification settings
* use `MemberCreateService` instead of Member#after_create callback for creating notification settings (after #14709) 
* maybe more tests 


Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

See merge request !3421
2016-04-12 16:39:40 +00:00
Jacob Schatz 63265243b5 Merge branch 'build-notification-fixes' into 'master'
Build notification null check

Cancels build notification interval on page change

See merge request !3540
2016-04-12 15:49:33 +00:00
Robert Speicher d75ec6cd46 Merge branch 'fix-missing-saml-error-handling' into 'master'
Add proper nil and error handling to SAML login process

While writing the feature that would allow certain Omniauth providers to be marked as external I noticed that there is a scenario where the `gl_user` method can return `nil` and if this is not properly checked, it will lead to exceptions that will cause 500 errors. It is quite easy to land in this scenario, so I added `nil` checks.

I also noticed that the `saml` method in the `omniauth_callbacks_controller.rb` file lacked a `rescue` for `Gitlab::OAuth::SignupDisabledError`, which can happen if the default configuration from `1_settings.rb` is applied. So I also added this check.

See merge request !3609
2016-04-12 15:46:39 +00:00
Robert Speicher cba2c437e5 Move RepositoryArchiveCacheWorker to sidekiq-cron
Closes #15105
2016-04-12 11:12:05 -04:00
Douglas Barbosa Alexandre ef22b76b73 Simplify Projects::NotificationSettingsController 2016-04-12 12:10:58 -03:00
Robert Schilling 9aefaa41ab Fix code review issues 2016-04-12 14:24:05 +02:00
Robert Schilling ba21c00f01 Delete notes via API 2016-04-12 14:24:05 +02:00
Douglas Barbosa Alexandre bee28e1785 Requires user to be signed in when changing notification settings 2016-04-11 20:50:26 -03:00
Douglas Barbosa Alexandre 93a10f17e0 Reuse User#notification_settings_for when it's possible 2016-04-11 20:50:26 -03:00
Phil Hughes ce0678faa5 Rubocop fix 2016-04-11 17:20:47 +01:00
Phil Hughes b87cc5f224 Preparing build status 2016-04-11 17:20:47 +01:00
Douglas Barbosa Alexandre 9a44d6977a Merge branch 'master' into decouple-member-notification 2016-04-11 10:34:49 -03:00
Jacob Schatz 69a8bf367c Merge branch 'mr-ui-update' into 'master'
Updated UI for new merge request

Closes #2540 

![Screen_Shot_2016-03-29_at_12.53.18](/uploads/426e603675171f0dc4e0af83c7762eba/Screen_Shot_2016-03-29_at_12.53.18.png)

![Screen_Shot_2016-03-29_at_12.53.13](/uploads/645ad7955acfb9f7693245fcc048ee49/Screen_Shot_2016-03-29_at_12.53.13.png)

See merge request !3228
2016-04-11 11:25:40 +00:00
Robert Speicher 2378ec0d63 Add a program tag to Sentry Raven context
This will let us filter errors by the program environment in which they
were encountered.

Source: http://stackoverflow.com/a/28370539/223897

Closes #15092
2016-04-09 19:57:27 -04:00
Douglas Barbosa Alexandre 635b65d120 Add method to return the user notification setting for a group, or a project 2016-04-08 18:46:45 -03:00
Douglas Barbosa Alexandre ee497599cc Use default_value_for to set default NotificationSetting#level 2016-04-08 17:24:27 -03:00
Douglas Barbosa Alexandre 127119f2c4 Simplify query to retrieve NotificationSetting on controllers 2016-04-08 16:59:06 -03:00
Douglas Barbosa Alexandre 7afeace354 Merge branch 'master' into decouple-member-notification 2016-04-08 15:48:09 -03:00
Patricio Cano 1d2429af9b Add missing proper nil and error handling to SAML login process. 2016-04-07 16:45:33 -05:00
Rémy Coutable 074c239390 Merge branch 'issue_14012' into 'master'
Fix problem when creating milestones in groups without projects

Fixes #14012 

See merge request !3481
2016-04-07 15:19:56 +00:00
Felipe Artur 0bef4b9764 Implement review suggestions 2016-04-07 10:59:24 -03:00
Rémy Coutable 237324cc17 Merge branch 'fix/2fa-authentication-spoofing' into 'master'
Fix 2FA authentication spoofing

## Summary

This is security fix for vulnerability described at 
https://gitlab.com/gitlab-org/gitlab-ce/issues/14900.

Attacker was able to bypass password authentication of users that have 2FA enabled, and consequently sign is as a different user, without knowing his password, if he managed to guess 2FA One Time Password for that user.

It was also possible to enumerate users and check if they have 2FA enabled, because GitLab responded with different error for each case.

## Fix

This MR attempts to change default user search scope if `otp_user_id` session variable has been set. If it is present, it means that user has 2FA enabled, and has already been verified with login and password. In this case we should look for user with `otp_user_id` first, before picking it up by `login`.

Both, 2FA authentication spoofing and 2FA discovery have been covered by specs.

## Further work

Current 2FA code is a bit tricky, so it probably needs some refactoring.



See merge request !1947
2016-04-07 11:56:44 +00:00
Grzegorz Bizon 00da609cfd Fix 2FA authentication spoofing vulnerability
This commit attempts to change default user search scope if otp_user_id
session variable has been set. If it is present, it means that user has
2FA enabled, and has already been verified with login and password. In
this case we should look for user with otp_user_id first, before picking
it up by login.
2016-04-07 11:19:29 +02:00
Rémy Coutable 8eae7b1088 Merge branch 'feature/expose-builds-badge' into 'master'
Expose badges

This MR exposes badge somewhere in visible place.

![expose_badges](/uploads/d2e290d3013d1ef2b1bdeebbbe2c5d8b/expose_badges.png)

Closes #13801

See merge request !3326
2016-04-07 08:40:15 +00:00
Rémy Coutable d62a3decf9 Merge branch 'fix_14638' into 'master'
Fixes #14638.

The SQL query was ambiguous and in this case we want to filter projects.

See merge request !3462
2016-04-07 08:35:38 +00:00
Stan Hu 924e4b3700 Return status code 303 after a branch DELETE operation to avoid project deletion
Closes #14994
2016-04-06 21:11:10 -07:00
Robert Speicher 936be025cd Merge branch 'saml-external-groups' into 'master'
Allow SAML to identify external users and set them as such

Related to #4009

Fixes #14577

This allows SAML to retrieve group information form the `SAML Response`
and match that to a setting that will flag all matching users as external.

See merge request !3530
2016-04-07 00:35:08 +00:00
Robert Speicher 730625f022 Merge branch 'patch/fix-markdown-preview-wikis' into 'master'
Wiki preview URL converting problem [via Markdown]

Current implementation when rendering the preview, thinks relative links are for project repository files.

We are creating a new preview route that will define correct context data to render for wikis instead.

Fixes #2380, #1184

See merge request !3461
2016-04-07 00:17:21 +00:00
Grzegorz Bizon 7689e87854 Use default branch when displaying list of badges 2016-04-06 19:56:35 +02:00
Grzegorz Bizon 5f32b82a80 Change name of badge variable in badges controller 2016-04-06 19:56:34 +02:00
Grzegorz Bizon a3a93ba4b0 Expose project badges in project settings menu 2016-04-06 19:56:34 +02:00
Grzegorz Bizon 97a2de9e03 Make it possible to switch ref in badges view 2016-04-06 19:56:34 +02:00
Grzegorz Bizon b7fa7c4d59 Extend build status badge, add html/markdown methods 2016-04-06 19:56:34 +02:00
Grzegorz Bizon 88fc7ccdda Add project badges view prototype 2016-04-06 19:56:34 +02:00
PotHix 222e1dc59c Fixes #14638.
The SQL query was ambiguous and in this case we want to filter projects.
2016-04-06 13:56:28 -03:00
Phil Hughes 1af1b6c8d3 Fixed target project update 2016-04-06 11:08:40 +01:00
Phil Hughes c5c05f6a04 Updated UI for new merge request
Closes #2540
2016-04-06 11:08:40 +01:00
Stan Hu 779b9eac57 Merge branch 'fix-project-path-rename' into 'master'
Fix Error 500 after renaming a project path

Renaming the path of a project would result in an Error 500 due to `@repository` being memoized with the old path. An Error 500 would result:

```
Started GET "/testing2/test1" for 127.0.0.1 at 2016-04-04 12:42:30 +0000
Processing by ProjectsController#show as HTML
  Parameters: {"namespace_id"=>"testing2", "id"=>"test1"}
Completed 200 OK in 637ms (Views: 194.2ms | ActiveRecord: 111.8ms)
Started GET "/testing2/test1/edit" for 127.0.0.1 at 2016-04-04 12:42:33 +0000
Processing by ProjectsController#edit as HTML
  Parameters: {"namespace_id"=>"testing2", "id"=>"test1"}
Completed 200 OK in 594ms (Views: 183.8ms | ActiveRecord: 87.4ms)
Started PATCH "/testing2/test1" for 127.0.0.1 at 2016-04-04 12:42:41 +0000
Processing by ProjectsController#update as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"[FILTERED]", "project"=>{"nam
e"=>"test123", "path"=>"test123"}, "namespace_id"=>"testing2", "id"=>"test1"}
Completed 500 Internal Server Error in 1852ms (ActiveRecord: 124.0ms)

ActionView::Template::Error (no repository for such path):
    2:   %legend
    3:     Builds:
    4:
    5:   - unless @repository.gitlab_ci_yml
    6:     .form-group
    7:       .col-sm-offset-2.col-sm-10
    8:         %p Builds need to be configured before you can begin using Contin
uous Integration.
  app/models/repository.rb:59:in `block in empty?'
  lib/repository_cache.rb:19:in `fetch'
  app/models/repository.rb:59:in `empty?'
  app/models/repository.rb:471:in `gitlab_ci_yml'
  app/views/projects/_builds_settings.html.haml:5:in `_app_views_projects__build
s_settings_html_haml__782034335636359229_73397600'
  app/views/projects/edit.html.haml:87:in `block in _app_views_projects_edit_htm
l_haml___2388082585934859365_47390860'
  app/views/projects/edit.html.haml:8:in `_app_views_projects_edit_html_haml___2
388082585934859365_47390860'
  app/controllers/projects_controller.rb:54:in `block (2 levels) in update'
  app/controllers/projects_controller.rb:43:in `update'
  lib/gitlab/middleware/go.rb:16:in `call'
```

Closes #14885

See merge request !3528
2016-04-05 22:16:15 +00:00
Stan Hu 934f1e9097 Fix Error 500 after renaming a project path
Closes #14885
2016-04-05 11:18:13 -07:00
Felipe Artur 32c7e42b61 Improve code 2016-04-05 11:53:39 -03:00
Felipe Artur 5d42803045 Improve code 2016-04-05 11:53:39 -03:00
Felipe Artur 1ba9a91c6d Fix problem when creating milestones in groups without projects 2016-04-05 11:53:39 -03:00
Grzegorz Bizon bb9c194c23 Respond 404 when unauthorized user imports members 2016-04-05 14:37:06 +02:00
Grzegorz Bizon c52b5c92fb Do not leak project exists when importing members
When importing members, and user does not have permissions to read
members in a source project, do not leak information about source
project existence. Notifiy user that project has not been found instead.
2016-04-05 13:55:15 +02:00
Grzegorz Bizon b248ee9381 Check permissions when importing project members
Closes #14899
2016-04-05 13:32:28 +02:00
Patricio Cano e99855bfe4 Avoid saving again if the user attributes haven't changed 2016-04-04 19:10:59 -05:00
Douwe Maan f505c753b0 Merge branch 'fix_remove_fork_link' into 'master'
Remove fork link closes all merge requests opened on source project

Currently, if you:

- create a fork
- open a merge request on the source project
- remove the fork link

The created MR cannot be closed.

With this MR, all pending MR is closed when the fork link is removed.

See merge request !3189
2016-04-04 15:37:08 +00:00
Douwe Maan fee7ad8627 Merge branch 'build-updates' into 'master'
Build updates

Fixes #10851 

![build-updates](/uploads/52e09e679ca457f3d818f9a12fd8382b/build-updates.gif)


See merge request !2604
2016-04-03 13:22:27 +00:00