Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
a07c013e
Commit
a07c013e
authored
Jun 24, 2017
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert changes until gitlab-org/gitlab-ce!12435 is merged
parent
15c3bd99
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
28 deletions
+2
-28
app/services/groups/destroy_service.rb
app/services/groups/destroy_service.rb
+2
-2
spec/services/ee/groups/destroy_service_spec.rb
spec/services/ee/groups/destroy_service_spec.rb
+0
-26
No files found.
app/services/groups/destroy_service.rb
View file @
a07c013e
module
Groups
class
DestroyService
<
Groups
::
BaseService
def
async_execute
#
Don't call `group.destroy` since this will purge all the projects, which may be too slow
group
.
de
leted_at
=
Time
.
now
#
Soft delete via paranoia gem
group
.
de
stroy
job_id
=
GroupDestroyWorker
.
perform_async
(
group
.
id
,
current_user
.
id
)
Rails
.
logger
.
info
(
"User
#{
current_user
.
id
}
scheduled a deletion of group ID
#{
group
.
id
}
with job ID
#{
job_id
}
"
)
end
...
...
spec/services/ee/groups/destroy_service_spec.rb
deleted
100644 → 0
View file @
15c3bd99
require
'spec_helper'
describe
Groups
::
DestroyService
,
services:
true
do
let!
(
:user
)
{
create
(
:user
)
}
let!
(
:group
)
{
create
(
:group
)
}
let!
(
:project
)
{
create
(
:empty_project
,
namespace:
group
)
}
let!
(
:geo_node
)
{
create
(
:geo_node
,
:current
,
:primary
)
}
before
do
group
.
add_user
(
user
,
Gitlab
::
Access
::
OWNER
)
end
it
'creates a Geo event log when project is deleted synchronously'
do
Groups
::
DestroyService
.
new
(
group
,
user
).
execute
expect
(
Geo
::
EventLog
.
count
).
to
eq
(
1
)
expect
(
Geo
::
RepositoryDeletedEvent
.
count
).
to
eq
(
1
)
end
it
'creates a Geo event log when project is deleted asynchronously'
do
Sidekiq
::
Testing
.
inline!
{
Groups
::
DestroyService
.
new
(
group
,
user
).
async_execute
}
expect
(
Geo
::
EventLog
.
count
).
to
eq
(
1
)
expect
(
Geo
::
RepositoryDeletedEvent
.
count
).
to
eq
(
1
)
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment