gitlab-org--gitlab-foss/spec
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
..
config Small refactor and a few documentation fixes 2016-08-04 19:02:39 +02:00
controllers Fix bug where destroying a namespace would not always destroy projects 2016-08-11 15:36:35 -07:00
factories Pre-create all builds for Pipeline when a trigger is received 2016-08-11 15:22:35 +02:00
features Fix test failures 2016-08-12 12:23:47 +02:00
finders fixes part1 of files to start using active tense 2016-08-09 15:06:23 +01:00
fixtures Merge branch '13333-consider-updating-http-parser-rb-to-0-6-0' into 'master' 2016-08-11 11:23:53 +00:00
helpers Show member roles to all users on members page 2016-08-11 11:08:07 -05:00
initializers Give priority to environment variables 2016-08-03 15:48:48 +01:00
javascripts Merge branch 'date-time-to-day-tests' into 'master' 2016-08-05 19:38:05 +00:00
lib Merge remote-tracking branch 'origin/master' into improve-pipeline-processing 2016-08-12 00:47:26 +02:00
mailers adds second batch of tests changed to active tense 2016-08-09 15:11:39 +01:00
models Fix build play failure 2016-08-12 15:09:35 +02:00
requests Merge branch 'fix-namespace-deletion' into 'master' 2016-08-12 18:04:03 +00:00
routing Rename markdown_preview routes to preview_markdown 2016-08-11 15:54:18 +02:00
services Merge branch 'fix-namespace-deletion' into 'master' 2016-08-12 18:04:03 +00:00
support New AccessRequests API endpoints for Group & Project 2016-08-10 19:07:05 +02:00
tasks/gitlab Use File::exist? instead of File::exists? 2016-08-11 13:54:45 +03:00
uploaders
views Remove provider path, replace with dynamic path. 2016-08-03 11:50:38 -06:00
workers Fix bug where destroying a namespace would not always destroy projects 2016-08-11 15:36:35 -07:00
factories_spec.rb adds second batch of tests changed to active tense 2016-08-09 15:11:39 +01:00
rails_helper.rb
simplecov_env.rb
spec_helper.rb Add a method in Project to return a cached value of total count of projects 2016-08-09 16:08:03 -07:00
teaspoon_env.rb Add test coverage analysis for CoffeeScript (!5052) 2016-08-07 21:52:37 +02:00