gitlab-org--gitlab-foss/app/services
Douwe Maan 44cbfeaba8 Merge branch 'adam-fix-labels-find-or-create' into 'master'
Pass user instance to Labels::FindOrCreateService or skip_authorization: true

## What does this MR do?

It fixes a bug described in #23694 when `project.owner` was passed to `Labels::FindOrCreateService`. `Labels::FindOrCreateService` expected a user instance and `project.owner` may return a group as well. This MR makes sure that we either pass a user instance or `skip_authorization: true`.

## Are there points in the code the reviewer needs to double check?

- places where we pass `skip_authorization: true`

## Does this MR meet the acceptance criteria?

- Tests
  - [x] Added for this feature/bug
  - [ ] All builds are passing
- [ ] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [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 it does - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

## What are the relevant issue numbers?

Fixes #23694

See merge request !7093
2016-10-28 15:01:59 +00:00
..
auth Be nice to Docker Clients talking to JWT/auth 2016-09-27 16:59:05 +02:00
boards Rename Labels::CreateService to Labels::FindOrCreateService 2016-10-19 14:58:28 -02:00
ci Make retry_lock to not be infinite 2016-10-27 12:34:35 +01:00
commits Reduce duplication in Commits::{CherryPickService,RevertService} 2016-09-15 16:30:27 +02:00
files multi-file commit 2016-10-05 17:42:52 +00:00
groups
issuable Add bulk update support for merge requests list 2016-09-08 11:52:20 +03:00
issues Include global labels when moving an issue to another project 2016-10-19 14:58:25 -02:00
labels Pass user instance to Labels::FindOrCreateService or skip_authorization: true 2016-10-28 11:31:45 +02:00
members Invert method's naming 2016-10-03 16:57:48 +02:00
merge_requests Ignore external issues when bulk assigning issues to author of merge request. 2016-10-20 16:40:24 +02:00
milestones Ensure validation messages are shown within the milestone form 2016-09-19 09:29:12 +01:00
notes Fix authored vote from notes 2016-10-24 15:24:56 +02:00
oauth2
projects Check if repository already exists before trying to re-import it 2016-10-28 11:12:48 +02:00
protected_branches Implement third round of review comments from @DouweM. 2016-10-24 11:33:38 +05:30
search
slash_commands Add support to group labels to SlashCommands::InterpretService 2016-10-19 14:58:27 -02:00
wiki_pages
akismet_service.rb Reduce duplication in AkismetService 2016-09-20 08:19:32 +03:00
audit_event_service.rb
base_service.rb multi-file commit 2016-10-05 17:42:52 +00:00
compare_service.rb Refactor straight compare diff code 2016-10-12 16:32:57 +03:00
create_branch_service.rb Fix of 'Commits being passed to custom hooks are already reachable when using the UI' 2016-07-19 07:45:22 +03:00
create_deployment_service.rb Fix environments specs 2016-10-17 21:06:10 +02:00
create_release_service.rb
create_snippet_service.rb
create_tag_service.rb
delete_branch_service.rb Simplify the name for data builder, feedback: 2016-08-12 16:09:29 +08:00
delete_tag_service.rb Simplify the name for data builder, feedback: 2016-08-12 16:09:29 +08:00
delete_user_service.rb Fix bug where destroying a namespace would not always destroy projects 2016-08-11 15:36:35 -07:00
destroy_group_service.rb Fix bug where destroying a namespace would not always destroy projects 2016-08-11 15:36:35 -07:00
event_create_service.rb Differentiate the expire from leave event 2016-10-20 00:26:45 +00:00
git_hooks_service.rb
git_push_service.rb Extract project#update_merge_requests and SystemHooks to its own worker from GitPushService 2016-10-13 17:23:24 +02:00
git_tag_push_service.rb Simplify the name for data builder, feedback: 2016-08-12 16:09:29 +08:00
gravatar_service.rb
ham_service.rb Further refactor and syntax fixes. 2016-08-15 17:20:57 -05:00
import_export_clean_up_service.rb using shared path for project import uploads and refactored gitlab remove export worker 2016-08-04 12:51:55 +02:00
issuable_base_service.rb Rename Labels::CreateService to Labels::FindOrCreateService 2016-10-19 14:58:28 -02:00
notification_service.rb Make guests unable to view MRs 2016-10-11 16:51:26 +03:00
repair_ldap_blocked_user_service.rb
repository_archive_clean_up_service.rb using shared path for project import uploads and refactored gitlab remove export worker 2016-08-04 12:51:55 +02:00
spam_service.rb Further refactor and syntax fixes. 2016-08-15 17:20:57 -05:00
system_hooks_service.rb Enable Lint/StringConversionInInterpolation cop and autocorrect offenses 2016-10-03 16:09:57 +02:00
system_note_service.rb Use SELECT 1, instead SELECT COUNT(*) to ask for notes existency 2016-10-04 10:45:49 +02:00
test_hook_service.rb Simplify the name for data builder, feedback: 2016-08-12 16:09:29 +08:00
todo_service.rb Make guests unable to view MRs 2016-10-11 16:51:26 +03:00
update_release_service.rb
update_snippet_service.rb
user_agent_detail_service.rb Further refactor and syntax fixes. 2016-08-15 17:20:57 -05:00