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
c1183dc1
Commit
c1183dc1
authored
Jun 22, 2017
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add repository storage name to deleted events table
parent
c9aa2663
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
5 deletions
+11
-5
app/services/ee/projects/destroy_service.rb
app/services/ee/projects/destroy_service.rb
+7
-5
db/migrate/20170614053336_create_geo_repository_deleted_events.rb
...te/20170614053336_create_geo_repository_deleted_events.rb
+1
-0
db/schema.rb
db/schema.rb
+1
-0
spec/services/projects/ee/destroy_service_spec.rb
spec/services/projects/ee/destroy_service_spec.rb
+2
-0
No files found.
app/services/ee/projects/destroy_service.rb
View file @
c1183dc1
...
...
@@ -14,11 +14,13 @@ module EE
Geo
::
EventLog
.
transaction
do
event_log
=
Geo
::
EventLog
.
new
deleted_event
=
Geo
::
RepositoryDeletedEvent
.
new
(
project:
project
,
repository_storage_path:
project
.
repository_storage_path
,
deleted_path:
repo_path
,
deleted_wiki_path:
wiki_path
,
deleted_project_name:
project
.
name
)
deleted_event
=
Geo
::
RepositoryDeletedEvent
.
new
(
project:
project
,
repository_storage_name:
project
.
repository
.
storage
,
repository_storage_path:
project
.
repository_storage_path
,
deleted_path:
repo_path
,
deleted_wiki_path:
wiki_path
,
deleted_project_name:
project
.
name
)
event_log
.
repository_deleted_event
=
deleted_event
event_log
.
save
end
...
...
db/migrate/20170614053336_create_geo_repository_deleted_events.rb
View file @
c1183dc1
...
...
@@ -7,6 +7,7 @@ class CreateGeoRepositoryDeletedEvents < ActiveRecord::Migration
create_table
:geo_repository_deleted_events
,
id: :bigserial
do
|
t
|
# If a project is deleted, we need to retain this entry
t
.
references
:project
,
index:
true
,
foreign_key:
false
,
null:
false
t
.
text
:repository_storage_name
,
null:
false
t
.
text
:repository_storage_path
,
null:
false
t
.
text
:deleted_path
,
null:
false
t
.
text
:deleted_wiki_path
...
...
db/schema.rb
View file @
c1183dc1
...
...
@@ -609,6 +609,7 @@ ActiveRecord::Schema.define(version: 20170614115405) do
create_table
"geo_repository_deleted_events"
,
id: :bigserial
,
force: :cascade
do
|
t
|
t
.
integer
"project_id"
,
null:
false
t
.
text
"repository_storage_name"
,
null:
false
t
.
text
"repository_storage_path"
,
null:
false
t
.
text
"deleted_path"
,
null:
false
t
.
text
"deleted_wiki_path"
...
...
spec/services/projects/ee/destroy_service_spec.rb
View file @
c1183dc1
...
...
@@ -8,6 +8,7 @@ describe Projects::DestroyService, services: true do
let!
(
:project_name
)
{
project
.
name
}
let!
(
:project_path
)
{
project
.
path_with_namespace
}
let!
(
:wiki_path
)
{
project
.
path_with_namespace
+
'.wiki'
}
let!
(
:storage_name
)
{
project
.
repository_storage
}
let!
(
:storage_path
)
{
project
.
repository_storage_path
}
let!
(
:geo_node
)
{
create
(
:geo_node
,
:primary
,
:current
)
}
...
...
@@ -29,6 +30,7 @@ describe Projects::DestroyService, services: true do
expect
(
event
.
deleted_path
).
to
eq
(
project_path
)
expect
(
event
.
deleted_wiki_path
).
to
eq
(
wiki_path
)
expect
(
event
.
deleted_project_name
).
to
eq
(
project_name
)
expect
(
event
.
repository_storage_name
).
to
eq
(
storage_name
)
expect
(
event
.
repository_storage_path
).
to
eq
(
storage_path
)
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