Commit b3507289 authored by Alex Kalderimis's avatar Alex Kalderimis

Rename slack_slash_commands service to integration

Renames project association from slack_slash_commands_service to
slack_slash_commands_integration.
parent 4cd6edf0
......@@ -52,7 +52,7 @@ class Integration < ApplicationRecord
packagist pipelines_email pivotaltracker pushover
mattermost mattermost_slash_commands microsoft_teams mock_ci mock_monitoring
redmine
slack
slack slack_slash_commands
].to_set.freeze
def self.renamed?(name)
......
......@@ -186,7 +186,7 @@ class Project < ApplicationRecord
has_one :pushover_integration, class_name: 'Integrations::Pushover'
has_one :redmine_integration, class_name: 'Integrations::Redmine'
has_one :slack_integration, class_name: 'Integrations::Slack'
has_one :slack_slash_commands_service, class_name: 'Integrations::SlackSlashCommands'
has_one :slack_slash_commands_integration, class_name: 'Integrations::SlackSlashCommands'
has_one :teamcity_service, class_name: 'Integrations::Teamcity'
has_one :unify_circuit_service, class_name: 'Integrations::UnifyCircuit'
has_one :webex_teams_service, class_name: 'Integrations::WebexTeams'
......
......@@ -159,7 +159,7 @@ module EE
project_features: { builds_access_level: ::ProjectFeature::ENABLED })
end
scope :with_slack_integration, -> { joins(:slack_integration) }
scope :with_slack_slash_commands_service, -> { joins(:slack_slash_commands_service) }
scope :with_slack_slash_commands_integration, -> { joins(:slack_slash_commands_integration) }
scope :with_prometheus_service, -> { joins(:prometheus_service) }
scope :aimed_for_deletion, -> (date) { where('marked_for_deletion_at <= ?', date).without_deleted }
scope :not_aimed_for_deletion, -> { where(marked_for_deletion_at: nil) }
......
......@@ -232,7 +232,7 @@ module EE
def usage_activity_by_stage_configure(time_period)
super.merge({
projects_slack_notifications_active: distinct_count(::Project.with_slack_integration.where(time_period), :creator_id),
projects_slack_slash_active: distinct_count(::Project.with_slack_slash_commands_service.where(time_period), :creator_id)
projects_slack_slash_active: distinct_count(::Project.with_slack_slash_commands_integration.where(time_period), :creator_id)
})
end
......
......@@ -260,7 +260,7 @@ RSpec.describe Gitlab::UsageData do
user = create(:user)
project = create(:project, creator: user)
create(:slack_integration, project: project)
create(:slack_slash_commands_service, project: project)
create(:slack_slash_commands_integration, project: project)
create(:prometheus_service, project: project)
end
......
......@@ -167,7 +167,7 @@ FactoryBot.define do
type { 'SlackService' }
end
factory :slack_slash_commands_service, class: 'Integrations::SlackSlashCommands' do
factory :slack_slash_commands_integration, class: 'Integrations::SlackSlashCommands' do
project
active { true }
type { 'SlackSlashCommandsService' }
......
......@@ -369,7 +369,7 @@ project:
- emails_on_push_integration
- pipelines_email_integration
- mattermost_slash_commands_integration
- slack_slash_commands_service
- slack_slash_commands_integration
- irker_integration
- packagist_integration
- pivotaltracker_integration
......
......@@ -19,7 +19,7 @@ RSpec.describe Integrations::SlackSlashCommands do
end
let(:service) do
project.create_slack_slash_commands_service(
project.create_slack_slash_commands_integration(
properties: { token: 'token' },
active: true
)
......
......@@ -55,7 +55,7 @@ RSpec.describe Project, factory_default: :keep do
it { is_expected.to have_one(:pivotaltracker_integration) }
it { is_expected.to have_one(:flowdock_integration) }
it { is_expected.to have_one(:assembla_integration) }
it { is_expected.to have_one(:slack_slash_commands_service) }
it { is_expected.to have_one(:slack_slash_commands_integration) }
it { is_expected.to have_one(:mattermost_slash_commands_integration) }
it { is_expected.to have_one(:buildkite_integration) }
it { is_expected.to have_one(:bamboo_integration) }
......
......@@ -239,7 +239,7 @@ RSpec.describe API::Services do
let(:service_name) { 'slack_slash_commands' }
before do
project.create_slack_slash_commands_service(
project.create_slack_slash_commands_integration(
active: true,
properties: { token: 'token' }
)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment