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
6ea5fee9
Commit
6ea5fee9
authored
Jan 26, 2018
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master' into ce-to-ee-2018-01-26
parents
049e7797
6c978c8f
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
53 additions
and
8 deletions
+53
-8
app/models/project.rb
app/models/project.rb
+3
-0
app/models/project_services/emails_on_push_service.rb
app/models/project_services/emails_on_push_service.rb
+1
-1
app/models/project_services/irker_service.rb
app/models/project_services/irker_service.rb
+1
-1
app/models/project_services/pipelines_email_service.rb
app/models/project_services/pipelines_email_service.rb
+1
-1
app/models/service.rb
app/models/service.rb
+6
-0
app/workers/repository_import_worker.rb
app/workers/repository_import_worker.rb
+9
-1
changelogs/unreleased/42327-import-from-gitlab-com-fails-destination-already-exists-and-is-not-an-empty-directory-error.yml
...on-already-exists-and-is-not-an-empty-directory-error.yml
+6
-0
lib/gitlab/import_export/shared.rb
lib/gitlab/import_export/shared.rb
+6
-1
spec/lib/gitlab/import_export/project.json
spec/lib/gitlab/import_export/project.json
+1
-1
spec/lib/gitlab/import_export/project_tree_saver_spec.rb
spec/lib/gitlab/import_export/project_tree_saver_spec.rb
+5
-1
spec/workers/repository_import_worker_spec.rb
spec/workers/repository_import_worker_spec.rb
+14
-1
No files found.
app/models/project.rb
View file @
6ea5fee9
...
...
@@ -576,6 +576,9 @@ class Project < ActiveRecord::Base
RepositoryForkWorker
.
perform_async
(
id
,
forked_from_project
.
repository_storage_path
,
forked_from_project
.
disk_path
)
elsif
gitlab_project_import?
# Do not retry on Import/Export until https://gitlab.com/gitlab-org/gitlab-ce/issues/26189 is solved.
RepositoryImportWorker
.
set
(
retry:
false
).
perform_async
(
self
.
id
)
else
RepositoryImportWorker
.
perform_async
(
self
.
id
)
end
...
...
app/models/project_services/emails_on_push_service.rb
View file @
6ea5fee9
...
...
@@ -2,7 +2,7 @@ class EmailsOnPushService < Service
boolean_accessor
:send_from_committer_email
boolean_accessor
:disable_diffs
prop_accessor
:recipients
validates
:recipients
,
presence:
true
,
if: :
activated
?
validates
:recipients
,
presence:
true
,
if: :
valid_recipients
?
def
title
'Emails on push'
...
...
app/models/project_services/irker_service.rb
View file @
6ea5fee9
...
...
@@ -4,7 +4,7 @@ class IrkerService < Service
prop_accessor
:server_host
,
:server_port
,
:default_irc_uri
prop_accessor
:recipients
,
:channels
boolean_accessor
:colorize_messages
validates
:recipients
,
presence:
true
,
if: :
activated
?
validates
:recipients
,
presence:
true
,
if: :
valid_recipients
?
before_validation
:get_channels
...
...
app/models/project_services/pipelines_email_service.rb
View file @
6ea5fee9
class
PipelinesEmailService
<
Service
prop_accessor
:recipients
boolean_accessor
:notify_only_broken_pipelines
validates
:recipients
,
presence:
true
,
if: :
activated
?
validates
:recipients
,
presence:
true
,
if: :
valid_recipients
?
def
initialize_properties
self
.
properties
||=
{
notify_only_broken_pipelines:
true
}
...
...
app/models/service.rb
View file @
6ea5fee9
...
...
@@ -2,6 +2,8 @@
# and implement a set of methods
class
Service
<
ActiveRecord
::
Base
include
Sortable
include
Importable
serialize
:properties
,
JSON
# rubocop:disable Cop/ActiveRecordSerialize
default_value_for
:active
,
false
...
...
@@ -301,4 +303,8 @@ class Service < ActiveRecord::Base
project
.
cache_has_external_wiki
end
end
def
valid_recipients?
activated?
&&
!
importing?
end
end
app/workers/repository_import_worker.rb
View file @
6ea5fee9
...
...
@@ -20,7 +20,11 @@ class RepositoryImportWorker
# to those importers to mark the import process as complete.
return
if
service
.
async?
raise
result
[
:message
]
if
result
[
:status
]
==
:error
if
result
[
:status
]
==
:error
fail_import
(
project
,
result
[
:message
])
if
project
.
gitlab_project_import?
raise
result
[
:message
]
end
project
.
after_import
...
...
@@ -37,4 +41,8 @@ class RepositoryImportWorker
Rails
.
logger
.
info
(
"Project
#{
project
.
full_path
}
was in inconsistent state (
#{
project
.
import_status
}
) while importing."
)
false
end
def
fail_import
(
project
,
message
)
project
.
mark_import_as_failed
(
message
)
end
end
changelogs/unreleased/42327-import-from-gitlab-com-fails-destination-already-exists-and-is-not-an-empty-directory-error.yml
0 → 100644
View file @
6ea5fee9
---
title
:
Fixes destination already exists, and some particular service errors on Import/Export
error
merge_request
:
16714
author
:
type
:
fixed
lib/gitlab/import_export/shared.rb
View file @
6ea5fee9
...
...
@@ -19,8 +19,13 @@ module Gitlab
def
error
(
error
)
error_out
(
error
.
message
,
caller
[
0
].
dup
)
@errors
<<
error
.
message
# Debug:
Rails
.
logger
.
error
(
error
.
backtrace
.
join
(
"
\n
"
))
if
error
.
backtrace
Rails
.
logger
.
error
(
"Import/Export backtrace:
#{
error
.
backtrace
.
join
(
"
\n
"
)
}
"
)
else
Rails
.
logger
.
error
(
"No backtrace found"
)
end
end
private
...
...
spec/lib/gitlab/import_export/project.json
View file @
6ea5fee9
...
...
@@ -7097,7 +7097,7 @@
"project_id"
:
5
,
"created_at"
:
"2016-06-14T15:01:51.232Z"
,
"updated_at"
:
"2016-06-14T15:01:51.232Z"
,
"active"
:
fals
e
,
"active"
:
tru
e
,
"properties"
:
{
},
...
...
spec/lib/gitlab/import_export/project_tree_saver_spec.rb
View file @
6ea5fee9
...
...
@@ -168,6 +168,10 @@ describe Gitlab::ImportExport::ProjectTreeSaver do
expect
(
saved_project_json
[
'services'
].
first
[
'type'
]).
to
eq
(
'CustomIssueTrackerService'
)
end
it
'saves the properties for a service'
do
expect
(
saved_project_json
[
'services'
].
first
[
'properties'
]).
to
eq
(
'one'
=>
'value'
)
end
it
'has project feature'
do
project_feature
=
saved_project_json
[
'project_feature'
]
expect
(
project_feature
).
not_to
be_empty
...
...
@@ -284,7 +288,7 @@ describe Gitlab::ImportExport::ProjectTreeSaver do
commit_id:
ci_build
.
pipeline
.
sha
)
create
(
:event
,
:created
,
target:
milestone
,
project:
project
,
author:
user
)
create
(
:service
,
project:
project
,
type:
'CustomIssueTrackerService'
,
category:
'issue_tracker'
)
create
(
:service
,
project:
project
,
type:
'CustomIssueTrackerService'
,
category:
'issue_tracker'
,
properties:
{
one:
'value'
}
)
create
(
:project_custom_attribute
,
project:
project
)
create
(
:project_custom_attribute
,
project:
project
)
...
...
spec/workers/repository_import_worker_spec.rb
View file @
6ea5fee9
...
...
@@ -62,9 +62,22 @@ describe RepositoryImportWorker do
expect
do
subject
.
perform
(
project
.
id
)
end
.
to
raise_error
(
Standard
Error
,
error
)
end
.
to
raise_error
(
Runtime
Error
,
error
)
expect
(
project
.
reload
.
import_jid
).
not_to
be_nil
end
it
'updates the error on Import/Export'
do
error
=
%q{remote: Not Found fatal: repository 'https://user:pass@test.com/root/repoC.git/' not found }
project
.
update_attributes
(
import_jid:
'123'
,
import_type:
'gitlab_project'
)
expect_any_instance_of
(
Projects
::
ImportService
).
to
receive
(
:execute
).
and_return
({
status: :error
,
message:
error
})
expect
do
subject
.
perform
(
project
.
id
)
end
.
to
raise_error
(
RuntimeError
,
error
)
expect
(
project
.
reload
.
import_error
).
not_to
be_nil
end
end
context
'when using an asynchronous importer'
do
...
...
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