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
53242397
Commit
53242397
authored
Mar 24, 2020
by
Marius Bobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use Gitlab::HTTP.try_get to calculate cache for DroneCi
parent
cf586958
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
app/models/project_services/drone_ci_service.rb
app/models/project_services/drone_ci_service.rb
+4
-4
spec/models/project_services/drone_ci_service_spec.rb
spec/models/project_services/drone_ci_service_spec.rb
+4
-0
No files found.
app/models/project_services/drone_ci_service.rb
View file @
53242397
...
...
@@ -50,10 +50,12 @@ class DroneCiService < CiService
end
def
calculate_reactive_cache
(
sha
,
ref
)
response
=
Gitlab
::
HTTP
.
get
(
commit_status_path
(
sha
,
ref
),
verify:
enable_ssl_verification
)
response
=
Gitlab
::
HTTP
.
try_get
(
commit_status_path
(
sha
,
ref
),
verify:
enable_ssl_verification
,
extra_log_info:
{
project_id:
project_id
})
status
=
if
response
.
code
==
200
&&
response
[
'status'
]
if
response
&&
response
.
code
==
200
&&
response
[
'status'
]
case
response
[
'status'
]
when
'killed'
:canceled
...
...
@@ -68,8 +70,6 @@ class DroneCiService < CiService
end
{
commit_status:
status
}
rescue
*
Gitlab
::
HTTP
::
HTTP_ERRORS
{
commit_status: :error
}
end
def
build_page
(
sha
,
ref
)
...
...
spec/models/project_services/drone_ci_service_spec.rb
View file @
53242397
...
...
@@ -106,6 +106,10 @@ describe DroneCiService, :use_clean_rails_memory_store_caching do
WebMock
.
stub_request
(
:get
,
commit_status_path
)
.
to_raise
(
http_error
)
expect
(
Gitlab
::
ErrorTracking
)
.
to
receive
(
:log_exception
)
.
with
(
instance_of
(
http_error
),
project_id:
project
.
id
)
is_expected
.
to
eq
(
:error
)
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