gitlab-org--gitlab-foss/app/services
Robert Speicher 11eefba891 Merge branch 'fix-namespace-deletion' into 'master'
Fix bug where destroying a namespace would not always destroy projects
    
There is a race condition in DestroyGroupService now that projects are deleted asynchronously:
    
1. User attempts to delete group
2. DestroyGroupService iterates through all projects and schedules a Sidekiq job to delete each Project
3. DestroyGroupService destroys the Group, leaving all its projects without a namespace
4. Projects::DestroyService runs later but the can?(current_user,
    :remove_project) is `false` because the user no longer has permission to
    destroy projects with no namespace.
5. This leaves the project in pending_delete state with no namespace/group.
 
Projects without a namespace or group also adds another problem: it's not possible to destroy the container registry tags, since `container_registry_path_with_namespace` is the wrong value.

The fix is to destroy the group asynchronously and run `execute` directly on Projects::DestroyService.
 
Closes #17893

See merge request !4341
2016-08-12 18:04:03 +00:00
..
auth Fix private method visibility in container registry 2016-07-19 15:12:06 +02:00
ci Use event enqueue instead of queue 2016-08-12 13:57:58 +02:00
commits Revert "Revert "Merge branch '18193-developers-can-merge' into 'master' "" 2016-07-18 10:16:56 +02:00
files Merge branch 'master' into rename-repo-files 2016-07-19 11:23:08 +01:00
groups
issues Refactor spam validation to a concern that can be easily reused and improve legibility in SpamCheckService 2016-07-26 19:29:16 -05:00
members New AccessRequests API endpoints for Group & Project 2016-08-10 19:07:05 +02:00
merge_requests api for generating new merge request 2016-08-11 23:37:00 +07:00
milestones Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
notes Fix not normalized emoji paths 2016-07-14 08:51:00 +02:00
oauth2 Enable Style/EmptyLinesAroundAccessModifier rubocop cop 2016-06-03 10:34:20 +02:00
projects Clean up project destruction 2016-08-10 09:28:21 -07:00
protected_branches Implement final review comments from @rymai. 2016-07-29 15:20:39 +05:30
search
wiki_pages Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
audit_event_service.rb Services: code style fixes, minor refactoring 2016-07-06 20:58:43 +03:00
base_service.rb
compare_service.rb switch from diff_file_collection to diffs 2016-08-03 07:00:20 +02: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 Revert "squashed merge and fixed conflicts" 2016-06-16 12:59:07 +02:00
create_release_service.rb Services: code style fixes, minor refactoring 2016-07-06 20:58:43 +03:00
create_snippet_service.rb Services: code style fixes, minor refactoring 2016-07-06 20:58:43 +03:00
create_spam_log_service.rb
create_tag_service.rb Services: code style fixes, minor refactoring 2016-07-06 20:58:43 +03:00
delete_branch_service.rb Update to gitlab_git 10.4.1 and take advantage of preserved Ref objects 2016-07-28 12:24:47 -04:00
delete_tag_service.rb Update to gitlab_git 10.4.1 and take advantage of preserved Ref objects 2016-07-28 12:24:47 -04: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
git_hooks_service.rb Better message for git hooks and file locks 2016-07-04 15:31:49 +03:00
git_push_service.rb Pre-create all builds for Pipeline when a trigger is received 2016-08-11 15:22:35 +02:00
git_tag_push_service.rb Pre-create all builds for Pipeline when a trigger is received 2016-08-11 15:22:35 +02:00
gravatar_service.rb
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 Allow bulk (un)subscription from issues in issue index 2016-07-14 19:36:19 -03:00
notification_service.rb Services: code style fixes, minor refactoring 2016-07-06 20:58:43 +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_check_service.rb Refactor spam validation to a concern that can be easily reused and improve legibility in SpamCheckService 2016-07-26 19:29:16 -05:00
system_hooks_service.rb Revert "Fix merge conflicts - squashed commit" 2016-06-03 11:10:17 +02:00
system_note_service.rb Refactor system notes service to make it singleton 2016-07-19 15:12:14 +02:00
test_hook_service.rb
todo_service.rb When Issue author assign or mention himself Todos are created 2016-07-14 10:56:44 +02:00
update_release_service.rb Services: code style fixes, minor refactoring 2016-07-06 20:58:43 +03:00
update_snippet_service.rb Services: code style fixes, minor refactoring 2016-07-06 20:58:43 +03:00