Skip to content
Snippets Groups Projects
Commit c0e193db authored by Mayra Cabrera's avatar Mayra Cabrera
Browse files

Merge branch '64176-fix-error-handling' into 'master'

Fix invalid SSL certificate errors on Drone CI service

See merge request gitlab-org/gitlab-ce!30422
parents 0cb361fe 357f9898
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -46,7 +46,7 @@ class DroneCiService < CiService
end
 
def commit_status(sha, ref)
with_reactive_cache(sha, ref) {|cached| cached[:commit_status] }
with_reactive_cache(sha, ref) { |cached| cached[:commit_status] }
end
 
def calculate_reactive_cache(sha, ref)
Loading
Loading
@@ -68,7 +68,7 @@ class DroneCiService < CiService
end
 
{ commit_status: status }
rescue Errno::ECONNREFUSED
rescue *Gitlab::HTTP::HTTP_ERRORS
{ commit_status: :error }
end
 
Loading
Loading
---
title: Fix invalid SSL certificate errors on Drone CI service
merge_request: 30422
author:
type: fixed
Loading
Loading
@@ -10,9 +10,9 @@ module Gitlab
RedirectionTooDeep = Class.new(StandardError)
 
HTTP_ERRORS = [
SocketError, OpenSSL::SSL::SSLError, Errno::ECONNRESET,
Errno::ECONNREFUSED, Errno::EHOSTUNREACH, Net::OpenTimeout,
Net::ReadTimeout, Gitlab::HTTP::BlockedUrlError,
SocketError, OpenSSL::SSL::SSLError, OpenSSL::OpenSSLError,
Errno::ECONNRESET, Errno::ECONNREFUSED, Errno::EHOSTUNREACH,
Net::OpenTimeout, Net::ReadTimeout, Gitlab::HTTP::BlockedUrlError,
Gitlab::HTTP::RedirectionTooDeep
].freeze
 
Loading
Loading
Loading
Loading
@@ -101,6 +101,15 @@ describe DroneCiService, :use_clean_rails_memory_store_caching do
is_expected.to eq(:error)
end
 
Gitlab::HTTP::HTTP_ERRORS.each do |http_error|
it "sets commit status to :error with a #{http_error.name} error" do
WebMock.stub_request(:get, commit_status_path)
.to_raise(http_error)
is_expected.to eq(:error)
end
end
{
"killed" => :canceled,
"failure" => :failed,
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment