Commit 41fe5d24 authored by Markus Koller's avatar Markus Koller

Merge branch '217581-ignore-default-from-services' into 'master'

Ignore default column from services table

See merge request gitlab-org/gitlab!38203
parents 4b1d9486 a81914c7
......@@ -10,6 +10,7 @@ class Service < ApplicationRecord
include IgnorableColumns
ignore_columns %i[title description], remove_with: '13.4', remove_after: '2020-09-22'
ignore_columns %i[default], remove_with: '13.5', remove_after: '2020-10-22'
SERVICE_NAMES = %w[
alerts asana assembla bamboo bugzilla buildkite campfire confluence custom_issue_tracker discord
......
......@@ -96,7 +96,7 @@ module Admin
# rubocop: disable CodeReuse/ActiveRecord
def run_callbacks(batch)
if active_external_issue_tracker?
if integration.issue_tracker?
Project.where(id: batch).update_all(has_external_issue_tracker: true)
end
......@@ -106,10 +106,6 @@ module Admin
end
# rubocop: enable CodeReuse/ActiveRecord
def active_external_issue_tracker?
integration.issue_tracker? && !integration.default
end
def active_external_wiki?
integration.type == 'ExternalWikiService'
end
......
......@@ -66,7 +66,7 @@ module Projects
# rubocop: disable CodeReuse/ActiveRecord
def run_callbacks(batch)
if active_external_issue_tracker?
if template.issue_tracker?
Project.where(id: batch).update_all(has_external_issue_tracker: true)
end
......@@ -76,10 +76,6 @@ module Projects
end
# rubocop: enable CodeReuse/ActiveRecord
def active_external_issue_tracker?
template.issue_tracker? && !template.default
end
def active_external_wiki?
template.type == 'ExternalWikiService'
end
......
......@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec.describe Admin::PropagateIntegrationService do
describe '.propagate' do
let(:excluded_attributes) { %w[id project_id inherit_from_id instance created_at updated_at title description] }
let(:excluded_attributes) { %w[id project_id inherit_from_id instance created_at updated_at default] }
let!(:project) { create(:project) }
let!(:instance_integration) do
JiraService.create!(
......
......@@ -20,7 +20,7 @@ RSpec.describe Projects::PropagateServiceTemplate do
end
let!(:project) { create(:project) }
let(:excluded_attributes) { %w[id project_id template created_at updated_at title description] }
let(:excluded_attributes) { %w[id project_id template created_at updated_at default] }
it 'creates services for projects' do
expect(project.pushover_service).to be_nil
......@@ -120,7 +120,7 @@ RSpec.describe Projects::PropagateServiceTemplate do
describe 'external tracker' do
it 'updates the project external tracker' do
service_template.update!(category: 'issue_tracker', default: false)
service_template.update!(category: 'issue_tracker')
expect { described_class.propagate(service_template) }
.to change { project.reload.has_external_issue_tracker }.to(true)
......
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