From 015663b70f1bcdae4483e38c2beac884f92da5b8 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Mon, 6 Jan 2020 21:07:43 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- lib/sentry/client.rb | 15 ++++++++++++++- lib/sentry/client/issue.rb | 4 ++++ 2 files changed, 18 insertions(+), 1 deletion(-) (limited to 'lib/sentry') 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)}/" -- cgit v1.2.3