Commit Graph

171 Commits

Author SHA1 Message Date
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
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
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
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
Paco Guzman 244134f9c3 Cache todos pending/done dashboard query counts 2016-07-12 18:57:52 +02: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
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
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
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
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
Phil Hughes 914f973108 Removed update method
Re-structured controller spec
Renamed issuable param to issuable_id
2016-06-17 18:31:37 +01: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
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
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
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 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