Commit Graph

798 Commits

Author SHA1 Message Date
Sean McGivern 1022456bb1 Allow browsing branches that end with '.atom'
We need to do two things to support this:

1. Simplify the regex capture in the routing for the CommitsController
   to not exclude the '.atom' suffix. That's a perfectly valid git
   branch name, so we shouldn't blow up if we get it.
2. Because Rails now can't automatically detect the request format, add
   some code to do so in `ExtractPath` when there is no path. This means
   that, given branches 'foo' and 'foo.atom', the Atom feed for the
   former is unroutable. To fix this: don't do that! Give the branches
   different names!
2016-10-11 13:31:12 +01:00
Linus G Thiel d0c240b64f Merge branch 'master' into 22211-500-instead-of-404 2016-10-11 09:22:57 +02:00
Dmitriy Zaporozhets 73adae0f62 Merge branch 'dz-cleanup-routing' into 'master'
Remove NamespacesController

* removes unnecessary NamespacesController. The main purpose of this controller was redirect to group or user page when URL like https://gitlab.com/gitlab-org was used. Now this functionality is handled by constrainers (like this https://gitlab.com/gitlab-org/gitlab-ce/blob/master/config/routes/user.rb#L17-21) and take user to correct controller right from the start.
* serve non existing API routes like `/api/v3/whatever` with Grape instead of Rails. Before this change wrong API url was served by rails with not obvious 404, 405 & 500 errors


See merge request !6733
2016-10-11 06:58:05 +00:00
James Edwards-Jones 6606642f8f fixup! Added link to bulk assign issues to MR author. (Issue #18876) 2016-10-10 16:19:46 +01:00
Dmitriy Zaporozhets 66c32cab1a Remove NamespacesController
The main purpose of this controller was redirect to group or user page
when URL like https://gitlab.com/gitlab-org was used. Now this
functionality is handled by contrainers and take user to correct
controller right from the start

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-10-10 16:32:32 +03:00
Semyon Pupkov 40fa1b6e6f Use user from let instead recreate in before 2016-10-09 20:31:28 +05:00
James Edwards-Jones 8d2de73a83 fixup! Added link to bulk assign issues to MR author. (Issue #18876) 2016-10-07 17:16:42 +01:00
Phil Hughes 7d20a91b2e Restore subscribe status in JSON 2016-10-07 09:24:57 +01:00
Douglas Barbosa Alexandre 0c286d5473 Fix JSON Schema that validates data returned by board issues endpoint 2016-10-07 09:15:46 +01:00
James 492b4332a4 Added link to bulk assign issues to MR author. (Issue #18876) 2016-10-06 13:37:37 +01:00
Douglas Barbosa Alexandre fe3f1657ab Add tests to Projects::Boards::IssuesController#create action 2016-10-06 11:00:01 +01:00
Rémy Coutable d51bb99a7e
Merge commit 'dev/security' into 'master'
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-10-06 08:33:11 +02:00
Linus G Thiel 6b9671388d Respond with 404 Not Found for non-existent tags
Non-existent tags should be handled with 404 Not Found.
2016-10-05 19:28:39 +02:00
barthc 35ced4dae4 fix group links 404 2016-10-05 09:57:54 +01:00
Rémy Coutable b8005b6112 Merge branch 'restrict-failed-2fa-attempts' into 'master'
Restrict failed login attempts from users with 2FA enabled.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/19799.

See merge request !6668
2016-10-04 15:04:57 +00:00
Sean McGivern 194fbc3c3d Restrict failed login attempts for users with 2FA
Copy logic from `Devise::Models::Lockable#valid_for_authentication?`, as
our custom login flow with two pages doesn't call this method. This will
increment the failed login counter, and lock the user's account once
they exceed the number of failed attempts.

Also ensure that users who are locked can't continue to submit 2FA
codes.
2016-10-04 15:01:38 +01:00
Rémy Coutable c8b1311934 Fix a few things after the initial improvment to Members::DestroyService
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-10-03 16:57:48 +02:00
Thomas Balthazar ddbe676dc3 Add a /wip slash command
It toggles the 'WIP' prefix in the MR title.
2016-10-03 09:36:21 +02:00
Robert Speicher e64594ac44 Merge branch '21983-member-add_user-doesn-t-detect-existing-members-that-have-requested-access' into 'master'
Resolve "`Member.add_user`doesn't detect existing members that have requested access"

## What does this MR do?

This merge request handle the case when an access requester is added to a group or project (via the members page or the API).

In `Member.add_user`, if an access requester already exists, we simply accept their request (and set the `created_by`, `access_level` and `expires_at` attributes if given).

## Are there points in the code the reviewer needs to double check?

I've taken the opportunity to cleanup the whole `{Group,Project}Member.add_user*` methods since it was quite a mess.

## What are the relevant issue numbers?

Closes #21983

See merge request !6393
2016-10-02 11:42:57 +00:00
James Lopez 29141ed3ea fix broken repo 500 errors in UI and added relevant specs 2016-09-29 16:58:14 +02:00
Rémy Coutable ec0061a95c Allow Member.add_user to handle access requesters
Changes include:

- Ensure Member.add_user is not called directly when not necessary
- New GroupMember.add_users_to_group to have the same abstraction level as for Project
- Refactor Member.add_user to take a source instead of an array of members
- Fix Rubocop offenses
- Always use Project#add_user instead of project.team.add_user
- Factorize users addition as members in Member.add_users_to_source
- Make access_level a keyword argument in GroupMember.add_users_to_group and ProjectMember.add_users_to_projects
- Destroy any requester before adding them as a member
- Improve the way we handle access requesters in Member.add_user
  Instead of removing the requester and creating a new member,
  we now simply accepts their access request. This way, they will
  receive a "access request granted" email.
- Fix error that was previously silently ignored
- Stop raising when access level is invalid in Member, let Rails validation do their work

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-09-28 09:43:00 +02:00
Connor Shea e13dc69be2 Fix test failure by accessing Content-Type header directly. 2016-09-27 20:52:41 -06:00
Nick Thomas 3ed80a0176 Enforce the fork_project permission in Projects::CreateService
Projects::ForkService delegates to this service almost entirely, but needed
one small change so it would propagate create errors correctly.

CreateService#execute needs significant refactoring; it is now right at the
complexity limit set by Rubocop. I avoided doing so in this commit to keep the
diff as small as possible.

Several tests depend on the insecure behaviour of ForkService, so fi them up at
the same time.
2016-09-27 13:17:56 +01:00
Douwe Maan 166c6cd85c Merge branch 'rc-new-members-approve-request-access-service' into 'master'
New `Members::ApproveAccessRequestService`

Part of #21979.

## Does this MR meet the acceptance criteria?

- [x] API support added
- Tests
  - [x] Added for this feature/bug
  - [x] All builds are passing
- [ ] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [ ] 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 !6266
2016-09-27 12:10:12 +00:00
Douglas Barbosa Alexandre 97551e8dd9 Improve project_with_board factory to create the default lists 2016-09-26 14:42:38 -03:00
Rémy Coutable 5dcdf1d51b Ensure Members::ApproveAccessRequestService can fin a requester by ID
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-09-22 15:50:48 +02:00
Rémy Coutable 24fed56787 Merge branch 'and-you-get-awards' into 'master'
And Snippets get awards

## What does this MR do?

Makes snippets more awesome, by making them awardables

## Why was this MR needed?

Because Snippets were left behind.

## What are the relevant issue numbers?

Closes #17878

See merge request !4456
2016-09-21 15:22:28 +00:00
Rémy Coutable fb4d2f9e5a Merge branch 'feature/github-edit-path' into 'master'
Lets the user choose a namespace and name on Github imports

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/14971

See merge request !5728
2016-09-20 12:23:14 +00:00
James Lopez 0c65112da7 modify github import JS and controller so we can now specify a namespace and/or name for a project.
- Fixed and added specs.
- Added different namespace options depending on user privilages
- Updated docs.
2016-09-20 10:14:39 +02:00
Rémy Coutable c61a54f7fe Fix initial implementation to actually render the unsubscribe page
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-09-20 09:52:57 +02:00
Maximiliano Perez Coto b335730817 Fix "Unsubscribe" link in notification emails that is triggered by anti-virus
* Created a force=true param that will continue with the previous
  behaviour of the unsubscribe method
* Created a filter for not-logged users so they see a unsubsribe
  confirmation page
* Added the List-Unsubscribe header on emails so the email client can
  display it on top
2016-09-20 09:52:57 +02:00
Z.J. van de Weg e8dd0d54cb Fix tests for Snippets toggling awards
Also incorporate feedback
2016-09-19 19:53:09 +03:00
Z.J. van de Weg 25004cbc32 Snippets get award emoji! 👍 2016-09-19 19:47:43 +03:00
Katarzyna Kobierska d88f708b02 Improve grammar 2016-09-13 14:40:05 +02:00
Katarzyna Kobierska 31c37c6c38 Add #closed_without_source_project? 2016-09-13 14:40:05 +02:00
Katarzyna Kobierska 09cded29d8 Checks if deleting forked project closed all open merge requests 2016-09-13 14:40:05 +02:00
Katarzyna Kobierska 8c77a1fb25 Before deleting project if forked unlink fork 2016-09-13 14:40:05 +02:00
Robert Speicher 516100c55b Merge branch 'add-remember-option-u2f' into 'master'
Pass the remember_me option into the u2f form and support it while authenticating

## What does this MR do?

Adds remember me support in the u2f authentication, and makes sure the flag gets passed from the login form to the u2f form.

Based on the changes for the same thing done for regular 2fa: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4369

## Why was this MR needed?

The remember me option wasn't working for u2f devices (yubikey)

## What are the relevant issue numbers?

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/18103

See merge request !5918
2016-09-09 18:42:11 +00:00
Douglas Barbosa Alexandre d86c666662 Refresh todos count cache when an Issue/MR is deleted 2016-09-08 15:50:07 -03:00
Rémy Coutable 8aa025bb85
Merge branch 'master' of https://dev.gitlab.org/gitlab/gitlabhq
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-09-05 17:23:32 +02:00
Airat Shigapov b76ef40e36
Fix missing flash messages on service edit page 2016-09-05 14:13:15 +03:00
DJ Mountney 9224f031cf Pass the remember_me option into the u2f form and support it while authenticating
Matches the changes done for non-u2f two-factor auth
2016-09-01 17:11:42 -07:00
Felipe Artur 892dea6771 Project tools visibility level 2016-09-01 11:47:59 -03:00
Robert Speicher e71cd7a300 Merge branch 'refactor/add-policies' into 'master'
Refactor ability.rb into Policies

## What does this MR do?
Factors out `ability.rb` into a new abstraction - the "policy" (stored in `app/policies`). A policy is a class named `#{class_name}Policy` (looked up automatically as needed) that implements `rules` as follows:

``` ruby
class ThingPolicy < BasePolicy
  def rules
    @user # this is a user to determine abilities for, optionally nil in the anonymous case
    @subject # this is the subject of the ability, guaranteed to be an instance of `Thing`
    can! :some_ability # grant the :some_ability permission
    cannot! :some_ability # ensure that :some_ability is not allowed. this overrides any `can!` that is called before or after
    delegate! @subject.other_thing # merge the abilities (can!) and prohibitions (cannot!) from `@subject.other_thing`
    can? :some_ability # test whether, so far, :some_ability is allowed
  end

  def anonymous_rules
    # optional. if not implemented `rules` is called where `@user` is nil. otherwise this method is called when `@user` is nil.
  end
end
```

See merge request !5796
2016-08-31 20:53:40 +00:00
Douglas Barbosa Alexandre 325de662ce Don't create groups for unallowed users when importing projects 2016-08-31 12:55:45 -03:00
Stan Hu 341541d3af Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce 2016-08-30 14:48:17 -07:00
http://jneen.net/ 5853c96b49 remove Ability.abilities 2016-08-30 11:35:06 -07:00
Katarzyna Kobierska 6b02c82cfe Improve grammar 2016-08-30 13:05:40 +02:00
Katarzyna Kobierska c9c2503c51 User can edit closed MR with deleted fork
Add test for closed MR without fork

Add view test visibility of Reopen and Close buttons

Fix controller tests and validation method

Fix missing space

Remove unused variables from test

closed_without_fork? method refactoring

Add information about missing fork

When closed MR without fork can't edit target branch

Tests for closed MR edit view

Fix indentation and rebase, refactoring
2016-08-30 13:05:40 +02:00
Douglas Barbosa Alexandre 4cccfc0f17 Fix issue boards leak private label names and descriptions 2016-08-29 16:04:28 -03:00
Stan Hu ace38e8397 Fix external issue tracker "Issues" link leading to 404s
a70431f874 modified the behavior to link to the external issue tracker
issues URL instead of the project path URL. This restores the
previous behavior.

Closes #21252, #21402
2016-08-25 14:53:17 -07:00
Z.J. van de Weg 4c8e9a8d27 Remove gitorious 2016-08-25 10:10:10 +01:00
Stan Hu e665444724 Fix incorrect "stopped impersonation" log message
Closes #21015
2016-08-23 01:09:16 -07:00
Jacob Schatz 8e14a40769 Merge branch '17932-move-to-project-dropdown' into 'master'
Move to project dropdown with infinite scroll for better performance

## What does this MR do?

On the Move dropdown on the edit issue page we introduced infinite scrolling to just return a limited number of projects, 50 items. So if the user can move the issue to 50 or more items when scroll down on the list a new set of projects will be requested to the server.

## Are there points in the code the reviewer needs to double check?

## Why was this MR needed?

See #17932

## What are the relevant issue numbers?

Closes #17932

## Screenshots (if relevant)

## Does this MR meet the acceptance criteria?

- [x] [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
  - [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 !5686
2016-08-19 14:57:09 +00:00
Paco Guzman ff903e6453 Move to project dropdown with infinite scroll for better performance
Use just SQL to check is a user can admin_issue on a project

Using offset pagination instead pages to avoid a count query

Tradeoff

- we duplicate how we check admin_issue in a SQL relation in the Ability class
2016-08-18 15:31:51 +02:00
Connor Shea d8654744cd
Merge branch 'master' into diff-line-comment-vuejs 2016-08-17 12:10:09 -06:00
Douwe Maan 46dc00631a Merge branch 'issue-boards' into 'master'
Issue boards

## What are the relevant issue numbers?

- Issue: #17907 
- Issue backend: #20335 
- Backend MR: !5548
- Frontend MR: !5554
- Documentation !5713 

## Screenshots (if relevant)

## Does this MR meet the acceptance criteria?

- [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)~~
- [X] ~~API support 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)
- [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

See merge request !5548
2016-08-17 18:02:26 +00:00
Douglas Barbosa Alexandre 536bdf643e Move the set up of the state described in context to a before block 2016-08-17 12:59:00 -03:00
Douglas Barbosa Alexandre 84afd6254a Remove # from controller actions specs 2016-08-17 12:58:59 -03:00
Douglas Barbosa Alexandre 29a91c5bc6 Fix matcher `match_response_schema` 2016-08-17 12:58:59 -03:00
Douglas Barbosa Alexandre cd98ff179c Move action to render board lists to `Projects::Boards::ListsController` 2016-08-17 12:58:59 -03:00
Douglas Barbosa Alexandre 57737785df Move board related controllers to the `Boards` namespace 2016-08-17 12:58:59 -03:00
Douglas Barbosa Alexandre 8e4e294a7c Rename from/to params to from_list_id/to_list_id 2016-08-17 12:58:59 -03:00
Douglas Barbosa Alexandre a8b1ad250e Add authorization to issues board related controllers 2016-08-17 12:58:59 -03:00
Douglas Barbosa Alexandre 6113767045 Add an endpoint to generate the default lists for a board 2016-08-17 12:58:59 -03:00
Douglas Barbosa Alexandre 5317f6ea94 Include the Issue#assignee in the response when listing issues 2016-08-17 12:58:58 -03:00
Douglas Barbosa Alexandre 9e5a305f18 Use zero-based positions on issues board services 2016-08-17 12:58:58 -03:00
Douglas Barbosa Alexandre 2c00d5928c Move endpoint to list issues under lists resources 2016-08-17 12:58:58 -03:00
Douglas Barbosa Alexandre 64d7559532 Refactor spec for Projects::BoardListsController 2016-08-17 12:58:58 -03:00
Douglas Barbosa Alexandre 75f0bc4af8 Add endpoint to allow users to move issues between lists 2016-08-17 12:58:58 -03:00
Douglas Barbosa Alexandre 296bcbd664 Add endpoint to list issues for a specific board list 2016-08-17 12:58:58 -03:00
Douglas Barbosa Alexandre 547d218e6b Add endpoint to allow users to remove lists 2016-08-17 12:58:58 -03:00
Douglas Barbosa Alexandre 0fb9210dbb Add endpoint to allow users to move lists 2016-08-17 12:58:58 -03:00
Douglas Barbosa Alexandre ed9943d013 Add endpoint to allow users to create a new board list 2016-08-17 12:58:58 -03:00
Douglas Barbosa Alexandre e199884478 Projects::BoardsController#show returns a list of board lists 2016-08-17 12:58:58 -03:00
Douglas Barbosa Alexandre a84176bada Creates a new board when project does not have one 2016-08-17 12:58:58 -03:00
Douglas Barbosa Alexandre 7649937452 Initial issues board page 2016-08-17 12:58:58 -03:00
Sean McGivern e6f3461c0b Merge remote-tracking branch 'origin/master' into mc-ui 2016-08-17 16:55:28 +01:00
Connor Shea a77629b1cb
Merge branch 'master' into diff-line-comment-vuejs 2016-08-17 09:52:39 -06:00
Paco Guzman 03386633a4 Move to project dropdown with infinite scroll for better performance
Use just SQL to check is a user can admin_issue on a project

Tradeoff

- we duplicate how we check admin_issue in a SQL relation in the Ability class
2016-08-17 07:33:51 +02:00
Connor Shea 1d3aa59f99
Merge branch 'master' into diff-line-comment-vuejs 2016-08-16 16:59:19 -06:00
Felipe Artur 2872672945 Load issues and merge requests templates from repository 2016-08-16 15:50:17 -03:00
Douwe Maan 41007f6d3c Address review feedback 2016-08-16 11:04:26 -05:00
Robert Speicher 7fef2f7b75 Merge branch 'akismet-submittable' into 'master'
Submit to Akismet Part 1 (Issues)

Related to #5932 #5573 gitlab-com/infrastructure#14

See merge request !5538
2016-08-15 22:59:47 +00:00
Patricio Cano 5994c11910 Further refactor and syntax fixes. 2016-08-15 17:20:57 -05:00
Douwe Maan 1ba2ef4fda Merge branch 'master' into mc-ui 2016-08-15 17:20:56 -05:00
Kamil Trzcinski e8aab1cd15 This fixes a long running tests due to changed Sidekiq state 2016-08-15 23:26:40 +02:00
Patricio Cano 43e756d4ea Refactored AkismetHelper into AkismetService and cleaned up `Spammable`
- Refactored SpamCheckService into SpamService
2016-08-15 13:18:15 -05:00
Patricio Cano 96399a81cb Allow `Issue` to be submitted as spam
- Added controller actions as reusable concerns
- Added controller tests
2016-08-15 13:18:15 -05:00
Patricio Cano 64ab2b3d9f Refactored spam related code even further
- Removed unnecessary column from `SpamLog`
- Moved creation of SpamLogs out of its own service and into SpamCheckService
- Simplified code in SpamCheckService.
- Moved move spam related code into Spammable concern
2016-08-15 13:18:15 -05:00
Patricio Cano 95419679f2 Lay the ground works to submit information to Akismet
- New concern `AkismetSubmittable` to allow issues and other `Spammable` models to be submitted to Akismet.
- New model `UserAgentDetail` to store information needed for Akismet.
- Services needed for their creation and tests.
2016-08-15 13:17:58 -05:00
Douwe Maan c770201061 Merge branch 'master' into diff-line-comment-vuejs 2016-08-12 17:23:19 -05:00
Douwe Maan e257200459 Add specs for NotesController and DiscussionsController 2016-08-12 16:24:09 -05:00
Sean McGivern ce7eb4e492 Add more tests for conflicts 2016-08-12 23:24:48 +03:00
Sean McGivern 46f8e6421a Remove undo endpoint
This reverts commit 2536fea8db0967a817615eb3e951eb6ba22f8ede.
2016-08-12 23:24:48 +03:00
Sean McGivern 3b84cfdc74 Use same resolution format on FE and BE 2016-08-12 23:24:46 +03:00
Sean McGivern 99e00856eb REMOVE THIS COMMIT: allow undoing last resolution 2016-08-12 23:24:44 +03:00
Sean McGivern f2f844693e Handle conflict resolution errors in controller 2016-08-12 23:24:44 +03:00
Sean McGivern 14a4b17d1c Allow resolving conflicts in MR controller 2016-08-12 23:24:43 +03:00
Sean McGivern a1c7961217 Handle multiple merge conflict files in collection 2016-08-12 23:24:43 +03:00
Stan Hu cb8a425ba4 Fix bug where destroying a namespace would not always destroy projects
There is a race condition in DestroyGroupService now that projects are deleted asynchronously:

1. User attempts to delete group
2. DestroyGroupService iterates through all projects and schedules a Sidekiq job to delete each Project
3. DestroyGroupService destroys the Group, leaving all its projects without a namespace
4. Projects::DestroyService runs later but the can?(current_user,
   :remove_project) is `false` because the user no longer has permission to
   destroy projects with no namespace.
5. This leaves the project in pending_delete state with no namespace/group.

Projects without a namespace or group also adds another problem: it's not possible to destroy the container
registry tags, since container_registry_path_with_namespace is the wrong value.

The fix is to destroy the group asynchronously and to run execute directly on Projects::DestroyService.

Closes #17893
2016-08-11 15:36:35 -07:00
tiagonbotelho 1d268a89de adds second batch of tests changed to active tense 2016-08-09 15:11:39 +01:00
tiagonbotelho 519275c110 fixes part1 of files to start using active tense 2016-08-09 15:06:23 +01:00
Paco Guzman 8f359ea917 Move to Gitlab::Diff::FileCollection
Instead calling diff_collection.count use diff_collection.size which is cache on the diff_collection
2016-08-03 07:00:20 +02:00
Paco Guzman cd7c2cb6dd Cache highlighted diff lines for merge requests
Introducing the concept of SafeDiffs which relates 
diffs with UI highlighting.
2016-08-03 07:00:19 +02:00
Robert Speicher 901d4d2ca5 Remove `url_for_new_issue` helper
Now we link to the standard `IssuesController#new` action, and let it
redirect if we're using an external tracker.
2016-08-01 18:23:12 -07:00
Robert Speicher a70431f874 Redirect to external issue tracker from `/issues`
Prior, in order to display the correct link to "Issues" in the project
navigation, we were performing a check against the project to see if it
used an external issue tracker, and if so, we used that URL. This was
inefficient.

Now, we simply _always_ link to `namespace_project_issues_path`, and
then in the controller we redirect to the external tracker if it's
present.

This also removes the need for the url_for_issue helper. Bonus! 🎉
2016-08-01 16:59:44 -07:00
Z.J. van de Weg 76e9b68439 Incorporate feedback 2016-07-29 13:54:45 +02:00
Z.J. van de Weg be9aa7f194 Add an URL field to Environments
This MR adds a string (thus max 255 chars) field to the enviroments
table to expose it later in other features.
2016-07-29 13:54:45 +02:00
Alejandro Rodríguez 08bac55149 Fix failing CommitController spec 2016-07-28 16:37:03 -04:00
Douwe Maan f6063baed4 Merge branch 'akismet-ui-check' into 'master'
Submit new issues created via the WebUI or API to Akismet for spam check on public projects.

## What does this MR do?

Submit new issues created via the WebUI by non project members to Akismet for spam check.

## Why was this MR needed?

Support for Akismet was added only to the API with !2266. This MR builds on that functionality to also check issues submitted via the WebUI for spam.

## What are the relevant issue numbers?

Related to:

- #5573 
- #5932 
- gitlab-com/infrastructure#14
- gitlab-com/support#61
- !2266

cc @stanhu @MrChrisW 

See merge request !5333
2016-07-27 19:36:43 +00:00
Sean McGivern dc4de2d8e2 Allow skipping users in autocomplete
Pass an array of user IDs in the `skip_users` param to have them
excluded from the results (unless they are explicitly included through
the `current_user` or `author_id` params).
2016-07-27 14:10:49 +01:00
Patricio Cano 9c34fafb8b Submit new issues created via the WebUI by non project members to Akismet for spam check. 2016-07-26 15:17:41 -05:00
Sean McGivern e44bbcb994 Show release notes in tag list
A release's tag reference is just the name of the tag, not the entire
tag object.

This also fixes the tags index if a tag's message contains non-UTF8 byte
sequences.
2016-07-26 16:31:25 +01:00
Achilleas Pipinellis b48fd097ff Fix failing spec on help controller 2016-07-22 11:49:09 +03:00
Rémy Coutable ed19b9cc43 Merge branch '4142-show-inline-video' into 'master'
Add support for inline videos in issue, MR and notes (on issue, commit, MR, and MR diff)

## What does this MR do?

It adds support for inline videos in issue, MR and notes (on issue, commit, MR, and MR diff). Most of the work was done by @hayesr in !3508 but a few improvements were still missing.

## Why was this MR needed?

To be able to play uploaded videos in GitLab!

## What are the relevant issue numbers?

Closes #4142.

## Screenshots

### Video players

![Screen_Shot_2016-07-19_at_18.44.09](/uploads/e85e531b455a41c3e66b26b356abaafd/Screen_Shot_2016-07-19_at_18.44.09.png)

-----

![Screen_Shot_2016-07-19_at_18.44.29](/uploads/05f52a812760210d1eae86a7f8fc48bc/Screen_Shot_2016-07-19_at_18.44.29.png)

-----

## Does this MR meet the acceptance criteria?

- [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] Test `VideoLinkFilter`
  - [x] Test in `spec/features/markdown_spec.rb`
  - [x] Improve `spec/uploaders/file_uploader_spec.rb`
  - [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 !5215
2016-07-21 07:29:38 +00:00
Connor Shea 16a8160e9f
Fix help page paths to make sure shortcuts and the UI help page work.
Add a test to make sure the help page UI path doesn't break in the future.

Fix #19972 and #19889.
2016-07-19 11:17:14 -06:00
Rémy Coutable 356b2d2bd7 Get rid of `is_image` in FileUploader
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-07-19 18:51:09 +02:00
Sean McGivern 87035c2945 Don't blow up in tree view on empty repo 2016-07-18 14:06:21 +01:00
Paco Guzman 244134f9c3 Cache todos pending/done dashboard query counts 2016-07-12 18:57:52 +02:00
Connor Shea c30b325781
Fix failing tests. 2016-07-11 16:11:33 -06:00
Sean McGivern 5266ae87c4 Support renames in diff_for_path actions 2016-07-11 09:31:34 +01:00
Sean McGivern e462e12278 Tidy up spec action names 2016-07-08 18:11:47 +01:00
Sean McGivern b6b26692ea Collapse large diffs by default
When rendering a list of diff files, skip those where the diff is over
10 KB and provide an endpoint to render individually instead.
2016-07-08 10:56:55 +01:00
Robert Speicher 0de617772d Revert "Revert "Merge branch 'issue_3946' into 'master' ""
This reverts commit bf2a86b73c.
2016-07-07 23:48:02 -04:00
Robert Speicher bf2a86b73c Revert "Merge branch 'issue_3946' into 'master' "
This reverts commit 68155ee73b, reversing
changes made to 7ebd011ed1.
2016-07-07 18:25:05 -04:00
Douwe Maan 86d238e4bd Merge branch 'new-diff-notes' into 'master'
New diff notes

Fixes #12732, #14731, #19375, #14783 

Builds on https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4110

To do:
- [x] Get it mostly working
- [x] Validate position validity
- [x] Fix: Don’t link to `#`
- [x] Fix: Base ref can be `nil`, potentially, when the MR has an oprhan source branch => Yep, doesn’t work. We need to store a `start_id`
- [x] Optimize: Fewer duplicate `git diff` compares
- [x] Optimize: Pass paths to `PositionTracer#diff` for faster diffs
- [x] Refactor: Use `head_id` in `MergeRequest`/`MergeRequestDiff` instead of `source_sha`
- [x] Refactor: Convert existing array-based diff refs to the DiffRefs model
- [x] Tweak: Use `note_type` in `Autosave` key
- [x] Tweak: Remove `line_code: note.line_code` from `link_to_reply_discussion`
- [x] Update: `SentNotifications` and reply-by-email receiver
- [x] Update: MR diff notification email
- [x] Update: API (MR, Commit note creation and entity)
- [x] Update: GitHub importer
- [x] Address any other TODO comments
- [x] Fix: Suppress "edited 4 minutes ago"
- [x] Write tests
  - [x] `LineMapper`
  - [x] `PositionTracer`
  - [x] `Position`
  - [x] `DiffPositionUpdateService`
  - [x] `DiffNote`
  - [x] `MergeRequests::RefreshService` / `MergeRequest#update_diff_notes_positions`
- [x] Make sure commits with diff notes don't get cleaned up, since this would prevent the diff notes from being rendered (https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5062)

Future improvements:
- Display unresolved comments on files outside the diff, if the comment was added when that file _was_ part of the diff
- Allow commenting on sections between hunks, when expanding the diff using `...`
  - (We'd need to generate line code based on Position if we have it, even if it falls outside bounds of diff)
- `diff_hunk` on diff note API entity
- Show diff hunk in notification email
- Resolved line notes would have a boolean, and be inactive through `notes.any? { !active? || resolved? }`
- Multi line notes would store a number of positions, and do the right thing (™) in grouping and then rendering if the first item is multiline? => true
- Image diff notes could store x,y,width,height instead of old_line,new_line for similar grouping. Does it need a reference to say if it's on old or new? These can't have line_codes, clearly. Rendering would be interesting.
- Show commit line comments in the MR diff
- Comment on specific selected words
- Comment on file header
- Unfold top of discussion diff note
- New diff notes API for commits and MRs

/cc @rspeicher

See merge request !4101
2016-07-07 20:45:03 +00:00
Alfredo Sumaran 338072cc4b Layout for Users Groups and Projects on admin area 2016-07-07 13:25:58 -05:00
Douwe Maan ddec2ed0df Add send_git_patch helper 2016-07-06 18:51:01 -04:00
Douwe Maan 6ce25e7b4c Rename MergeRequest methods that return commits or shas to be more clear and consistent 2016-07-06 18:50:58 -04:00
Timothy Andrew f617bd7690 Assert against `ActionMailer::Base.deliveries` relatively.
- Look for a `change` in its size rather than asserting against an
  actual size.

- This previously failed because another spec had an email in
  `ActionMailer::Base.deliveries`, which failed this `be_nil` assertion.
2016-07-05 10:20:32 +05:30
Douwe Maan d1c94f034b Merge branch 'explicit-requesters-scope' into 'master'
Exclude requesters from Project#members, Group#members and User#members

## What does this MR do?

It excludes requesters from the `Project#members`, `Group#members` and `User#members` associations, and adds new `Project#requesters` and `Group#requesters` associations.

## Are there points in the code the reviewer needs to double check?

No.

## Why was this MR needed?

Without this, if you call `project.members`, requesters are included in the results! This is at best misleading, and at worst can lead to security issues. By excluding requesters from the `#members` associations, we avoid introducing security inadvertently since you have to call the `#requesters` association explicitly to get requesters.

## What are the relevant issue numbers?

This is something I realized while fixing the security issue #19102.

## Does this MR meet the acceptance criteria?

- [x] I don't think this needs a CHANGELOG since this is an internal change
- 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 !4946
2016-07-01 22:23:26 +00:00
Grzegorz Bizon 9e211091a8 Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
Rémy Coutable bd78f5733c Exclude requesters from Project#members, Group#members and User#members
And create new Project#requesters, Group#requesters scopes.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-07-01 17:44:46 +02:00
Eric K Idema 12aa1f898d Import from Github using Personal Access Tokens.
This stands as an alternative to using OAuth to access a user's Github
repositories.  This is setup in such a way that it can be used without OAuth
configuration.

From a UI perspective, the how to import modal has been replaced by a full
page, which includes a form for posting a personal access token back to the
Import::GithubController.

If the user has logged in via GitHub, skip the Personal Access Token and go
directly to Github for an access token via OAuth.
2016-06-30 18:48:17 +02:00
Felipe Artur d2971315ab Merge branch 'master' into issue_3359_3 2016-06-29 11:32:38 -03:00
Felipe Artur 36d48120f6 merge master into issue_3359_3 2016-06-29 11:04:18 -03:00
Robert Speicher 5423e6e2d5 Merge branch 'zj-workhorse-format-patch' into 'master'
Workhorse to serve email diffs

See merge request !4590
2016-06-29 02:26:38 +00:00
Z.J. van de Weg c31f876a27 Workhorse to serve email diffs
Depends on the changes in Workhorse (gitlab-org/gitlab-workhorse!48).
2016-06-28 14:26:38 +02:00
Z.J. van de Weg abca19da8b Use HTTP matchers if possible 2016-06-27 20:10:42 +02:00
Stan Hu 4c767bab58 Merge branch 'issue_19096' into 'master'
Validate presence of essential params for diff rendering

## What does this MR do?

Check the presence of essential params before rendering diff content.
## Are there points in the code the reviewer needs to double check?

No
## Why was this MR needed?

To avoid the generated application error
## What are the relevant issue numbers?

#19096

## 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
  - [x] Added for this feature/bug
  - [x] All builds are passing
- [ ] 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)
- [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

See merge request !4917
2016-06-25 03:38:13 +00:00
Ruben Davila 7627cc1989 Validate presence of essential params for diff rendering
This will avoid application errors generated by the assumption of the
presence of these params.
2016-06-24 16:20:53 -05:00
Rémy Coutable e3d464d82a
Fix a wrong MR status when merge_when_build_succeeds & project.only_allow_merge_if_build_succeeds are true
The issue was that `MergeRequest#mergeable?` returns false when the CI
state is not success and project.only_allow_merge_if_build_succeeds is
true. In this case `Projects::MergeRequestsController#merge` would
return the `:failed` status when enabling `merge_when_build_succeeds`,
thus leading to a weird state and the MR never automatically merged.

The fix is to disable the CI state check in the controller safeguard
that early return the `:failed` status.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-06-24 18:33:02 +02:00
Felipe Artur 2674b54860 merge master into issue_3359_3 2016-06-22 10:47:48 -03:00
Felipe Artur 8447c6b180 Insert notification settings dropdown into groups 2016-06-22 10:44:20 -03:00
Felipe Artur 92e183542f Insert notification settings dropdown into groups 2016-06-22 10:38:42 -03:00
Douwe Maan c11006ac6c Merge branch '18755-fix-destroy-project-causes-post_decline_request-to-be-executed' into 'master'
Resolve "Destroying a project causes post_decline_request to be executed"

## What does this MR do?

Ensure we don't send "access request declined" to access requesters when a project is deleted.

## Are there points in the code the reviewer needs to double check?

I've created a service to decouple the notification sending from the AR model.

## Why was this MR needed?

Because there was an issue.

## What are the relevant issue numbers?

Fixes #18755, #18750.

## Does this MR meet the acceptance criteria?

- [x] No CHANGELOG needed.
- [x] 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 !4744
2016-06-22 01:15:29 +00:00
Phil Hughes f112e2a1da Fixed issue with returning ref in commits JSON
Added tests to project controller
2016-06-20 11:37:27 +01:00
Rémy Coutable 909a0ff3ac
Fix and remove duplicate specs
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-06-20 12:36:59 +02:00
Rémy Coutable 724f986fb2 Redirect to the member's source on request withdrawal
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-06-18 05:46:45 +02:00
Douwe Maan 00906b5bb6 Merge branch 'issue_12758' into 'master'
Implement custom notification level options

![Screen_Shot_2016-06-17_at_15.31.43](/uploads/3fc47d2f461b3e8b67bb8acaa304cf99/Screen_Shot_2016-06-17_at_15.31.43.png)

![Screenshot_from_2016-06-15_10-52-27](/uploads/88dbdd21d97e80ee772fe08fa0c9b393/Screenshot_from_2016-06-15_10-52-27.png)

part of #12758 

See merge request !4389
2016-06-17 23:28:22 +00:00
Douwe Maan b218e82b5c Merge branch 'issuable-todo-improvements'
# Conflicts:
#	app/controllers/projects/todos_controller.rb
2016-06-18 00:42:36 +02:00
Robert Speicher d9d149244a Merge branch 'disable-saml-account-unlink' into 'master'
Disable the unlink feature for SAML connected accounts (social login).

This disables the ability to manually unlink your SAML account, if you have one connected. In certain scenarios, the only allowed login mechanism can be SAML, and if you unlink your account you will be locked out of the system (configuration dependent).

Fixes #18613

See merge request !4662
2016-06-17 19:27:51 +00:00
Phil Hughes 914f973108 Removed update method
Re-structured controller spec
Renamed issuable param to issuable_id
2016-06-17 18:31:37 +01:00
Felipe Artur e5aa902860 Merge master into issue_12758 2016-06-17 14:29:11 -03:00
Phil Hughes 60b4049280 Added todo controller tests for merge requests 2016-06-17 09:13:21 +01:00
Phil Hughes b56965c5bb Correctly checks if user is logged in when adding todo 2016-06-17 09:06:00 +01:00
Phil Hughes 85fab13eba Improved manual todos
Based on feedback from !4502
2016-06-17 09:01:03 +01:00
Felipe Artur 33c61bd461 Re-use notifications dropdown/modal for user profile 2016-06-17 00:17:20 -03:00
Felipe Artur f82ab42d05 Re-use notifications dropdown on user profile 2016-06-16 23:34:21 -03:00
Timothy Andrew 90bba2bc46 Merge remote-tracking branch 'origin/master' into 2979-personal-access-tokens 2016-06-16 08:27:37 +05:30
Felipe Artur 89a2c8730b Implement custom notification level options 2016-06-15 11:47:50 -03:00
Douwe Maan a95f8b9a82 Merge branch 'stanhu/gitlab-ce-fix-error-500-false-binary-negative' 2016-06-15 15:56:02 +02:00
Patricio Cano 2786edc931 Added CHANGELOG item and fixed Rubocop errors 2016-06-14 18:37:22 -05:00
Patricio Cano 34bf165147 Disable the unlink feature for SAML connected accounts (social login). 2016-06-14 18:28:17 -05:00
Felipe Artur bef15a0f91 Refactor custom notifications controller code and add specs 2016-06-14 10:17:00 -03:00
Rémy Coutable 515205d3c1 UI and copywriting improvements
+ Move 'Edit Project/Group' out of membership-related partial
+ Show the access request buttons only to logged-in users
+ Put the request access buttons out of in a more visible button
+ Improve the copy in the #remove_member_message helper

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-06-14 13:18:14 +02:00
Rémy Coutable d71fbe0dbd Factorize #request_access and #approve_access_request into a new AccessRequestActions controller concern
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-06-14 13:07:26 +02:00
Rémy Coutable d26f81239a Add request access for groups
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-06-14 13:07:26 +02:00
Timothy Andrew d0bcba1105 Merge remote-tracking branch 'origin/master' into 2979-personal-access-tokens 2016-06-14 09:06:53 +05:30
Douglas Barbosa Alexandre b56c456750 Project members with guest role can't access confidential issues 2016-06-13 19:32:00 -03:00
Stan Hu 0fdfd2dd6e Fix Error 500 when viewing a blob with binary characters after the 1024-byte mark
Here was the problem:

1. When determining whether a given blob is viewable text, gitlab_git reads the first 1024 bytes and checks with Linguist whether it is a text or binary file.
2. If the blob is text, GitLab will attempt to display it.
3. However, if the text has binary characters after the first 1024 bytes, then GitLab will attempt to load the entire contents, but the encoding will be ASCII-8BIT since there are binary characters.
4. The Error 500 results when GitLab attempts to display a mix UTF-8 and ASCII-8BIT.

To fix this, we load as much data as we are willing to display so that the detection will work properly. Requires
an update to gitlab_git: gitlab-org/gitlab_git!86

Closes #13826
2016-06-12 07:36:25 -07:00
Douwe Maan 16bd4e5668 Merge branch 'master' into workhorse-helpers 2016-06-10 12:28:04 +02:00
Timothy Andrew d754d99179 Merge remote-tracking branch 'origin/master' into 2979-personal-access-tokens 2016-06-10 10:31:20 +05:30
Timothy Andrew 1779d68bfe Merge remote-tracking branch 'origin/master' into 2979-personal-access-tokens 2016-06-09 14:40:14 +05:30
Kamil Trzcinski a0adafddd0 Remove require_relative 'import_spec_helper' 2016-06-08 18:18:49 +02:00
Kamil Trzcinski 9560639e81 Move ImportSpecHelper to spec/support/ 2016-06-08 17:21:08 +02:00
Kamil Trzcinski 13d941e185 Make Omniauth providers specs to not modify global configuration 2016-06-08 16:50:05 +02:00
Stan Hu 3b50d96b8a Fix endless redirections when accessing user OAuth applications when they are disabled
Also hides the "Applications" nav button if OAuth applications are disabled by the admin.

Closes #14770
2016-06-08 05:52:04 -07:00
Douwe Maan a9857f8c2f Add send_git_diff helper 2016-06-08 14:30:15 +02:00
Jacob Schatz 5b83abcc01 Merge branch 'issue_14189' into 'master'
Ability to prioritize labels

Closes #14189 

See merge request !4009
2016-06-07 15:15:07 +00:00
Sean McGivern ee26c3cab4 Fix label order by priority on labels page 2016-06-07 14:01:30 +01:00
Jacob Vosmaer (GitLab) afa21054fa Merge branch 'zj-workhorse-to-serve-diffs' into 'master'
Workhorse to serve raw diffs

Fixes (partially) #13999

Dependent on: gitlab-org/gitlab-workhorse!45

See merge request !4130
2016-06-07 12:50:29 +00:00
Kamil Trzcinski 4e38d88df5 Merge remote-tracking branch 'origin/master' into rename-ci-commit-phase-2 2016-06-06 20:24:21 +02:00
Douwe Maan 4d4a9b7c8a Merge branch 'notes-are-awardables' into 'master'
Notes are awardables

## What does this MR do?

Makes sure we can :thunder_cloud_rain: comments/notes.

## What are the relevant issue numbers?
Follows up upon !2901, depends on !3785

Closes #3655 

## Screenshots (if relevant)
TODO



See merge request !4291
2016-06-06 16:48:35 +00:00
Kamil Trzcinski 3137a7fec3 Merge branch 'rename-ci-commit' into rename-ci-commit-phase-2 2016-06-06 16:46:36 +02:00
Douwe Maan 8c3ba8d6c9 Add workhorse controller and API helpers 2016-06-06 13:16:30 +02:00
Kamil Trzcinski 842f0a3401 Merge branch 'rename-ci-commit' into rename-ci-commit-phase-2
# Conflicts:
#	features/steps/shared/builds.rb
#	spec/requests/ci/api/builds_spec.rb
2016-06-06 11:21:39 +02:00
Z.J. van de Weg 7d3f8f542f Update tests on wording 2016-06-06 11:10:10 +02:00
ZJ van de Weg 2f9c2149a3 Backend awardables on comments 2016-06-06 11:03:39 +02:00
Timothy Andrew 4db19bb445 Add a U2F-specific audit log entry after logging in.
- "two-factor" for OTP-based 2FA
- "two-factor-via-u2f-device" for U2F-based 2FA
- "standard" for non-2FA login
2016-06-06 12:50:31 +05:30
Timothy Andrew 128549f10b Implement U2F registration.
- Move the `TwoFactorAuthsController`'s `new` action to `show`, since
  the page is not used to create a single "two factor auth" anymore. We
  can have a single 2FA authenticator app, along with any number of U2F
  devices, in any combination, so the page will be accessed after the
  first "two factor auth" is created.
- Add the `u2f` javascript library, which provides an API to the
  browser's U2F implementation.
- Add tests for the JS components
2016-06-06 12:50:31 +05:30
Zeger-Jan van de Weg 01e1139f68 Workhorse to serve raw diffs 2016-06-03 18:43:22 +02:00
Kamil Trzcinski 20c7144ed2 Rename all `[ci_]commit` to `[ci_]pipeline` in specs and features 2016-06-03 16:22:26 +02:00
Z.J. van de Weg 9d491712cf Merge branch 'master' into awardables 2016-06-03 15:20:11 +02:00
Douwe Maan 0e2490c0cb Merge branch '14139-sha-parameter-in-accept-merge-request-api' into 'master'
Resolve "SHA parameter in accept merge request API"

Add a `sha` parameter to the MR merge API, which must match the source SHA for the branch to be merged.

Also add the same parameter to the UI:

![MR_SHA](/uploads/616da728695dc19fa7ef7ef6a016ff81/MR_SHA.gif)

@DouweM and I discussed adding some smart feature to that, like updating the source SHA on navigating to the diff tab, but for now it will just require a refresh 😃

Closes #14139.

See merge request !4414
2016-06-03 12:41:58 +00:00
Dmitriy Zaporozhets 334cb86821 Update test since branch removal does not render template anymore
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-06-03 10:13:40 +03:00
Timothy Andrew 0dff6fd714 Fix rubocop spec. 2016-06-03 10:11:36 +05:30
Timothy Andrew ae0d8222af Merge remote-tracking branch 'origin/master' into 2979-personal-access-tokens 2016-06-03 09:31:16 +05:30
Timothy Andrew b4b0248577 Parts of spec names with "when" should be contexts. 2016-06-03 09:00:39 +05:30
Robert Speicher 7d33fba7af Merge branch 'upgrade-devise-two-factor' into 'master'
Upgrade devise, devise-two-factor, and attr_encrypted

Devise 4 includes support for Rails 5, working towards #14286. devise-async doesn't support Devise 4.0 and in 4.1 the bug that was blocking using Devise's built-in ActiveJob integration was fixed. So devise-async is removed. devise-two-factor 3.0.0 is required for Devise 4 support.

attr_encrypted and encryptor are optional but recommended upgrades for devise-two-factor 3.0.0. The mode and algorithm will need to be changed in order to update to attr_encrypted 4.x in the future.

See merge request !4216
2016-06-02 00:44:41 +00:00
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
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
Z.J. van de Weg 91a7b9333b Incorportate feedback 2016-06-01 12:10:08 +02:00
Timothy Andrew 05b319b0b4 Perform private token and personal access token authentication in the same `before_action`.
- So that the check for valid personal access tokens happens only if
  private token auth fails.
2016-06-01 14:04:38 +05:30
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
Connor Shea 5647fb14b6
Fix a broken spec
Temporary fix until Devise 4 fixes this grammar issue:
https://github.com/plataformatec/devise/issues/4095
2016-05-30 13:51:21 -06:00
ZJ van de Weg cbd7801b3d Merge branch 'master' into awardables 2016-05-30 18:54:08 +02:00
Grzegorz Bizon c370dce01c Enable Style/RedundantParentheses rubocop cop
See #17478
2016-05-30 15:07:18 +02:00
Zeger-Jan van de Weg be613de2cf Project#show on projects pending deletion will 404
fixes #17508
2016-05-28 03:14:43 -07:00
DJ Mountney 7d57b11093 Update tests for the current_application_settings request store changes 2016-05-27 19:05:52 -07:00
ZJ van de Weg 7ae536002a Merge branch 'master' into awardables 2016-05-25 14:41:25 +02:00
Robert Speicher 75739e54be Enable RSpec/NotToNot cop and auto-correct offenses
Also removes the note from the development/testing.md guide
2016-05-24 15:40:29 -04:00
Robert Speicher 3ba72f69af Enable Style/SpaceAroundKeyword cop and fix offenses 2016-05-23 14:16:35 -04:00
Douwe Maan a97cb8f8b8 Merge branch 'issue_9013' into 'master'
Let users set notification levels in projects which they are not members

Fixes #9013 

See merge request !3986
2016-05-20 21:04:55 +00:00
Felipe Artur 6fb9bf87c4 Use the right default notification settings for non members 2016-05-19 19:47:07 -04:00
Fatih Acet bb883387f9 Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into awardables
# Conflicts:
#	app/controllers/projects/merge_requests_controller.rb
#	app/models/note.rb
#	db/schema.rb
#	spec/models/note_spec.rb
2016-05-18 13:05:53 -05:00
Dmitriy Zaporozhets 253a017b01
Merge branch 'meinac/gitlab-ce-change_deprecated_render_usage'
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-05-18 12:48:23 -05:00
Felipe Artur 07ff874f57 Let users set notification levels in projects which they are not members 2016-05-17 21:53:03 -05:00
Douwe Maan 8b15628dd0 Merge branch 'issue_14684' into 'master'
Toggle email signup confirmation in admin settings

Implements toggling verification email #14684

See merge request !3862
2016-05-16 21:05:05 +00:00
Felipe Artur 7bb84e6497 Change landing page when skipping confirmation email and add documentation 2016-05-16 14:56:32 -03:00
Felipe Artur c5526a2d9a Change skip_user_confirmation_email to send_user_confirmation_email 2016-05-16 14:56:32 -03:00
Felipe Artur 71ca2de7aa Toggle email signup confirmation in admin settings 2016-05-16 14:56:32 -03:00
Sean McGivern bec350528c Force password change after admin reset
When an admin changes a user's password for them, force the user to
reset the password after logging in by expiring the new password
immediately.
2016-05-16 09:21:24 +01:00
Douwe Maan 7fc51d1908 Merge branch 'health-check-route'
# Conflicts:
#	db/schema.rb
2016-05-12 16:39:03 -05:00
Zeger-Jan van de Weg 7a4e7ad04e Fix tests and wrong choices during merge 2016-05-12 09:23:21 +02:00
DJ Mountney c8f23bd2ed Support token header for health check token, and general cleanup of the health_check feature. 2016-05-11 17:27:08 -07:00
Zeger-Jan van de Weg 4558b5b9fe Incorporate feedback 2016-05-11 22:43:58 +02:00
Zeger-Jan van de Weg 7e6dcf9cd0 Merge branch 'master' into awardables 2016-05-11 08:47:04 +02:00
Timothy Andrew d915e7d5ca Reuse the private token param and header for personal access tokens.
- https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/3749#note_11626427
- Personal access tokens are still a separate entity as far as the
  codebase is concerned - they just happen to use the same entry point
  as private tokens.
- Update tests and documentation to reflect this change
2016-05-11 10:16:23 +05:30
Timothy Andrew 2e9742997d Merge remote-tracking branch 'origin/master' into 2979-personal-access-tokens 2016-05-11 09:52:58 +05:30
DJ Mountney 0e0caf4d17 Add tests for the health check feature 2016-05-10 16:19:16 -07:00
Zeger-Jan van de Weg dccf8a9fc8 Add tests on Awardables and Award Emoji 2016-05-10 12:03:13 +02:00
Long Nguyen 6781c1b4ba Add specs for user routing and update spec for user controller 2016-05-08 22:06:19 +07:00
Zeger-Jan van de Weg 3bdc57f0a7 Create table for award emoji 2016-05-06 10:47:11 +02:00
Robert Speicher c9bc3d20ef Merge remote-tracking branch 'dev/master' into 'master' 2016-05-02 19:58:54 -04:00
Grzegorz Bizon c9577711ce Handle issue move access instead of raising error
Closes #15533
2016-04-30 21:28:40 +02:00
Timothy Andrew bafbf22c6a Address @DouweM's feedback on !3749.
- Use `TokenAuthenticatable` to generate the personal access token
- Remove a check for `authenticity_token` in application controller;
  this should've been `authentication_token`, maybe, and doesn't make
  any sense now.
- Have the datepicker appear inline
2016-04-28 22:28:36 +05:30
Timothy Andrew ade40fdcd2 Authenticate non-API requests with personal access tokens.
- Rename the `authenticate_user_from_token!` filter to
  `authenticate_user_from_private_token!`
- Add a new `authenticate_user_from_personal_access_token!` filter
- Add tests for both.
2016-04-28 22:28:36 +05:30
Stan Hu eede032345 Backport GitHub Enterprise import support from EE
These changes were pulled from GitLab EE to support configuring
an alternative API URL than the default https://api.github.com.
In addition, the `verify_ssl` flag allows users to disable SSL cert
checking.

One modification: add a default `args` option if it does not exist
to avoid breaking existing configurations.
2016-04-26 21:00:55 -07:00
Douwe Maan b992e2520c Fix typo 2016-04-22 21:46:47 +00:00
Douwe Maan d3462e711c Fix issue with impersonation 2016-04-22 23:21:56 +02:00
Rémy Coutable 5a8873f362 Merge branch 'rs-diff_view' into 'master'
Always read diff_view setting from the cookie

Prior, when the user had their view set to "parallel" and then visited a
merge request's changes tab _without_ passing the `view` parameter via
query string, the view would be parallel but the `Notes` class was
always instantiated with the default value from `diff_view` ("inline"),
resulting in broken markup when the form to add a line note was
dynamically inserted.

The cookie is set whenever the view is changed, so this value should
always be up-to-date.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/14557 and https://gitlab.com/gitlab-org/gitlab-ce/issues/15285

See merge request !3732
2016-04-22 07:49:46 +00:00
Rémy Coutable 338f6f0902 Merge branch 'issue_5838' into 'master'
Show project members only for members

fixes #5838 

See merge request !3752
2016-04-21 10:31:20 +00:00
Felipe Artur 9581aba4d4 Add changelog entry and fix convention in a spec 2016-04-20 12:41:35 -03:00
Robert Speicher 8530ce4c6f Clarify that the diff view setting always comes from the cookie
This invalidates one test, which we've removed.
2016-04-19 17:47:58 -04:00
Douwe Maan 55380e69fc Merge branch 'pmq20/gitlab-ce-issue_12785' 2016-04-19 18:25:42 +02:00
Grzegorz Bizon f2e3868124 Check permissions when sharing project with group
Closes #15330
2016-04-19 12:15:56 +02:00
Felipe Artur 0b91ff287d Projects members tab should follow visibility levels 2016-04-18 17:53:34 -03:00