diff options
Diffstat (limited to 'qa/qa/tools/ci/helpers.rb')
-rw-r--r-- | qa/qa/tools/ci/helpers.rb | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/qa/qa/tools/ci/helpers.rb b/qa/qa/tools/ci/helpers.rb index 55bb123de20..4650532f89a 100644 --- a/qa/qa/tools/ci/helpers.rb +++ b/qa/qa/tools/ci/helpers.rb @@ -17,33 +17,6 @@ module QA source: "CI Tools" ) end - - # Api get request - # - # @param [String] path - # @param [Hash] args - # @return [Hash, Array] - def api_get(path, **args) - response = get("#{api_url}/#{path}", { headers: { "PRIVATE-TOKEN" => access_token }, **args }) - response = response.follow_redirection if response.code == Support::API::HTTP_STATUS_PERMANENT_REDIRECT - raise "Request failed: '#{response.body}'" unless response.code == Support::API::HTTP_STATUS_OK - - args[:raw_response] ? response : parse_body(response) - end - - # Gitlab api url - # - # @return [String] - def api_url - @api_url ||= ENV.fetch('CI_API_V4_URL', 'https://gitlab.com/api/v4') - end - - # Api access token - # - # @return [String] - def access_token - @access_token ||= ENV.fetch('QA_GITLAB_CI_TOKEN') { raise('Variable QA_GITLAB_CI_TOKEN missing') } - end end end end |