Commit 9294ac4d authored by Kerri Miller's avatar Kerri Miller

Merge branch '283875_remove_reset_integrations_feature_flag' into 'master'

Remove reset_integrations feature flag

See merge request gitlab-org/gitlab!51507
parents 35fed52e d8685ee8
...@@ -76,6 +76,8 @@ module ServicesHelper ...@@ -76,6 +76,8 @@ module ServicesHelper
end end
def scoped_reset_integration_path(integration, group: nil) def scoped_reset_integration_path(integration, group: nil)
return '' unless integration.persisted?
if group.present? if group.present?
reset_group_settings_integration_path(group, integration) reset_group_settings_integration_path(group, integration)
else else
...@@ -102,7 +104,7 @@ module ServicesHelper ...@@ -102,7 +104,7 @@ module ServicesHelper
cancel_path: scoped_integrations_path, cancel_path: scoped_integrations_path,
can_test: integration.can_test?.to_s, can_test: integration.can_test?.to_s,
test_path: scoped_test_integration_path(integration), test_path: scoped_test_integration_path(integration),
reset_path: reset_integration?(integration, group: group) ? scoped_reset_integration_path(integration, group: group) : '' reset_path: scoped_reset_integration_path(integration, group: group)
} }
end end
...@@ -126,10 +128,6 @@ module ServicesHelper ...@@ -126,10 +128,6 @@ module ServicesHelper
!Gitlab.com? !Gitlab.com?
end end
def reset_integration?(integration, group: nil)
integration.persisted? && Feature.enabled?(:reset_integrations, group, type: :development)
end
extend self extend self
private private
......
---
title: Allow resetting group and instance level integrations
merge_request: 51507
author:
type: added
---
name: reset_integrations
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/47546
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/283875
milestone: '13.7'
type: development
group: group::ecosystem
default_enabled: false
...@@ -25,6 +25,10 @@ RSpec.describe ServicesHelper do ...@@ -25,6 +25,10 @@ RSpec.describe ServicesHelper do
:integration_level :integration_level
) )
end end
specify do
expect(subject[:reset_path]).to eq(helper.scoped_reset_integration_path(integration))
end
end end
end end
...@@ -47,52 +51,12 @@ RSpec.describe ServicesHelper do ...@@ -47,52 +51,12 @@ RSpec.describe ServicesHelper do
is_expected.to eq(reset_group_settings_integration_path(group, integration)) is_expected.to eq(reset_group_settings_integration_path(group, integration))
end end
end end
end
describe '#reset_integration?' do
let(:group) { nil }
subject { helper.reset_integration?(integration, group: group) }
context 'when integration is existing record' do
let_it_be(:integration) { create(:jira_service) }
context 'when `reset_integrations` is not enabled' do
it 'returns false' do
stub_feature_flags(reset_integrations: false)
is_expected.to eq(false)
end
end
context 'when `reset_integrations` is enabled' do context 'when a new integration is not persisted' do
it 'returns true' do
stub_feature_flags(reset_integrations: true)
is_expected.to eq(true)
end
end
context 'when `reset_integrations` is enabled for a group' do
let(:group) { build_stubbed(:group) }
it 'returns true' do
stub_feature_flags(reset_integrations: group)
is_expected.to eq(true)
end
end
end
context 'when integration is a new record' do
let_it_be(:integration) { build(:jira_service) } let_it_be(:integration) { build(:jira_service) }
context 'when `reset_integrations` is enabled' do it 'returns an empty string' do
it 'returns false' do is_expected.to eq('')
stub_feature_flags(reset_integrations: true)
is_expected.to eq(false)
end
end end
end end
end end
......
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