Commit 0b919a98 authored by Erick Banks's avatar Erick Banks Committed by Sanad Liaquat

Turn off autodevops for forked project source

I'm implementing Mark's suggestion of using the api to set
'auto_devops_enabled' of the fork's source project so that
we don't ever see a pipeline that requires us to wait
before we can merge the fork.
parent 99dfc97f
......@@ -54,11 +54,23 @@ module QA
end
end
private
include Support::Api
attr_writer :api_resource, :api_response
def api_put(body = api_put_body)
response = put(
Runtime::API::Request.new(api_client, api_put_path).url,
body)
unless response.code == HTTP_STATUS_OK
raise ResourceFabricationFailedError, "Updating #{self.class.name} using the API failed (#{response.code}) with `#{response}`."
end
process_api_response(parse_body(response))
end
private
def resource_web_url(resource)
resource.fetch(:web_url) do
raise ResourceURLMissingError, "API resource for #{self.class.name} does not expose a `web_url` property: `#{resource}`."
......@@ -92,18 +104,6 @@ module QA
process_api_response(parse_body(response))
end
def api_put
response = put(
Runtime::API::Request.new(api_client, api_put_path).url,
api_put_body)
unless response.code == HTTP_STATUS_OK
raise ResourceFabricationFailedError, "Updating #{self.class.name} using the API failed (#{response.code}) with `#{response}`."
end
process_api_response(parse_body(response))
end
def api_delete
url = Runtime::API::Request.new(api_client, api_delete_path).url
response = delete(url)
......
......@@ -10,6 +10,8 @@ module QA
merge_request.fork_branch = 'feature-branch'
end
merge_request.project.api_put(auto_devops_enabled: false)
Page::Main::Menu.perform(&:sign_out)
Page::Main::Login.perform(&:sign_in_using_credentials)
......
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