diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-14 15:07:55 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-14 15:07:55 +0000 |
commit | 85e494935a8726dc98bb19ffa584488420e5011e (patch) | |
tree | 5acf279dab81a2363e4504a9679c32c16510542b /lib/sentry/client | |
parent | 4ce0bee95df15c05cdb0d777eba31fe753bc443b (diff) | |
download | gitlab-ce-85e494935a8726dc98bb19ffa584488420e5011e.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/sentry/client')
-rw-r--r-- | lib/sentry/client/event.rb | 9 | ||||
-rw-r--r-- | lib/sentry/client/issue.rb | 20 | ||||
-rw-r--r-- | lib/sentry/client/projects.rb | 9 |
3 files changed, 5 insertions, 33 deletions
diff --git a/lib/sentry/client/event.rb b/lib/sentry/client/event.rb index 8bcada5a9ce..01dfaa25969 100644 --- a/lib/sentry/client/event.rb +++ b/lib/sentry/client/event.rb @@ -4,20 +4,13 @@ module Sentry class Client module Event def issue_latest_event(issue_id:) - latest_event = http_get(issue_latest_event_api_url(issue_id))[:body] + latest_event = http_get(api_urls.issue_latest_event_url(issue_id))[:body] map_to_event(latest_event) end private - def issue_latest_event_api_url(issue_id) - latest_event_url = URI(url) - latest_event_url.path = "/api/0/issues/#{issue_id}/events/latest/" - - latest_event_url - end - def map_to_event(event) stack_trace = parse_stack_trace(event) diff --git a/lib/sentry/client/issue.rb b/lib/sentry/client/issue.rb index b3b3776624b..1c5d88e8862 100644 --- a/lib/sentry/client/issue.rb +++ b/lib/sentry/client/issue.rb @@ -35,14 +35,14 @@ module Sentry end def update_issue(issue_id:, params:) - http_put(issue_api_url(issue_id), params)[:body] + http_put(api_urls.issue_url(issue_id), params)[:body] end private def get_issues(**keyword_args) response = http_get( - issues_api_url, + api_urls.issues_url, query: list_issue_sentry_query(keyword_args) ) @@ -72,21 +72,7 @@ module Sentry end def get_issue(issue_id:) - http_get(issue_api_url(issue_id))[:body] - end - - def issues_api_url - issues_url = URI("#{url}/issues/") - issues_url.path.squeeze!('/') - - issues_url - end - - def issue_api_url(issue_id) - issue_url = URI(url) - issue_url.path = "/api/0/issues/#{CGI.escape(issue_id.to_s)}/" - - issue_url + http_get(api_urls.issue_url(issue_id))[:body] end def parse_gitlab_issue(plugin_issues) diff --git a/lib/sentry/client/projects.rb b/lib/sentry/client/projects.rb index 68f8fe0f9c9..e686d4ff715 100644 --- a/lib/sentry/client/projects.rb +++ b/lib/sentry/client/projects.rb @@ -14,14 +14,7 @@ module Sentry private def get_projects - http_get(projects_api_url)[:body] - end - - def projects_api_url - projects_url = URI(url) - projects_url.path = '/api/0/projects/' - - projects_url + http_get(api_urls.projects_url)[:body] end def map_to_projects(projects) |