Commit Graph

481 Commits

Author SHA1 Message Date
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
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