Skip to content
Snippets Groups Projects
Commit fed29117 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre
Browse files

Rename SlackNotificationService back to SlackService

parent 1139da27
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -96,7 +96,7 @@ class Project < ActiveRecord::Base
has_one :mattermost_slash_commands_service, dependent: :destroy
has_one :mattermost_notification_service, dependent: :destroy
has_one :slack_slash_commands_service, dependent: :destroy
has_one :slack_notification_service, dependent: :destroy
has_one :slack_service, dependent: :destroy
has_one :buildkite_service, dependent: :destroy
has_one :bamboo_service, dependent: :destroy
has_one :teamcity_service, dependent: :destroy
Loading
Loading
class SlackNotificationService < ChatNotificationService
class SlackService < ChatNotificationService
def title
'Slack notifications'
end
Loading
Loading
@@ -8,7 +8,7 @@ class SlackNotificationService < ChatNotificationService
end
 
def to_param
'slack_notification'
'slack'
end
 
def help
Loading
Loading
Loading
Loading
@@ -222,7 +222,7 @@ class Service < ActiveRecord::Base
pushover
redmine
slack_slash_commands
slack_notification
slack
teamcity
]
end
Loading
Loading
Loading
Loading
@@ -5,7 +5,7 @@ class MoveSlackServiceToWebhook < ActiveRecord::Migration
DOWNTIME_REASON = 'Move old fields "token" and "subdomain" to one single field "webhook"'
 
def change
SlackNotificationService.all.each do |slack_service|
SlackService.all.each do |slack_service|
if ["token", "subdomain"].all? { |property| slack_service.properties.key? property }
token = slack_service.properties['token']
subdomain = slack_service.properties['subdomain']
Loading
Loading
class ChangeSlackServiceToSlackNotificationService < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
 
DOWNTIME = true
DOWNTIME_REASON = 'Rename SlackService to SlackNotificationService'
DOWNTIME = false
 
def up
execute("UPDATE services SET type = 'SlackNotificationService' WHERE type = 'SlackService'")
end
def down
execute("UPDATE services SET type = 'SlackService' WHERE type = 'SlackNotificationService'")
# This migration is a no-op, as it existed in an RC but we renamed
# SlackNotificationService back to SlackService:
# https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/8191#note_20310845
def change
end
end
Loading
Loading
@@ -480,7 +480,7 @@ module API
desc: 'The description of the tracker'
}
],
'slack-notification' => [
'slack' => [
{
required: true,
name: :webhook,
Loading
Loading
No preview for this file type
Loading
Loading
@@ -2,8 +2,8 @@ require 'spec_helper'
 
feature 'Projects > Slack service > Setup events', feature: true do
let(:user) { create(:user) }
let(:service) { SlackNotificationService.new }
let(:project) { create(:project, slack_notification_service: service) }
let(:service) { SlackService.new }
let(:project) { create(:project, slack_service: service) }
 
background do
service.fields
Loading
Loading
Loading
Loading
@@ -137,7 +137,7 @@ project:
- assembla_service
- asana_service
- gemnasium_service
- slack_notification_service
- slack_service
- mattermost_notification_service
- buildkite_service
- bamboo_service
Loading
Loading
require 'spec_helper'
 
describe SlackNotificationService, models: true do
describe SlackService, models: true do
it_behaves_like "slack or mattermost notifications"
end
Loading
Loading
@@ -21,7 +21,7 @@ describe Project, models: true do
it { is_expected.to have_many(:hooks).dependent(:destroy) }
it { is_expected.to have_many(:protected_branches).dependent(:destroy) }
it { is_expected.to have_one(:forked_project_link).dependent(:destroy) }
it { is_expected.to have_one(:slack_notification_service).dependent(:destroy) }
it { is_expected.to have_one(:slack_service).dependent(:destroy) }
it { is_expected.to have_one(:mattermost_notification_service).dependent(:destroy) }
it { is_expected.to have_one(:pushover_service).dependent(:destroy) }
it { is_expected.to have_one(:asana_service).dependent(:destroy) }
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment