Commit Graph

72 Commits

Author SHA1 Message Date
GitLab Bot c766b837cf Add latest changes from gitlab-org/gitlab@master 2023-10-17 21:13:54 +00:00
GitLab Bot d2d913b606 Add latest changes from gitlab-org/gitlab@master 2023-04-25 12:18:56 +00:00
GitLab Bot 6ce6d20cf0 Add latest changes from gitlab-org/gitlab@master 2023-04-12 18:17:07 +00:00
GitLab Bot 47da688506 Add latest changes from gitlab-org/gitlab@master 2023-03-07 09:08:26 +00:00
GitLab Bot 3538972a0a Add latest changes from gitlab-org/gitlab@master 2022-09-27 18:15:03 +00:00
GitLab Bot ebaefcebcc Add latest changes from gitlab-org/gitlab@master 2021-11-22 21:10:35 +00:00
GitLab Bot d6d1051383 Add latest changes from gitlab-org/gitlab@master 2021-04-22 21:09:53 +00:00
GitLab Bot 3bc30c280c Add latest changes from gitlab-org/gitlab@master 2021-02-08 15:09:38 +00:00
GitLab Bot 833d57e60d Add latest changes from gitlab-org/gitlab@master 2020-07-08 15:09:24 +00:00
GitLab Bot 3ef9553486 Add latest changes from gitlab-org/gitlab@master 2020-06-12 12:08:56 +00:00
GitLab Bot e0a8496a09 Add latest changes from gitlab-org/gitlab@master 2020-06-01 00:08:25 +00:00
GitLab Bot 4c788f43cb Add latest changes from gitlab-org/gitlab@master 2020-05-28 09:08:05 +00:00
GitLab Bot 896b68514b Add latest changes from gitlab-org/gitlab@master 2020-05-07 12:09:46 +00:00
GitLab Bot 2fa68d3a97 Add latest changes from gitlab-org/gitlab@master 2020-05-04 06:10:10 +00:00
GitLab Bot b6847c621f Add latest changes from gitlab-org/gitlab@master 2020-04-03 18:10:03 +00:00
GitLab Bot d43aaf286f Add latest changes from gitlab-org/gitlab@master 2020-03-17 00:09:12 +00:00
GitLab Bot eb1f5a3e08 Add latest changes from gitlab-org/gitlab@master 2020-02-17 18:09:00 +00:00
GitLab Bot b6ec12ceca Add latest changes from gitlab-org/gitlab@master 2020-01-22 21:08:48 +00:00
GitLab Bot 6c15c18fa4 Add latest changes from gitlab-org/gitlab@master 2020-01-09 18:07:52 +00:00
GitLab Bot 123c68a7cf Add latest changes from gitlab-org/gitlab@master 2019-12-16 18:08:22 +00:00
GitLab Bot 308146dc39 Add latest changes from gitlab-org/gitlab@master 2019-10-10 00:06:44 +00:00
GitLab Bot 587794b4b8 Add latest changes from gitlab-org/gitlab@master 2019-10-02 00:06:26 +00:00
Thong Kuah 94bb660460 Add frozen_string_literal to spec/factories
Using the sed script from
https://gitlab.com/gitlab-org/gitlab-ce/issues/59758
2019-07-26 13:18:39 +12:00
Douwe Maan f6dd6e566a
Add image_diff_note_on_merge_request factory 2018-12-20 15:22:58 +01:00
Semyon Pupkov 87b85ef81c Fix DynamicAttributeDefinedStatically cop 2018-09-21 12:37:57 +05:00
Jan Provaznik f665e5b8fb Fix serialization of LegacyDiffNote 2018-07-18 14:49:52 +00:00
Robert Speicher 6d165c740c Make all uses of `fixture_file_upload` use relative paths 2018-06-07 09:54:41 -05:00
Rémy Coutable 023d4f6f2f
Move spec helpers/matchers/shared examples/contexts to their relevant folder
Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-04-23 12:20:30 +02:00
Jan Provaznik dcdfa04b32 Add discussion API
* adds basic discussions API for issues and snippets
* reorganizes notes specs (so same tests can be used for all noteable types - issues, MRs, snippets)
2018-03-07 12:27:50 +01:00
Micaël Bergeron 2057a6acde port of 594e6a0a625^..f74c90f68c6 2018-02-01 12:14:46 -05:00
Rémy Coutable a2718ebaff Make user/author use project.creator in most factories
Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-01-31 18:31:21 +01:00
Rémy Coutable 4af9d592c5 Replace factory_girl_rails with factory_bot_rails
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>
2017-12-14 15:01:55 +01:00
micael.bergeron 360b94ceba adding view and feature specs 2017-12-07 09:06:59 -05:00
Jacopo 181cd299f9 Adds Rubocop rule for line break after guard clause
Adds a rubocop rule (with autocorrect) to ensure line break after guard clauses.
2017-11-16 17:58:29 +01:00
Robert Speicher 72a7b30c9f Change all `:empty_project` to `:project` 2017-08-02 17:47:31 -04:00
Jarka Kadlecova e4f7b87ddb Support comments for personal snippets 2017-05-05 15:45:49 +02:00
Jarka Kadlecova 8c3a03c1b9 Display comments for personal snippets 2017-05-02 13:07:53 +02:00
Douwe Maan 4f8c36c03c Add specs 2017-04-10 15:17:52 -05:00
Douwe Maan c319f21141
Address review comments 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
Bob Van Landuyt 0267b83898 Delegate a single discussion to a new issue
Delegate a discussion in a merge request into a new issue.
The discussion wil be marked as resolved and a system note will be
added linking to the newly created issue.
2017-03-13 08:27:51 +01:00
Robert Speicher dd944bf14f Merge branch 'svg-xss-fix' into 'security'
Fix for XSS vulnerability in SVG attachments

See https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/2059
2017-02-15 10:42:13 -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
Robert Speicher d0315d5393 Factories with a project association use `:empty_project` by default 2017-01-24 20:30:56 -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
Alejandro Rodríguez ea155ccc3e Optimize discussion notes resolving and unresolving
Use `update_all` to only require one query per discussion to
update the notes resolved status. Some changes had to be made to
the discussion spec to accout for the fact that notes are not
individually updated now
2016-09-06 12:14:09 -03:00