Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sentry/client/issue_link.rb')
-rw-r--r--lib/sentry/client/issue_link.rb52
1 files changed, 0 insertions, 52 deletions
diff --git a/lib/sentry/client/issue_link.rb b/lib/sentry/client/issue_link.rb
deleted file mode 100644
index 91498c19f8b..00000000000
--- a/lib/sentry/client/issue_link.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-# frozen_string_literal: true
-
-module Sentry
- class Client
- module IssueLink
- # Creates a link in Sentry corresponding to the provided
- # Sentry issue and GitLab issue
- # @param integration_id [Integer, nil] Representing a global
- # GitLab integration in Sentry. Nil for plugins.
- # @param sentry_issue_id [Integer] Id for an issue from Sentry
- # @param issue [Issue] Issue for which the link should be created
- def create_issue_link(integration_id, sentry_issue_id, issue)
- return create_plugin_link(sentry_issue_id, issue) unless integration_id
-
- create_global_integration_link(integration_id, sentry_issue_id, issue)
- end
-
- private
-
- def create_global_integration_link(integration_id, sentry_issue_id, issue)
- issue_link_url = global_integration_link_api_url(integration_id, sentry_issue_id)
-
- params = {
- project: issue.project.id,
- externalIssue: "#{issue.project.id}##{issue.iid}"
- }
-
- http_put(issue_link_url, params)
- end
-
- def global_integration_link_api_url(integration_id, sentry_issue_id)
- issue_link_url = URI(url)
- issue_link_url.path = "/api/0/groups/#{sentry_issue_id}/integrations/#{integration_id}/"
-
- issue_link_url
- end
-
- def create_plugin_link(sentry_issue_id, issue)
- issue_link_url = plugin_link_api_url(sentry_issue_id)
-
- http_post(issue_link_url, issue_id: issue.iid)
- end
-
- def plugin_link_api_url(sentry_issue_id)
- issue_link_url = URI(url)
- issue_link_url.path = "/api/0/issues/#{sentry_issue_id}/plugins/gitlab/link/"
-
- issue_link_url
- end
- end
- end
-end