summaryrefslogtreecommitdiff
path: root/lib/sentry
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-06 21:07:43 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-06 21:07:43 +0000
commit015663b70f1bcdae4483e38c2beac884f92da5b8 (patch)
tree6dd5a59c7f9a27c3cca22801ca30bf3dd8f9b401 /lib/sentry
parent5eb11b697d7ee280b0b5c2ff9a1850a3b5e9b7e3 (diff)
downloadgitlab-ce-015663b70f1bcdae4483e38c2beac884f92da5b8.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/sentry')
-rw-r--r--lib/sentry/client.rb15
-rw-r--r--lib/sentry/client/issue.rb4
2 files changed, 18 insertions, 1 deletions
diff --git a/lib/sentry/client.rb b/lib/sentry/client.rb
index 65bedbf9e0f..211c828ccc3 100644
--- a/lib/sentry/client.rb
+++ b/lib/sentry/client.rb
@@ -71,9 +71,22 @@ module Sentry
end
def http_get(url, params = {})
- response = handle_request_exceptions do
+ http_request do
Gitlab::HTTP.get(url, **request_params.merge(params))
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)
end
diff --git a/lib/sentry/client/issue.rb b/lib/sentry/client/issue.rb
index 28e87ab18a1..4a11c87faa4 100644
--- a/lib/sentry/client/issue.rb
+++ b/lib/sentry/client/issue.rb
@@ -15,6 +15,10 @@ module Sentry
http_get(issue_api_url(issue_id))[:body]
end
+ def update_issue(issue_id:, params:)
+ http_put(issue_api_url(issue_id), params)[:body]
+ end
+
def issue_api_url(issue_id)
issue_url = URI(url)
issue_url.path = "/api/0/issues/#{CGI.escape(issue_id.to_s)}/"