Commit Graph

259 Commits

Author SHA1 Message Date
GitLab Bot 7e964f54ed Add latest changes from gitlab-org/gitlab@master 2022-04-05 12:10:23 +00:00
GitLab Bot a40d39ddd2 Add latest changes from gitlab-org/gitlab@master 2022-02-26 00:14:54 +00:00
GitLab Bot ec377e4162 Add latest changes from gitlab-org/gitlab@master 2022-02-11 15:14:00 +00:00
GitLab Bot 2b2d833ab3 Add latest changes from gitlab-org/gitlab@master 2022-01-25 18:11:55 +00:00
GitLab Bot 16f41a5b04 Add latest changes from gitlab-org/gitlab@master 2021-11-03 21:10:35 +00:00
GitLab Bot 1f7ce4357d Add latest changes from gitlab-org/gitlab@master 2021-09-27 03:11:36 +00:00
GitLab Bot e2f984e14e Add latest changes from gitlab-org/gitlab@master 2021-09-08 12:12:01 +00:00
GitLab Bot b46d41d54b Add latest changes from gitlab-org/gitlab@master 2021-08-31 09:08:57 +00:00
GitLab Bot a56971e97f Add latest changes from gitlab-org/gitlab@master 2021-08-26 18:10:35 +00:00
GitLab Bot f4d51a9f71 Add latest changes from gitlab-org/gitlab@master 2021-07-29 15:09:48 +00:00
GitLab Bot d950ea420a Add latest changes from gitlab-org/gitlab@master 2021-07-23 06:08:47 +00:00
GitLab Bot be8b477154 Add latest changes from gitlab-org/gitlab@master 2021-06-29 03:07:32 +00:00
GitLab Bot 294a256ae3 Add latest changes from gitlab-org/gitlab@master 2021-05-26 00:11:07 +00:00
GitLab Bot 998adcc422 Add latest changes from gitlab-org/gitlab@master 2021-05-04 12:10:04 +00:00
GitLab Bot 9724bdc4c0 Add latest changes from gitlab-org/gitlab@master 2021-04-07 03:09:01 +00:00
GitLab Bot dfda8b7e77 Add latest changes from gitlab-org/gitlab@master 2021-03-18 15:09:04 +00:00
GitLab Bot 6f2b1c32f3 Add latest changes from gitlab-org/gitlab@master 2021-03-09 15:08:59 +00:00
GitLab Bot 49d26b2348 Add latest changes from gitlab-org/gitlab@master 2021-02-12 12:09:02 +00:00
GitLab Bot 3bc30c280c Add latest changes from gitlab-org/gitlab@master 2021-02-08 15:09:38 +00:00
GitLab Bot 9b09561f47 Add latest changes from gitlab-org/gitlab@master 2020-12-09 18:09:48 +00:00
GitLab Bot 6de7d2c195 Add latest changes from gitlab-org/gitlab@master 2020-09-16 15:09:32 +00:00
GitLab Bot 592223823c Add latest changes from gitlab-org/gitlab@master 2020-09-03 18:08:29 +00:00
GitLab Bot c4b69460e8 Add latest changes from gitlab-org/gitlab@master 2020-08-28 09:10:32 +00:00
GitLab Bot 654daa2ccb Add latest changes from gitlab-org/gitlab@master 2020-08-14 15:10:05 +00:00
GitLab Bot bdca097916 Add latest changes from gitlab-org/gitlab@master 2020-08-11 03:11:00 +00:00
GitLab Bot c59765a50a Add latest changes from gitlab-org/gitlab@master 2020-06-24 18:09:03 +00:00
GitLab Bot 3ef9553486 Add latest changes from gitlab-org/gitlab@master 2020-06-12 12:08:56 +00:00
GitLab Bot 7892ed2e23 Add latest changes from gitlab-org/gitlab@master 2020-05-27 09:08:30 +00:00
GitLab Bot 5c763ac4c6 Add latest changes from gitlab-org/gitlab@master 2020-05-27 06:08:13 +00:00
GitLab Bot 6ee98e1273 Add latest changes from gitlab-org/gitlab@master 2020-05-26 18:08:20 +00:00
GitLab Bot 4a3ba3e5f2 Add latest changes from gitlab-org/gitlab@master 2020-05-22 09:08:09 +00:00
GitLab Bot e689e858ed Add latest changes from gitlab-org/gitlab@master 2020-05-13 18:08:47 +00:00
GitLab Bot 2fa68d3a97 Add latest changes from gitlab-org/gitlab@master 2020-05-04 06:10:10 +00:00
GitLab Bot d43aaf286f Add latest changes from gitlab-org/gitlab@master 2020-03-17 00:09:12 +00:00
GitLab Bot 07d0374b20 Add latest changes from gitlab-org/gitlab@master 2020-02-24 03:09:05 +00:00
GitLab Bot c8f773a859 Add latest changes from gitlab-org/gitlab@master 2020-01-30 21:08:47 +00:00
GitLab Bot 5ad0cf2655 Add latest changes from gitlab-org/gitlab@master 2020-01-23 12:08:38 +00:00
GitLab Bot 7cdd70dcec Add latest changes from gitlab-org/gitlab@master 2019-11-28 15:06:57 +00:00
GitLab Release Tools Bot 17bf8a8f9d Merge branch 'security-filter-related-branches-from-activity-feed' into 'master'
Related Branches Visible to Guests in Issue Activity

See merge request gitlab/gitlabhq!3537
2019-11-26 17:02:28 +00:00
GitLab Bot a048261403 Add latest changes from gitlab-org/gitlab@master 2019-11-21 09:06:16 +00:00
Kerri Miller 527723c37b Restrict branches visible to guests in Issue feed
Notes related to branch creation should not be shown in an issue's
activity feed when the user doesn't have access to :download_code.
2019-11-20 06:58:47 -08:00
GitLab Release Tools Bot c7ee6535d4 Merge branch 'security-2920-fix-notes-with-label-cross-reference' into 'master'
Project path reveals labels from Private project if the issue is moved to public project

See merge request gitlab/gitlabhq!3419
2019-10-29 15:58:21 +00:00
Eugenia Grieff 4d8ed01bdc Add specs to cover label and milestone notes 2019-10-24 11:18:46 +01:00
Dylan Griffith 0df265b660 Change Note#to_ability_name to 'note'
This is to be more consistent as there is already a :read_note policy in
NotePolicy. To keep other behaviour the same we've introduced a
Note#noteable_ability_name that is used anywhere this was expected.
2019-10-23 11:29:13 +11:00
GitLab Bot 25989ab7ef Add latest changes from gitlab-org/gitlab@master 2019-10-18 11:11:44 +00:00
GitLab Bot 6b75320f52 Add latest changes from gitlab-org/gitlab@master 2019-10-17 12:07:33 +00:00
GitLab Bot 00c78fb814 Add latest changes from gitlab-org/gitlab@master 2019-10-16 15:06:17 +00:00
GitLab Bot ac062237da Add latest changes from gitlab-org/gitlab@master 2019-10-11 21:05:59 +00:00
GitLab Bot 80f61b4035 Add latest changes from gitlab-org/gitlab@master 2019-09-18 14:02:45 +00:00
Alexandru Croitor 5af535d919 Limit the size of issuable description and comments
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
2019-08-22 10:43:13 +03:00
Stan Hu 3d9c28af93 Fix first-time contributor notes not rendering
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
2019-07-31 06:52:11 -07:00
Mario de la Ossa e5705f5c54
Banzai - avoid redis if attr is in DB cache
When cache_collection_render runs we end up reading and writing
things to redis even if we already have the rendered field cached
in the DB. This commit avoids using redis at all whenever we have
the field already rendered in the DB cache.
2019-07-10 21:35:43 -06:00
Thong Kuah a2cfc150ce Add # frozen_string_literal to spec/models
Adds `# frozen_string_literal: true` to spec/models ruby files
2019-04-01 14:37:54 +13:00
Heinrich Lee Yu f5f243a036 Hide "Edited" when note is transformed or resolved
Makes `Note#edited?` return `false` when the note body was not edited
2019-03-14 12:46:23 +08:00
Jarka Košanová c4d18b0584 Use parent instead of project
Add support for group entities to quick actions
2019-01-08 02:30:37 +08:00
Cindy Pallares e122e14ac6
Merge branch 'security-guest-comments' into 'master'
[master]Fixed ability to comment on and edit/delete comments on locked or confidential issues

See merge request gitlab/gitlabhq!2612
2018-11-28 19:11:56 -05:00
Oswaldo Ferreira 86ead874e2 Resolve "Filter discussion (tab) by comments or activity in issues and merge requests" 2018-10-23 09:49:45 +00:00
Brett Walker 9ba554c8a0 Filter system notes with public and private cross references 2018-10-02 17:01:49 -05:00
Mark Chao a63bce1a4b Resolve "Rename the `Master` role to `Maintainer`" Backend 2018-07-11 14:36:08 +00:00
Felipe Artur 3e66795ef1 Changes tab VUE refactoring 2018-06-21 12:22:40 +00:00
Stan Hu 775211bc70 Fix N+1 queries when loading participants for a commit note
We saw about 10,000 SQL queries for some commits in the NewNoteWorker,
which stalled the Sidekiq queue for other new notes. The notification
service took up to 8 minutes to process the commits. Avoiding this
N+1 query brings the time down significantly.

Closes #45526
2018-04-18 22:04:22 -07:00
Douwe Maan 52967b107b
Merge branch 'jej/mattermost-notification-confidentiality-10-6' into '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
2018-04-05 08:41:56 +02:00
Andreas Brandl d07addbf6e Add foreign keys to todos table.
Fixes #32282.
2018-02-05 16:16:57 +01:00
Mario de la Ossa eaada9d706 use Gitlab::UserSettings directly as a singleton instead of including/extending it 2018-02-02 18:39:55 +00:00
blackst0ne 27c95364b5 Replace '.team << [user, role]' with 'add_role(user)' in specs 2017-12-22 19:18:28 +11:00
Toon Claes f55aaca561 Make discussion mail References all notes in the discussion
When a note is part of a discussion, the email sent out will be
`In-Reply-To` the previous note in that discussion. It also
`References` all the previous notes in that discussion, and the
original issue.

Closes gitlab-org/gitlab-ce#36054.
2017-12-13 21:26:01 +01:00
Toon Claes 2acf3a564c Make mail notifications of discussion notes In-Reply-To of each other
When a note is part of a discussion, the email sent out should be
`In-Reply-To` the previous note in that discussion.

Closes gitlab-org/gitlab-ce#36054
2017-12-13 21:26:01 +01:00
Yorick Peterse 856447ccd3
Throttle the number of UPDATEs triggered by touch
This throttles the number of UPDATE queries that can be triggered by
calling "touch" on a Note, Issue, or MergeRequest. For Note objects we
also take care of updating the associated "noteable" relation in a
smarter way than Rails does by default.
2017-12-06 15:59:37 +01:00
micael.bergeron 9ed91479a7 add the missing spec 2017-11-20 13:00:35 -05:00
Felipe Artur b54203f0ad Commenting on image diffs 2017-10-07 04:25:17 +00:00
Robert Speicher 72a7b30c9f Change all `:empty_project` to `:project` 2017-08-02 17:47:31 -04:00
Rémy Coutable cddc5cacfb Use described_class when possible
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-07-27 14:31:53 +02:00
Rémy Coutable ddccd24c13 Remove superfluous lib: true, type: redis, service: true, models: true, services: true, no_db: true, api: true
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-07-27 14:31:53 +02:00
Grzegorz Bizon 0430b76441 Enable Style/DotPosition Rubocop 👮 2017-06-21 13:48:12 +00:00
Robert Speicher a6ec5121f0 Correct RSpec/SingleLineHook cop offenses 2017-06-14 13:18:56 -05:00
Douwe Maan f8fabfcc6f Allow commenting on older versions of the diff and comparisons between diff versions 2017-05-03 14:47:21 -05:00
mhasbini f1f9578f1c Fix issue's note cache expiration after delete 2017-04-11 15:20:25 +03:00
Douwe Maan c319f21141
Address review comments 2017-04-05 17:44:14 +01:00
Douwe Maan afa53810de
Fix specs 2017-04-05 17:44:14 +01:00
Douwe Maan bb8cc94668
Don't use original_discussion_id 2017-04-05 17:44:14 +01:00
Douwe Maan 79889a6aa3
Add specs 2017-04-05 17:44:14 +01:00
Douwe Maan 9c30b0e918
Fix some specs 2017-04-05 17:44:14 +01:00
Douwe Maan 08bbb9fce6
Add option to start a new discussion on an MR 2017-04-05 17:44:14 +01:00
Adam Niedzielski c661df3561 Invalidate ETag cache when note changes 2017-03-01 16:48:02 +01:00
Robert Speicher fcb37542e7 Use `:empty_project` where possible in model specs 2017-01-26 17:44:59 -05:00
Rémy Coutable 37b4503125 Merge branch 'rs-empty_project-for-associations' into 'master'
Factories with a project association use `:empty_project` by default

See merge request !8770
2017-01-26 09:07:08 +00:00
Robert Speicher c1743ba4c4 Use a project factory with a repository where necessary 2017-01-25 14:52:12 -05:00
Jarka Kadlecova 0c350b7939 address comments 2017-01-25 10:10:05 +01:00
Jarka Kadlecova bf708e55c2 make mentions working when project not specified 2017-01-18 18:38:17 -05:00
Jarka Kadlecova d6b11dafd3 Support notes without project 2017-01-18 18:38:17 -05:00
Douwe Maan 12db4cc0e7 Merge branch 'jej-note-search-uses-finder' into 'security'
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?

⚠️ - Potentially untested  
💣 - No test coverage  
🚥 - Test coverage of some sort exists (a test failed when error raised)  
🚦 - Test coverage of return value (a test failed when nil used)  
 - Permissions check tested

### Note lookup without access check

- [x]  app/finders/notes_finder.rb:13 :download_code check
- [x]  app/finders/notes_finder.rb:19 `SnippetsFinder`
- [x]  app/models/note.rb:121 [`Issue#visible_to_user`]
- [x]  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
2016-12-15 11:40:12 -03:00
Douwe Maan 6df22f72c6 Rephrase some system notes to be compatible with new system note style 2016-11-24 18:26:29 +08:00
http://jneen.net/ 5853c96b49 remove Ability.abilities 2016-08-30 11:35:06 -07:00
http://jneen.net/ 99ee86206e remove six, and use a Set instead 2016-08-30 11:32:55 -07:00
Clement Ho 77abf8cccf Capitalize mentioned issue timeline notes 2016-08-25 10:47:40 -05:00
Douwe Maan 4a13aa9f34 Store discussion_id on Note for faster discussion lookup. 2016-08-17 12:16:46 -05:00
Douwe Maan c770201061 Merge branch 'master' into diff-line-comment-vuejs 2016-08-12 17:23:19 -05:00
Douwe Maan c80f5e0a1c Add specs for new Note and DiffNote methods. 2016-08-12 00:16:38 -05:00
tiagonbotelho 1d268a89de adds second batch of tests changed to active tense 2016-08-09 15:11:39 +01:00
Ahmad Sherif 0c14c6332d Retrieve rendered HTML from cache in one request
See #19985
2016-07-21 21:17:25 +02:00