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
7d85448b
Commit
7d85448b
authored
Apr 24, 2019
by
Francisco Javier López
Committed by
Stan Hu
Apr 24, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug when project export to remote url fails
parent
7734b834
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
4 deletions
+18
-4
changelogs/unreleased/fj-60827-fix-web-strategy-error.yml
changelogs/unreleased/fj-60827-fix-web-strategy-error.yml
+5
-0
lib/gitlab/import_export/after_export_strategies/web_upload_strategy.rb
...ort_export/after_export_strategies/web_upload_strategy.rb
+1
-4
spec/lib/gitlab/import_export/after_export_strategies/web_upload_strategy_spec.rb
...xport/after_export_strategies/web_upload_strategy_spec.rb
+12
-0
No files found.
changelogs/unreleased/fj-60827-fix-web-strategy-error.yml
0 → 100644
View file @
7d85448b
---
title
:
Fix bug when project export to remote url fails
merge_request
:
27614
author
:
type
:
fixed
lib/gitlab/import_export/after_export_strategies/web_upload_strategy.rb
View file @
7d85448b
...
@@ -30,10 +30,7 @@ module Gitlab
...
@@ -30,10 +30,7 @@ module Gitlab
def
handle_response_error
(
response
)
def
handle_response_error
(
response
)
unless
response
.
success?
unless
response
.
success?
error_code
=
response
.
dig
(
'Error'
,
'Code'
)
||
response
.
code
raise
StrategyError
.
new
(
"Error uploading the project. Code
#{
response
.
code
}
:
#{
response
.
message
}
"
)
error_message
=
response
.
dig
(
'Error'
,
'Message'
)
||
response
.
message
raise
StrategyError
.
new
(
"Error uploading the project. Code
#{
error_code
}
:
#{
error_message
}
"
)
end
end
end
end
...
...
spec/lib/gitlab/import_export/after_export_strategies/web_upload_strategy_spec.rb
View file @
7d85448b
...
@@ -32,5 +32,17 @@ describe Gitlab::ImportExport::AfterExportStrategies::WebUploadStrategy do
...
@@ -32,5 +32,17 @@ describe Gitlab::ImportExport::AfterExportStrategies::WebUploadStrategy do
strategy
.
execute
(
user
,
project
)
strategy
.
execute
(
user
,
project
)
end
end
context
'when upload fails'
do
it
'stores the export error'
do
stub_request
(
:post
,
example_url
).
to_return
(
status:
[
404
,
'Page not found'
])
strategy
.
execute
(
user
,
project
)
errors
=
project
.
import_export_shared
.
errors
expect
(
errors
).
not_to
be_empty
expect
(
errors
.
first
).
to
eq
"Error uploading the project. Code 404: Page not found"
end
end
end
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