Commit b1829369 authored by Mark Chao's avatar Mark Chao Committed by Juanito Fatas

Replace enable_ssl_verification assignment

with stub method which also removes that unused key.

Add API param back
parent ba0f5b7a
......@@ -8,7 +8,6 @@ class BuildkiteService < CiService
ENDPOINT = "https://buildkite.com"
prop_accessor :project_url, :token
boolean_accessor :enable_ssl_verification
validates :project_url, presence: true, public_url: true, if: :activated?
validates :token, presence: true, if: :activated?
......@@ -19,6 +18,15 @@ class BuildkiteService < CiService
%w(push merge_request tag_push)
end
# Since SSL verification will always be enabled for Buildkite,
# we no longer needs to store the boolean.
# This is a stub method to work with deprecated API param.
# TODO: remove enable_ssl_verification after 14.0
# https://gitlab.com/gitlab-org/gitlab/-/issues/222808
def enable_ssl_verification=(_value)
self.properties.delete('enable_ssl_verification') # Remove unused key
end
def webhook_url
"#{buildkite_endpoint('webhook')}/deliver/#{webhook_token}"
end
......
......@@ -248,8 +248,14 @@ module API
name: :project_url,
type: String,
desc: 'The Buildkite pipeline URL'
},
{
required: false,
name: :enable_ssl_verification,
type: Boolean,
desc: 'DEPRECATED: This parameter has no effect since SSL verification will always be enabled'
}
],
],
'campfire' => [
{
required: true,
......
......@@ -57,12 +57,13 @@ RSpec.describe BuildkiteService, :use_clean_rails_memory_store_caching do
end
it 'always activates SSL verification after saved' do
service.create_service_hook(enable_ssl_verification: false)
service.enable_ssl_verification = false
service.active = true
service.save!
expect(service.reload.enable_ssl_verification).to be true
expect { service.save! }
.to change { service.service_hook.enable_ssl_verification }.from(false).to(true)
end
describe '#webhook_url' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment