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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
41a14498
Commit
41a14498
authored
Jan 26, 2018
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update code based on feedback
parent
4131b6e9
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
16 additions
and
7 deletions
+16
-7
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
+4
-0
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
+1
-1
lib/gitlab/import_export/shared.rb
lib/gitlab/import_export/shared.rb
+6
-1
spec/workers/repository_import_worker_spec.rb
spec/workers/repository_import_worker_spec.rb
+2
-2
No files found.
app/models/project_services/emails_on_push_service.rb
View file @
41a14498
...
...
@@ -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?
,
unless: :importing
?
validates
:recipients
,
presence:
true
,
if: :
valid_recipients
?
def
title
'Emails on push'
...
...
app/models/project_services/irker_service.rb
View file @
41a14498
...
...
@@ -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?
,
unless: :importing
?
validates
:recipients
,
presence:
true
,
if: :
valid_recipients
?
before_validation
:get_channels
...
...
app/models/project_services/pipelines_email_service.rb
View file @
41a14498
class
PipelinesEmailService
<
Service
prop_accessor
:recipients
boolean_accessor
:notify_only_broken_pipelines
validates
:recipients
,
presence:
true
,
if: :
activated?
,
unless: :importing
?
validates
:recipients
,
presence:
true
,
if: :
valid_recipients
?
def
initialize_properties
self
.
properties
||=
{
notify_only_broken_pipelines:
true
}
...
...
app/models/service.rb
View file @
41a14498
...
...
@@ -297,4 +297,8 @@ class Service < ActiveRecord::Base
project
.
cache_has_external_wiki
end
end
def
valid_recipients?
activated?
&&
!
importing?
end
end
changelogs/unreleased/42327-import-from-gitlab-com-fails-destination-already-exists-and-is-not-an-empty-directory-error.yml
View file @
41a14498
---
title
:
Fixes destination already exists
and is not an empty directory
Import/Export
title
:
Fixes destination already exists
, and some particular service errors on
Import/Export
error
merge_request
:
16714
author
:
...
...
lib/gitlab/import_export/shared.rb
View file @
41a14498
...
...
@@ -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/workers/repository_import_worker_spec.rb
View file @
41a14498
...
...
@@ -49,7 +49,7 @@ 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
...
...
@@ -61,7 +61,7 @@ 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_error
).
not_to
be_nil
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