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:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-11-17 14:33:21 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-11-17 14:33:21 +0300
commit7021455bd1ed7b125c55eb1b33c5a01f2bc55ee0 (patch)
tree5bdc2229f5198d516781f8d24eace62fc7e589e9 /app/models/integrations/slack.rb
parent185b095e93520f96e9cfc31d9c3e69b498cdab7c (diff)
Add latest changes from gitlab-org/gitlab@15-6-stable-eev15.6.0-rc42
Diffstat (limited to 'app/models/integrations/slack.rb')
-rw-r--r--app/models/integrations/slack.rb63
1 files changed, 3 insertions, 60 deletions
diff --git a/app/models/integrations/slack.rb b/app/models/integrations/slack.rb
index c254ea379bb..89326b8174f 100644
--- a/app/models/integrations/slack.rb
+++ b/app/models/integrations/slack.rb
@@ -1,17 +1,8 @@
# frozen_string_literal: true
module Integrations
- class Slack < BaseChatNotification
+ class Slack < BaseSlackNotification
include SlackMattermostNotifier
- extend ::Gitlab::Utils::Override
-
- SUPPORTED_EVENTS_FOR_USAGE_LOG = %w[
- push issue confidential_issue merge_request note confidential_note
- tag_push wiki_page deployment
- ].freeze
- SNOWPLOW_EVENT_CATEGORY = self.name
-
- prop_accessor EVENT_CHANNEL['alert']
def title
'Slack notifications'
@@ -25,57 +16,9 @@ module Integrations
'slack'
end
- def default_channel_placeholder
- _('#general, #development')
- end
-
- def webhook_placeholder
+ override :webhook_help
+ def webhook_help
'https://hooks.slack.com/services/…'
end
-
- def supported_events
- additional = []
- additional << 'alert'
-
- super + additional
- end
-
- def get_message(object_kind, data)
- return Integrations::ChatMessage::AlertMessage.new(data) if object_kind == 'alert'
-
- super
- end
-
- override :log_usage
- def log_usage(event, user_id)
- return unless user_id
-
- return unless SUPPORTED_EVENTS_FOR_USAGE_LOG.include?(event)
-
- key = "i_ecosystem_slack_service_#{event}_notification"
-
- Gitlab::UsageDataCounters::HLLRedisCounter.track_event(key, values: user_id)
-
- return unless Feature.enabled?(:route_hll_to_snowplow_phase2)
-
- optional_arguments = {
- project: project,
- namespace: group || project&.namespace
- }.compact
-
- Gitlab::Tracking.event(
- SNOWPLOW_EVENT_CATEGORY,
- Integration::SNOWPLOW_EVENT_ACTION,
- label: Integration::SNOWPLOW_EVENT_LABEL,
- property: key,
- user: User.find(user_id),
- **optional_arguments
- )
- end
-
- override :configurable_channels?
- def configurable_channels?
- true
- end
end
end