summaryrefslogtreecommitdiff
path: root/app/models/note.rb
Commit message (Collapse)AuthorAgeFilesLines
* Create an event on epic actionsJan Provaznik2019-09-031-0/+1
| | | | | Creates new event when an epic is created, closed, reopened or commented.
* Merge branch 'remove-ignorable-column-concern' into 'master'Michael Kozono2019-08-301-2/+1
|\ | | | | | | | | | | | | Remove dependency on IgnorableColumn concern Closes #66746 See merge request gitlab-org/gitlab-ce!32427
| * Use self.ignored_columns += instead of =Stan Hu2019-08-301-1/+1
| | | | | | | | This is to accomodate prepended modules.
| * Remove dependency on IgnorableColumn concerndineshpanda2019-08-301-2/+1
| |
* | Merge branch 'security-epic-notes-api-reveals-historical-info-ce-master' ↵GitLab Release Tools Bot2019-08-291-0/+4
|\ \ | | | | | | | | | | | | | | | | | | into 'master' Filter out old system notes for epics in notes api endpoint response See merge request gitlab/gitlabhq!3224
| * | Filter out old system notes for epicsPatrick Derichs2019-08-281-0/+4
| |/
* | Limit the size of issuable description and commentsAlexandru Croitor2019-08-221-0/+1
|/ | | | | | | | | | | | | Limiting the size of issuable description and comments to 1_000_000, which is close to ~1MB of ASCII characters, which represents 99.9% of all descriptions and comments we have in DB at the moment. This should help prevent DoS attacks when comments contain refference strings. Also this change updates regexp matching the namespaces paths by limiting the namespaces paths to Namespace::NUMBER_OF_ANCESTORS_ALLOWED, as we allow 20 levels deep groups. see https://gitlab.com/gitlab-org/gitlab-ce/issues/61974#note_191274234
* Fix first-time contributor notes not renderingsh-fix-special-role-error-500Stan Hu2019-07-311-0/+4
| | | | | | | | | https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/31117 enabled the HashInefficientHash Rubocop rule that was fooled by the special implementation of `SpecialRole`. We fix this by introducing a `value?` method and adding unit tests. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/65383
* Enable Rubocop Performance/InefficientHashSearchsh-enable-rubocop-hash-searchStan Hu2019-07-241-1/+1
| | | | | | | | | When used with a Hash, `.keys.include?` is bad because: 1. It performs a O(n) search instead of the efficient `.has_key?` 2. It clones all keys into separate array. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/64975
* GraphQL support for Notes created in discussions62826-graphql-note-mutationsLuke Duncalfe2019-07-101-0/+2
| | | | | | | | | | | | A new `discussion_id` argument on the `createNote` mutation allows people to create a note within that discussion. The ability to lazy-load Discussions has been added, so GraphQL.object_from_id can treat Discussions the same as AR objects and batch load them. https://gitlab.com/gitlab-org/gitlab-ce/issues/62826 https://gitlab.com/gitlab-org/gitlab-ee/issues/9489
* Fix typo in code comments about ElasticsearchTakuya Noguchi2019-06-281-1/+1
| | | | Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
* Do not rewrite relative links for system notesbug/63162-duplicate_path_in_linksMario de la Ossa2019-06-201-1/+1
|
* Expose comments on Noteables in GraphQLBob Van Landuyt2019-06-141-1/+1
| | | | | | | | | This exposes `Note`s on Issues & MergeRequests using a `Types::Notes::NoteableType` in GraphQL. Exposing notes on a new type can be done by implementing the `NoteableType` interface on the type. The presented object should be a `Noteable`.
* Inherit from ApplicationRecord instead of ActiveRecord::BaseNick Thomas2019-03-281-1/+1
|
* Hide "Edited" when note is transformed or resolvedHeinrich Lee Yu2019-03-141-0/+8
| | | | Makes `Note#edited?` return `false` when the note body was not edited
* Use parent instead of projectJarka Košanová2019-01-081-0/+4
| | | | Add support for group entities to quick actions
* Allow suggesting single line changes in diffsOswaldo Ferreira2018-12-131-1/+11
|
* Reduce N+1 from Activity Dashboard and BanzaiGabriel Mazetto2018-12-101-1/+1
| | | | | | | | There is a combination of few strategies implemented here: 1. Few relations were eager loaded 2. Changed few polymorphic routes to specific ones so we don't have to use `#becomes(Namespace)` which doesn't preserve association cache
* Merge branch 'security-guest-comments' into 'master'Cindy Pallares2018-11-281-1/+1
| | | | | [master]Fixed ability to comment on and edit/delete comments on locked or confidential issues See merge request gitlab/gitlabhq!2612
* Add 'only history' option to notes filterFelipe Artur2018-11-051-0/+2
|
* Merge branch 'security-redact-links' into 'master'Jan Provaznik2018-10-291-0/+3
|\ | | | | | | | | [master] Redact unsubscribe links in issuable texts See merge request gitlab/gitlabhq!2528
| * Redact unsubscribe links in issuable textsJan Provaznik2018-10-231-0/+3
| | | | | | | | | | | | | | It's possible that user pastes accidentally also unsubscribe link which is included in footer of notification emails. This unsubscribe link contains personal token which attacker then use to act as the original user (e.g. for sending comments under his/her identity).
* | Resolve "Filter discussion (tab) by comments or activity in issues and merge ↵Oswaldo Ferreira2018-10-231-0/+9
|/ | | | requests"
* Fix comments in app/models/note.rbStan Hu2018-10-061-3/+3
| | | | | This resolves a conflict and inconsistency with the EE version of app/models/note.rb.
* Filter system notes with public and private cross referencesBrett Walker2018-10-021-12/+15
|
* Added FromUnion to easily select from a UNIONYorick Peterse2018-09-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds the module `FromUnion`, which provides the class method `from_union`. This simplifies the process of selecting data from the result of a UNION, and reduces the likelihood of making mistakes. As a result, instead of this: union = Gitlab::SQL::Union.new([foo, bar]) Foo.from("(#{union.to_sql}) #{Foo.table_name}") We can now write this instead: Foo.from_union([foo, bar]) This commit also includes some changes to make this new setup work properly. For example, a bug in Rails 4 (https://github.com/rails/rails/issues/24193) would break the use of `from("sub-query-here").includes(:relation)` in certain cases. There was also a CI query which appeared to repeat a lot of conditions from an outer query on an inner query, which isn't necessary. Finally, we include a RuboCop cop to ensure developers use this new module, instead of using Gitlab::SQL::Union directly. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/51307
* Disable existing offenses for the CodeReuse copsYorick Peterse2018-09-111-0/+2
| | | | | This whitelists all existing offenses for the various CodeReuse cops, of which most are triggered by the CodeReuse/ActiveRecord cop.
* Use ResourceLabelEvent for tracking label changesJan Provaznik2018-09-071-12/+1
|
* Merge branch 'group-todos' into 'master'Sean McGivern2018-08-071-0/+4
|\ | | | | | | | | Group todos See merge request gitlab-org/gitlab-ce!20675
| * Revert "Revert "Merge branch 'ee-5481-epic-todos' into 'master'""Jarka Kadlecová2018-08-021-0/+4
| | | | | | | | This reverts commit 8717c7dad9b5a8fa21ec9a652c54718a6b4c2175.
* | Merge branch 'frozen-string-enable-app-models' into 'master'Rémy Coutable2018-08-021-0/+2
|\ \ | |/ |/| | | | | Enable frozen string in app/models/*.rb See merge request gitlab-org/gitlab-ce!20851
| * Enable frozen string in app/models/*.rbrepo-forks/gitlab-ce-frozen-string-enable-app-modelsgfyoung2018-07-261-0/+2
| | | | | | | | Partially addresses #47424.
* | Show the status of a user in interactionsBob Van Landuyt2018-07-301-1/+1
|/ | | | | | | | | | | | | | | The status is shown for - The author of a commit when viewing a commit - Notes on a commit (regular/diff) - The user that triggered a pipeline when viewing a pipeline - The author of a merge request when viewing a merge request - The author of notes on a merge request (regular/diff) - The author of an issue when viewing an issue - The author of notes on an issue - The author of a snippet when viewing a snippet - The author of notes on a snippet - A user's profile page - The list of members of a group/user
* Merge branch 'satishperala/gitlab-ce-20720_webhooks_full_image_url' into ↵Douwe Maan2018-07-171-1/+1
|\ | | | | | | | | | | | | | | | | 'master' Include full image URL in webhooks for uploaded images Closes #20720 See merge request gitlab-org/gitlab-ce!18109
| * Merge branch 'master' into satishperala/gitlab-ce-20720_webhooks_full_image_urlSean McGivern2018-07-061-0/+5
| |\
| * | Add base class for hook builders, and use it for notes and wikisSean McGivern2018-06-201-3/+1
| | |
| * | Passing absolute image urls in the markdown content in the webhooksSatish Perala2018-06-201-1/+3
| | |
* | | Revert "Merge branch 'ee-5481-epic-todos' into 'master'"Jarka Kadlecová2018-07-111-4/+0
| |/ |/| | | | | | | This reverts commit 4d9a3f42f1fd3be21555e19872b7121cca65015e, reversing changes made to ecf9c145f6e4d170cd059df88743393d9e63c489.
* | Use for_issuable? instead of for_issuable_with_ability?Jarka Kadlecová2018-07-031-1/+1
| |
* | [backend] Addressed review commentsJan Provaznik2018-07-031-0/+4
| | | | | | | | | | | | | | * Group filtering now includes also issues/MRs from subgroups/subprojects * fixed due_date * Also DRYed todo controller specs
* | Changes tab VUE refactoringFelipe Artur2018-06-211-0/+1
|/
* Fix an N+1 in avatar URLsSean McGivern2018-06-051-0/+4
| | | | | | | | | | | | | | | | This is tricky: the query was being run in `ObjectStorage::Extension::RecordsUploads#retrieve_from_store!`, but we can't just add batch loading there, because the `#upload=` method there would use the result immediately, making the batch only have one item. Instead, we can pre-emptively add an item to the batch whenever an avatarable object is initialized, and then reuse that batch item in `#retrieve_from_store!`. However, this also has problems: 1. There is a lot of logic in `Avatarable#retrieve_upload_from_batch`. 2. Some of that logic constructs a 'fake' model for the batch key. This should be fine, because of ActiveRecord's override of `#==`, but it relies on that staying the same.
* Persist truncated note diffs on a new table45190-create-notes-diff-filesOswaldo Ferreira2018-05-241-1/+3
| | | | | We request Gitaly in a N+1 manner to build discussion diffs. Once the diffs are from different revisions, it's hard to make a single request to the service in order to build the whole response. With this change we solve this problem and simplify a lot fetching this piece of info.
* Backport 5480-epic-notifications from EEMario de la Ossa2018-05-071-4/+0
|
* Merge branch 'jprovazn-comment-refs' into 'master'Sean McGivern2018-04-051-0/+4
|\ | | | | | | | | Better group support in notes-related code See merge request gitlab-org/gitlab-ce!18150
| * Better group support notes-related codeJan Provaznik2018-04-051-0/+4
| | | | | | | | | | | | | | Updates notes-related services and rendering so this code can be easily used for group-scoped resources (specifically Epics). Related to gitlab-ee!5205
* | Merge branch 'jej/mattermost-notification-confidentiality-10-6' into ↵Douwe Maan2018-04-051-0/+4
|/ | | | | | | | | | 'security-10-6' [10.6] Prevent notes on confidential issues from being sent to chat See merge request gitlab/gitlabhq!2366 # Conflicts: # app/helpers/services_helper.rb
* Refactor discussions/notes codeJan Provaznik2018-04-031-2/+5
|
* Add discussion APIjprovazn-apiJan Provaznik2018-03-071-2/+7
| | | | | * adds basic discussions API for issues and snippets * reorganizes notes specs (so same tests can be used for all noteable types - issues, MRs, snippets)
* Render MR Notes with Vue with behind a cookieFatih Acet2018-02-281-0/+1
|