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
e32f7d29
Commit
e32f7d29
authored
Mar 10, 2020
by
Peter Leitzen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Propagate storage errors
We will handle them in the worker and schedule a retry
parent
44e01684
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
17 deletions
+5
-17
ee/app/services/status_page/publish_base_service.rb
ee/app/services/status_page/publish_base_service.rb
+0
-2
ee/spec/services/status_page/publish_incident_service_spec.rb
...pec/services/status_page/publish_incident_service_spec.rb
+3
-11
ee/spec/support/shared_examples/status_page/publish_shared_examples.rb
...rt/shared_examples/status_page/publish_shared_examples.rb
+2
-4
No files found.
ee/app/services/status_page/publish_base_service.rb
View file @
e32f7d29
...
@@ -51,8 +51,6 @@ module StatusPage
...
@@ -51,8 +51,6 @@ module StatusPage
storage_client
.
upload_object
(
key
,
content
)
storage_client
.
upload_object
(
key
,
content
)
success
(
object_key:
key
)
success
(
object_key:
key
)
rescue
StatusPage
::
Storage
::
Error
=>
e
error
(
e
.
message
,
error:
e
)
end
end
def
limit_exceeded?
(
json
)
def
limit_exceeded?
(
json
)
...
...
ee/spec/services/status_page/publish_incident_service_spec.rb
View file @
e32f7d29
...
@@ -26,14 +26,10 @@ describe StatusPage::PublishIncidentService do
...
@@ -26,14 +26,10 @@ describe StatusPage::PublishIncidentService do
end
end
context
'when uploading details fails'
do
context
'when uploading details fails'
do
it
'
returns error and skip list upload
'
do
it
'
propagates the exception
'
do
expect_to_upload_details
(
issue
,
status:
404
)
expect_to_upload_details
(
issue
,
status:
404
)
expect
(
result
).
to
be_error
expect
{
result
}.
to
raise_error
(
StatusPage
::
Storage
::
Error
)
path
=
StatusPage
::
Storage
.
details_path
(
issue
.
iid
)
expect
(
result
.
message
).
to
include
(
'NotFound'
)
expect
(
result
.
message
).
to
include
(
path
)
end
end
end
end
...
@@ -42,11 +38,7 @@ describe StatusPage::PublishIncidentService do
...
@@ -42,11 +38,7 @@ describe StatusPage::PublishIncidentService do
expect_to_upload_details
(
issue
)
expect_to_upload_details
(
issue
)
expect_to_upload_list
(
status:
404
)
expect_to_upload_list
(
status:
404
)
expect
(
result
).
to
be_error
expect
{
result
}.
to
raise_error
(
StatusPage
::
Storage
::
Error
)
path
=
StatusPage
::
Storage
.
list_path
expect
(
result
.
message
).
to
include
(
'NotFound'
)
expect
(
result
.
message
).
to
include
(
path
)
end
end
end
end
...
...
ee/spec/support/shared_examples/status_page/publish_shared_examples.rb
View file @
e32f7d29
...
@@ -47,10 +47,8 @@ RSpec.shared_examples 'publish incidents' do
...
@@ -47,10 +47,8 @@ RSpec.shared_examples 'publish incidents' do
.
and_raise
(
exception
)
.
and_raise
(
exception
)
end
end
it
'returns an error with exception'
do
it
'propagates the exception'
do
expect
(
result
).
to
be_error
expect
{
result
}.
to
raise_error
(
exception
)
expect
(
result
.
message
).
to
eq
(
exception
.
message
)
expect
(
result
.
payload
).
to
eq
(
error:
exception
)
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