Commit 761d7c3c authored by Michael Kozono's avatar Michael Kozono

Merge branch 'add-update-sentry-api' into 'master'

Add Sentry Client HTTP PUT capability

See merge request gitlab-org/gitlab!22230
parents 170332c3 2b015e40
...@@ -71,9 +71,22 @@ module Sentry ...@@ -71,9 +71,22 @@ module Sentry
end end
def http_get(url, params = {}) def http_get(url, params = {})
response = handle_request_exceptions do http_request do
Gitlab::HTTP.get(url, **request_params.merge(params)) Gitlab::HTTP.get(url, **request_params.merge(params))
end end
end
def http_put(url, params = {})
http_request do
Gitlab::HTTP.put(url, **request_params.merge({ body: params }))
end
end
def http_request
response = handle_request_exceptions do
yield
end
handle_response(response) handle_response(response)
end end
......
...@@ -15,6 +15,10 @@ module Sentry ...@@ -15,6 +15,10 @@ module Sentry
http_get(issue_api_url(issue_id))[:body] http_get(issue_api_url(issue_id))[:body]
end end
def update_issue(issue_id:, params:)
http_put(issue_api_url(issue_id), params)[:body]
end
def issue_api_url(issue_id) def issue_api_url(issue_id)
issue_url = URI(url) issue_url = URI(url)
issue_url.path = "/api/0/issues/#{CGI.escape(issue_id.to_s)}/" issue_url.path = "/api/0/issues/#{CGI.escape(issue_id.to_s)}/"
......
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