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
ebe37aab
Commit
ebe37aab
authored
Nov 11, 2019
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove design registry entries
parent
9dce871d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
6 deletions
+17
-6
ee/app/services/geo/repository_destroy_service.rb
ee/app/services/geo/repository_destroy_service.rb
+2
-1
ee/spec/services/geo/repository_destroy_service_spec.rb
ee/spec/services/geo/repository_destroy_service_spec.rb
+15
-5
No files found.
ee/app/services/geo/repository_destroy_service.rb
View file @
ebe37aab
...
...
@@ -35,8 +35,9 @@ module Geo
# rubocop: disable CodeReuse/ActiveRecord
def
destroy_registry_entries
::
Geo
::
ProjectRegistry
.
where
(
project_id:
id
).
delete_all
::
Geo
::
DesignRegistry
.
where
(
project_id:
id
).
delete_all
log_info
(
"
Project registry entry
removed"
,
project_id:
id
)
log_info
(
"
Registry entries
removed"
,
project_id:
id
)
end
# rubocop: enable CodeReuse/ActiveRecord
...
...
ee/spec/services/geo/repository_destroy_service_spec.rb
View file @
ebe37aab
...
...
@@ -54,10 +54,14 @@ describe Geo::RepositoryDestroyService do
service
.
execute
end
it
'removes the tracking entr
y
'
do
it
'removes the tracking entr
ies
'
do
create
(
:geo_project_registry
,
project:
project
)
create
(
:geo_design_registry
,
project:
project
)
expect
{
service
.
execute
}.
to
change
(
Geo
::
ProjectRegistry
,
:count
).
by
(
-
1
)
service
.
execute
expect
(
Geo
::
ProjectRegistry
.
where
(
project:
project
)).
to
be_empty
expect
(
Geo
::
DesignRegistry
.
where
(
project:
project
)).
to
be_empty
end
end
...
...
@@ -92,10 +96,14 @@ describe Geo::RepositoryDestroyService do
service
.
execute
end
it
'removes the tracking entr
y
'
do
it
'removes the tracking entr
ies
'
do
create
(
:geo_project_registry
,
project:
project
)
create
(
:geo_design_registry
,
project:
project
)
expect
{
service
.
execute
}.
to
change
(
Geo
::
ProjectRegistry
,
:count
).
by
(
-
1
)
service
.
execute
expect
(
Geo
::
ProjectRegistry
.
where
(
project:
project
)).
to
be_empty
expect
(
Geo
::
DesignRegistry
.
where
(
project:
project
)).
to
be_empty
end
end
...
...
@@ -110,12 +118,14 @@ describe Geo::RepositoryDestroyService do
service
.
execute
end
it
'removes the tracking entr
y
'
do
it
'removes the tracking entr
ies
'
do
create
(
:geo_project_registry
,
project:
project
)
create
(
:geo_design_registry
,
project:
project
)
expect
{
service
.
execute
}.
to
raise_error
RuntimeError
,
'storage not found: "broken"'
expect
(
Geo
::
ProjectRegistry
.
where
(
project:
project
)).
to
be_empty
expect
(
Geo
::
DesignRegistry
.
where
(
project:
project
)).
to
be_empty
end
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