summaryrefslogtreecommitdiff
path: root/spec/controllers
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'new-diff-notes' into 'master' Douwe Maan2016-07-071-4/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Add send_git_patch helperDouwe Maan2016-07-061-1/+1
| |
| * Rename MergeRequest methods that return commits or shas to be more clear and ↵Douwe Maan2016-07-061-3/+3
| | | | | | | | consistent
* | Layout for Users Groups and Projects on admin areaAlfredo Sumaran2016-07-071-2/+2
|/
* Assert against `ActionMailer::Base.deliveries` relatively.Timothy Andrew2016-07-051-2/+1
| | | | | | | | - 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.
* Merge branch 'explicit-requesters-scope' into 'master' Douwe Maan2016-07-012-6/+6
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Exclude requesters from Project#members, Group#members and User#membersexplicit-requesters-scopeRémy Coutable2016-07-012-6/+6
| | | | | | | | | | | | And create new Project#requesters, Group#requesters scopes. Signed-off-by: Rémy Coutable <remy@rymai.me>
* | Enable Style/EmptyLines cop, remove redundant onesrubocop/enable-cops-for-empty-linesGrzegorz Bizon2016-07-0110-15/+0
|/
* Import from Github using Personal Access Tokens.Eric K Idema2016-06-301-0/+43
| | | | | | | | | | | | | 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.
* Merge branch 'master' into issue_3359_3issue_3359_3Felipe Artur2016-06-2929-146/+186
|\
| * Merge branch 'zj-workhorse-format-patch' into 'master' Robert Speicher2016-06-291-15/+3
| |\ | | | | | | | | | | | | Workhorse to serve email diffs See merge request !4590
| | * Workhorse to serve email diffsZ.J. van de Weg2016-06-281-15/+3
| | | | | | | | | | | | Depends on the changes in Workhorse (gitlab-org/gitlab-workhorse!48).
| * | Use HTTP matchers if possibleZ.J. van de Weg2016-06-2728-131/+131
| |/
| * Merge branch 'issue_19096' into 'master' Stan Hu2016-06-251-0/+40
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | * Validate presence of essential params for diff renderingissue_19096Ruben Davila2016-06-241-0/+40
| | | | | | | | | | | | | | | This will avoid application errors generated by the assumption of the presence of these params.
| * | Fix a wrong MR status when merge_when_build_succeeds & ↵19035-fix-merge-issueRémy Coutable2016-06-241-0/+12
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | merge master into issue_3359_3Felipe Artur2016-06-291-6/+6
|\ \
| * | Insert notification settings dropdown into groupsFelipe Artur2016-06-221-14/+55
| | |
* | | merge master into issue_3359_3Felipe Artur2016-06-229-21/+675
|\ \ \ | | |/ | |/|
| * | Merge branch ↵Douwe Maan2016-06-222-10/+4
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | '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
| | * | Fix and remove duplicate specs18755-fix-destroy-project-causes-post_decline_request-to-be-executedRémy Coutable2016-06-202-8/+2
| | | | | | | | | | | | | | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
| | * | Redirect to the member's source on request withdrawalRémy Coutable2016-06-182-2/+2
| | | | | | | | | | | | | | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
| * | | Fixed issue with returning ref in commits JSONasync-refs-dropdownPhil Hughes2016-06-201-0/+20
| |/ / | | | | | | | | | Added tests to project controller
| * | Merge branch 'issue_12758' into 'master' Douwe Maan2016-06-173-84/+125
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | * \ Merge master into issue_12758issue_12758Felipe Artur2016-06-171-0/+71
| | |\ \
| | * \ \ Re-use notifications dropdown/modal for user profileFelipe Artur2016-06-173-103/+125
| | |\ \ \ | | | | |/ | | | |/|
| | * | | Implement custom notification level optionsFelipe Artur2016-06-151-0/+19
| | | | |
| * | | | Merge branch 'issuable-todo-improvements'Douwe Maan2016-06-181-0/+102
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | # Conflicts: # app/controllers/projects/todos_controller.rb
| | * | | | Removed update methodissuable-todo-improvementsPhil Hughes2016-06-171-86/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Re-structured controller spec Renamed issuable param to issuable_id
| | * | | | Added todo controller tests for merge requestsPhil Hughes2016-06-171-37/+90
| | | | | |
| | * | | | Correctly checks if user is logged in when adding todoPhil Hughes2016-06-171-0/+13
| | | | | |
| | * | | | Improved manual todosPhil Hughes2016-06-171-0/+42
| | |/ / / | | | | | | | | | | | | | | | Based on feedback from !4502
| * | | | Merge branch 'disable-saml-account-unlink' into 'master' Robert Speicher2016-06-171-0/+26
| |\ \ \ \ | | |_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | * | | Added CHANGELOG item and fixed Rubocop errorsdisable-saml-account-unlinkPatricio Cano2016-06-141-4/+2
| | | | |
| | * | | Disable the unlink feature for SAML connected accounts (social login).Patricio Cano2016-06-141-0/+28
| | | | |
| * | | | Merge remote-tracking branch 'origin/master' into 2979-personal-access-tokensTimothy Andrew2016-06-165-21/+462
| |\ \ \ \ | | | |/ / | | |/| |
| | * | | Merge branch 'stanhu/gitlab-ce-fix-error-500-false-binary-negative'Douwe Maan2016-06-152-0/+17
| | |\ \ \ | | | |/ / | | |/| |
| | | * | Fix Error 500 when viewing a blob with binary characters after the 1024-byte ↵Stan Hu2016-06-122-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | * | | UI and copywriting improvements13948-access-request-to-projects-and-groupsRémy Coutable2016-06-142-27/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + 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>
| | * | | Factorize #request_access and #approve_access_request into a new ↵Rémy Coutable2016-06-142-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AccessRequestActions controller concern Signed-off-by: Rémy Coutable <remy@rymai.me>
| | * | | Add request access for groupsRémy Coutable2016-06-142-20/+427
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
| | * | | Project members with guest role can't access confidential issuesDouglas Barbosa Alexandre2016-06-131-1/+18
| | |/ /
| * | | Merge remote-tracking branch 'origin/master' into 2979-personal-access-tokensTimothy Andrew2016-06-143-3/+6
| |\ \ \ | | |/ /
| * | | Merge remote-tracking branch 'origin/master' into 2979-personal-access-tokensTimothy Andrew2016-06-107-39/+0
| |\ \ \
| * \ \ \ Merge remote-tracking branch 'origin/master' into 2979-personal-access-tokensTimothy Andrew2016-06-099-24/+261
| |\ \ \ \
| * | | | | Fix rubocop spec.Timothy Andrew2016-06-031-4/+4
| | | | | |
| * | | | | Merge remote-tracking branch 'origin/master' into 2979-personal-access-tokensTimothy Andrew2016-06-0314-13/+329
| |\ \ \ \ \
| * | | | | | Parts of spec names with "when" should be contexts.Timothy Andrew2016-06-031-18/+27
| | | | | | |
| * | | | | | Perform private token and personal access token authentication in the same ↵Timothy Andrew2016-06-011-45/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `before_action`. - So that the check for valid personal access tokens happens only if private token auth fails.
| * | | | | | Reuse the private token param and header for personal access tokens.Timothy Andrew2016-05-111-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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