Commit 3a2073f9 authored by James Fargher's avatar James Fargher

Merge branch '220934-confluence-wiki-remove-flag' into 'master'

Remove confluence_integration feature flag

See merge request gitlab-org/gitlab!36781
parents bbafcb12 3506d82b
......@@ -384,7 +384,9 @@ class Project < ApplicationRecord
delegate :default_git_depth, :default_git_depth=, to: :ci_cd_settings, prefix: :ci
delegate :forward_deployment_enabled, :forward_deployment_enabled=, :forward_deployment_enabled?, to: :ci_cd_settings
delegate :actual_limits, :actual_plan_name, to: :namespace, allow_nil: true
delegate :allow_merge_on_skipped_pipeline, :allow_merge_on_skipped_pipeline?, :allow_merge_on_skipped_pipeline=, to: :project_setting
delegate :allow_merge_on_skipped_pipeline, :allow_merge_on_skipped_pipeline?,
:allow_merge_on_skipped_pipeline=, :has_confluence?,
to: :project_setting
delegate :active?, to: :prometheus_service, allow_nil: true, prefix: true
# Validations
......@@ -1287,11 +1289,6 @@ class Project < ApplicationRecord
update_column(:has_external_wiki, services.external_wikis.any?) if Gitlab::Database.read_write?
end
def has_confluence?
ConfluenceService.feature_enabled?(self) && # rubocop:disable CodeReuse/ServiceClass
project_setting.has_confluence?
end
def find_or_initialize_services
available_services_names = Service.available_services_names - disabled_services
......@@ -1301,11 +1298,7 @@ class Project < ApplicationRecord
end
def disabled_services
strong_memoize(:disabled_services) do
[].tap do |disabled_services|
disabled_services.push(ConfluenceService.to_param) unless ConfluenceService.feature_enabled?(self) # rubocop:disable CodeReuse/ServiceClass
end
end
[]
end
def find_or_initialize_service(name)
......
......@@ -7,8 +7,6 @@ class ConfluenceService < Service
VALID_HOST_MATCH = %r{\A.+\.atlassian\.net\Z}.freeze
VALID_PATH_MATCH = %r{\A/wiki(/|\Z)}.freeze
FEATURE_FLAG = :confluence_integration
prop_accessor :confluence_url
validates :confluence_url, presence: true, if: :activated?
......@@ -16,10 +14,6 @@ class ConfluenceService < Service
after_commit :cache_project_has_confluence
def self.feature_enabled?(actor)
::Feature.enabled?(FEATURE_FLAG, actor)
end
def self.to_param
'confluence'
end
......
---
title: Add new Confluence integration for projects
merge_request: 36781
author:
type: added
......@@ -1042,32 +1042,6 @@ RSpec.describe Project do
end
end
describe '#has_confluence?' do
let_it_be(:project) { build_stubbed(:project) }
it 'returns false when project_setting.has_confluence property is false' do
project.project_setting.has_confluence = false
expect(project.has_confluence?).to be(false)
end
context 'when project_setting.has_confluence property is true' do
before do
project.project_setting.has_confluence = true
end
it 'returns true' do
expect(project.has_confluence?).to be(true)
end
it 'returns false when confluence integration feature flag is disabled' do
stub_feature_flags(ConfluenceService::FEATURE_FLAG => false)
expect(project.has_confluence?).to be(false)
end
end
end
describe '#external_wiki' do
let(:project) { create(:project) }
......@@ -5412,20 +5386,6 @@ RSpec.describe Project do
expect(services.count).to eq(2)
expect(services.map(&:title)).to eq(['JetBrains TeamCity CI', 'Pushover'])
end
describe 'interaction with the confluence integration feature flag' do
it 'contains a ConfluenceService when feature flag is enabled' do
stub_feature_flags(ConfluenceService::FEATURE_FLAG => true)
expect(subject.find_or_initialize_services).to include(ConfluenceService)
end
it 'does not contain a ConfluenceService when the confluence integration feature flag is disabled' do
stub_feature_flags(ConfluenceService::FEATURE_FLAG => false)
expect(subject.find_or_initialize_services).not_to include(ConfluenceService)
end
end
end
describe '#find_or_initialize_service' do
......
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