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
963a0719
Commit
963a0719
authored
Sep 18, 2016
by
Ruben Davila
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into 8-12-stable-ee
parents
ef8e8e87
c9e96ddf
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
2 deletions
+23
-2
CHANGELOG-EE
CHANGELOG-EE
+1
-0
app/models/remote_mirror.rb
app/models/remote_mirror.rb
+3
-1
spec/services/projects/destroy_service_spec.rb
spec/services/projects/destroy_service_spec.rb
+19
-1
No files found.
CHANGELOG-EE
View file @
963a0719
...
...
@@ -8,6 +8,7 @@ v 8.12.0 (Unreleased)
- [ES] Fix: Elasticsearch does not find partial matches in project names
- [ES] Global code search
- [ES] Improve logging
- Fix projects with remote mirrors asynchronously destruction
v 8.11.6
- Exclude blocked users from potential MR approvers.
...
...
app/models/remote_mirror.rb
View file @
963a0719
...
...
@@ -158,8 +158,10 @@ class RemoteMirror < ActiveRecord::Base
end
def
remove_remote
if
project
# could be pending to delete so don't need to touch the git repository
project
.
repository
.
remove_remote
(
ref_name
)
end
end
def
mirror_url_changed?
url_changed?
||
encrypted_credentials_changed?
...
...
spec/services/projects/destroy_service_spec.rb
View file @
963a0719
...
...
@@ -5,6 +5,7 @@ describe Projects::DestroyService, services: true do
let!
(
:project
)
{
create
(
:project
,
namespace:
user
.
namespace
)
}
let!
(
:path
)
{
project
.
repository
.
path_to_repo
}
let!
(
:remove_path
)
{
path
.
sub
(
/\.git\Z/
,
"+
#{
project
.
id
}
+deleted.git"
)
}
let!
(
:async
)
{
false
}
# execute or async_execute
context
'Sidekiq inline'
do
before
do
...
...
@@ -15,6 +16,19 @@ describe Projects::DestroyService, services: true do
it
{
expect
(
Project
.
all
).
not_to
include
(
project
)
}
it
{
expect
(
Dir
.
exist?
(
path
)).
to
be_falsey
}
it
{
expect
(
Dir
.
exist?
(
remove_path
)).
to
be_falsey
}
context
'when has remote mirrors'
do
let!
(
:project
)
do
create
(
:project
,
namespace:
user
.
namespace
).
tap
do
|
project
|
project
.
remote_mirrors
.
create
(
url:
'http://test.com'
)
end
end
let!
(
:async
)
{
true
}
it
'destroys them'
do
expect
(
RemoteMirror
.
count
).
to
eq
(
0
)
end
end
end
context
'Sidekiq fake'
do
...
...
@@ -52,6 +66,10 @@ describe Projects::DestroyService, services: true do
end
def
destroy_project
(
project
,
user
,
params
)
if
async
Projects
::
DestroyService
.
new
(
project
,
user
,
params
).
async_execute
else
Projects
::
DestroyService
.
new
(
project
,
user
,
params
).
execute
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