summaryrefslogtreecommitdiff
path: root/app/controllers/projects/notes_controller.rb
Commit message (Collapse)AuthorAgeFilesLines
* Clean up `notes_controller`blackst0ne2018-05-141-13/+0
|
* Merge request and commit discussions APIJan Provaznik2018-05-011-3/+1
|
* Support Markdown rendering using multiple projectsrendering-markdown-multiple-projectsYorick Peterse2018-04-111-1/+1
| | | | | | | | | | | | | | | | | | | This refactors the Markdown pipeline so it supports the rendering of multiple documents that may belong to different projects. An example of where this happens is when displaying the event feed of a group. In this case we retrieve events for all projects in the group. Previously we would group events per project and render these chunks separately, but this would result in many SQL queries being executed. By extending the Markdown pipeline to support this out of the box we can drastically reduce the number of SQL queries. To achieve this we introduce a new object to the pipeline: Banzai::RenderContext. This object simply wraps two other objects: an optional Project instance, and an optional User instance. On its own this wouldn't be very helpful, but a RenderContext can also be used to associate HTML documents with specific Project instances. This work is done in Banzai::ObjectRenderer and allows us to reuse as many queries (and results) as possible.
* Render MR Notes with Vue with behind a cookieFatih Acet2018-02-281-7/+23
|
* Track and act upon the number of executed queriesquery-countsYorick Peterse2018-02-011-0/+5
| | | | | | | | | | | This ensures that we have more visibility in the number of SQL queries that are executed in web requests. The current threshold is hardcoded to 100 as we will rarely (maybe once or twice) change it. In production and development we use Sentry if enabled, in the test environment we raise an error. This feature is also only enabled in production/staging when running on GitLab.com as it's not very useful to other users.
* Replace factory_girl_rails with factory_bot_railsrc/use-factory_bot_railsRémy Coutable2017-12-141-1/+1
| | | | | | | | | | | I've followed the [upgrade guide](https://github.com/thoughtbot/factory_bot/blob/4-9-0-stable/UPGRADE_FROM_FACTORY_GIRL.md) and ran these two commands: ``` grep -e FactoryGirl **/*.rake **/*.rb -s -l | xargs sed -i "" "s|FactoryGirl|FactoryBot|" grep -e factory_girl **/*.rake **/*.rb -s -l | xargs sed -i "" "s|factory_girl|factory_bot|" ``` Signed-off-by: Rémy Coutable <remy@rymai.me>
* Adds Rubocop rule for line break after guard clauseJacopo2017-11-161-0/+1
| | | | Adds a rubocop rule (with autocorrect) to ensure line break after guard clauses.
* Create system notes for MR too, improve doc + clean up codeJarka Kadlecova2017-09-141-6/+1
|
* Check the discussion lock only for issuables & clean styleJarka Kadlecova2017-09-141-1/+1
|
* Support discussion locking in the backendJarka Kadlecova2017-09-141-0/+14
|
* Support comments for personal snippetsJarka Kadlecova2017-05-051-44/+0
|
* Display comments for personal snippets12910-personal-snippets-notes-showJarka Kadlecova2017-05-021-125/+14
|
* Remove unused codeDouwe Maan2017-04-051-2/+1
|
* Address review commentsDouwe Maan2017-04-051-1/+1
|
* Correctly display multiple separate discussions on the same diff lineDouwe Maan2017-04-051-3/+3
|
* Don't use original_discussion_idDouwe Maan2017-04-051-6/+1
|
* Add specsDouwe Maan2017-04-051-7/+7
|
* Fix some specsDouwe Maan2017-04-051-0/+2
|
* Add option to start a new discussion on an MRDouwe Maan2017-04-051-38/+48
|
* Remove query parameters from notes polling endpoint to make caching easierAdam Niedzielski2017-03-011-1/+6
|
* add /award slash commandmhasbini2017-02-281-9/+2
| | | | add /award slash command; Allow posting of just an emoji in comment
* Fix inconsistent naming for services that delete thingsdixpac2017-02-081-1/+1
| | | | | | * Changed name of delete_user_service and worker to destroy * Move and change delete_group_service to Groups::DestroyService * Rename Notes::DeleteService to Notes::DestroyService
* support `/merge` slash comand for MRsJarka Kadlecova2017-01-111-1/+2
|
* Merge branch 'jej-note-search-uses-finder' into 'security' Douwe Maan2016-12-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix missing Note access checks in by moving Note#search to updated NoteFinder Split from !2024 to partially solve https://gitlab.com/gitlab-org/gitlab-ce/issues/23867 ## Which fixes are in this MR? :warning: - Potentially untested :bomb: - No test coverage :traffic_light: - Test coverage of some sort exists (a test failed when error raised) :vertical_traffic_light: - Test coverage of return value (a test failed when nil used) :white_check_mark: - Permissions check tested ### Note lookup without access check - [x] :white_check_mark: app/finders/notes_finder.rb:13 :download_code check - [x] :white_check_mark: app/finders/notes_finder.rb:19 `SnippetsFinder` - [x] :white_check_mark: app/models/note.rb:121 [`Issue#visible_to_user`] - [x] :white_check_mark: lib/gitlab/project_search_results.rb:113 - This is the only use of `app/models/note.rb:121` above, but importantly has no access checks at all. This means it leaks MR comments and snippets when those features are `team-only` in addition to the issue comments which would be fixed by `app/models/note.rb:121`. - It is only called from SearchController where `can?(current_user, :download_code, @project)` is checked, so commit comments are not leaked. ### Previous discussions - [x] https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/2024/diffs#b915c5267a63628b0bafd23d37792ae73ceae272_13_13 `: download_code` check on commit - [x] https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/2024/diffs#b915c5267a63628b0bafd23d37792ae73ceae272_19_19 `SnippetsFinder` should be used - `SnippetsFinder` should check if the snippets feature is enabled -> https://gitlab.com/gitlab-org/gitlab-ce/issues/25223 ### Acceptance criteria met? - [x] Tests added for new code - [x] TODO comments removed - [x] Squashed and removed skipped tests - [x] Changelog entry - [ ] State Gitlab versions affected and issue severity in description - [ ] Create technical debt issue for NotesFinder. - Either split into `NotesFinder::ForTarget` and `NotesFinder::Search` or consider object per notable type such as `NotesFinder::OnIssue`. For the first option could create `NotesFinder::Base` which is either inherited from or which can be included in the other two. - Avoid case statement anti-pattern in this finder with use of `NotesFinder::OnCommit` etc. Consider something on the finder for this? `Model.finder(user, project)` - Move `inc_author` to the controller, and implement `related_notes` to replace `non_diff_notes`/`mr_and_commit_notes` See merge request !2035
* Backport Note#commands_changes from EEbackport-commands-paramsDouwe Maan2016-11-241-0/+1
|
* Backport some changes done from Time Tracking feature in EE.ee-870-backportRuben Davila2016-11-181-12/+13
|
* Merge branch 'diff-line-comment-vuejs' into 'master' Douwe Maan2016-08-191-1/+33
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Diff line comments resolve ## What does this MR do? Diff line comments can be resolved. Part of #10325 To do: - [x] Backend (@DouweM) - [x] Fix https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5022#note_13319326. Will be made easier by https://gitlab.com/gitlab-org/gitlab-ce/issues/17237#note_13370331 - [x] System note when all discussions are resolved - [x] Notification when all discussions are resolved - [x] Write unit tests - [x] Look at resolve time https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5022#note_13912743 - Fixed by 4a13aa9 - [x] Frontend (@iamphill) - [x] Fix bugs - [x] Write more feature tests - [x] Frontend (@connorshea) - [x] Address frontend feedback - [x] Feature specs for Jump feature - [x] Documentation - [x] Add Vue.js in a standard way See merge request !5022
| * Address review feedbackDouwe Maan2016-08-161-2/+2
| |
| * Add specs for NotesController and DiscussionsControllerDouwe Maan2016-08-121-1/+1
| |
| * Actually don't send resolved notifications when deleting a noteDouwe Maan2016-08-041-0/+2
| |
| * Don't send resolved notifications when deleting a noteDouwe Maan2016-07-281-2/+0
| |
| * Add 'Resolved all discussions' system noteDouwe Maan2016-07-281-0/+2
| |
| * Backend tweaksDouwe Maan2016-07-281-5/+5
| |
| * Updates the text above discussions when resolving notes & discussionsPhil Hughes2016-07-271-2/+9
| |
| * Added resolved by users name into tooltipPhil Hughes2016-07-261-1/+3
| |
| * Add endpoints to resolve diff notes and discussionsDouwe Maan2016-07-251-3/+14
| |
| * Assigns to variable rather than using VueJS methodPhil Hughes2016-07-241-2/+2
| |
| * Resolve all endpointPhil Hughes2016-07-241-0/+5
| |
| * Posts to rails to update note eventuallyPhil Hughes2016-07-241-0/+5
| |
* | Support slash commands in noteable description and notesRémy Coutable2016-08-131-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | Some important things to note: - commands are removed from noteable.description / note.note - commands are translated to params so that they are treated as normal params in noteable Creation services - the logic is not in the models but in the Creation services, which is the right place for advanced logic that has nothing to do with what models should be responsible of! - UI/JS needs to be updated to handle notes which consist of commands only - the `/merge` command is not handled yet Other improvements: - Don't process commands in commit notes and display a flash is note is only commands - Add autocomplete for slash commands - Add description and params to slash command DSL methods - Ensure replying by email with a commands-only note works - Use :subscription_event instead of calling noteable.subscribe - Support :todo_event in IssuableBaseService Signed-off-by: Rémy Coutable <remy@rymai.me>
* Add Discussion model to represent MR/diff discussiondiscussion-modelDouwe Maan2016-07-201-29/+36
|
* Display new diff notes and allow creation through the web interfaceDouwe Maan2016-07-061-2/+19
|
* Support for rendering/redacting multiple documentsYorick Peterse2016-06-241-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | This commit changes the way certain documents are rendered (currently only Notes) and how documents are redacted. Previously both rendering and redacting would run on a per document basis. The result of this was that for every document we'd have to run countless queries just to figure out if we could display a set of links or not. This commit changes things around so that redacting Markdown documents is no longer tied into the html-pipeline Gem. This in turn allows it to redact multiple documents in a single pass, thus reducing the number of queries needed. In turn rendering issue/merge request notes has been adjusted to take advantage of this new setup. Instead of rendering Markdown somewhere deep down in a view the Markdown is rendered and redacted in the controller (taking the current user and all that into account). This has been done in such a way that the "markdown()" helper method can still be used on its own. This particular commit also paves the way for caching rendered HTML on object level. Right now there's an accessor method Note#note_html which is used for setting/getting the rendered HTML. Once we cache HTML on row level we can simply change this field to be a column and call a "save" whenever needed and we're pretty much done.
* Backend awardables on commentsZJ van de Weg2016-06-061-0/+3
|
* Merge branch 'awardables' of gitlab.com:gitlab-org/gitlab-ce into awardablesFatih Acet2016-05-181-4/+9
|\
| * Fix latests concernsZJ van de Weg2016-05-181-4/+9
| |
* | Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into awardablesFatih Acet2016-05-181-5/+5
|\ \ | |/ |/| | | | | | | | | | | # Conflicts: # app/controllers/projects/merge_requests_controller.rb # app/models/note.rb # db/schema.rb # spec/models/note_spec.rb
| * Merge branch 'meinac/gitlab-ce-change_deprecated_render_usage'Dmitriy Zaporozhets2016-05-181-2/+2
| |\ | | | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
| | * Change deprecated usage of rendering without response bodyMehmet Emin İNAÇ2016-03-161-2/+2
| | | | | | | | | | | | | | | `render nothing: true` has been deprecated. For more information see [pr](https://github.com/rails/rails/pull/20336)
| * | Extract LegacyDiffNote out of NoteDouwe Maan2016-05-131-3/+3
| | |