Commit cb4c3fa0 authored by David Fernandez's avatar David Fernandez Committed by Sean McGivern

Remove the packages_finder_helper_deploy_token feature flag

Update the related specs

Changelog: other
parent 530a93a0
......@@ -29,7 +29,7 @@ module Packages
end
def projects_visible_to_reporters(user, within_group:)
if user.is_a?(DeployToken) && Feature.enabled?(:packages_finder_helper_deploy_token, default_enabled: :yaml)
if user.is_a?(DeployToken)
user.accessible_projects
else
within_group.all_projects
......
---
title: Removed packages_finder_helper_deploy_token feature flag
merge_request: 62189
author:
type: other
---
name: packages_finder_helper_deploy_token
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/58497
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/326808
milestone: '13.11'
type: development
group: group::package
default_enabled: true
......@@ -113,7 +113,6 @@ RSpec.describe ::Packages::FinderHelper do
let_it_be(:user) { create(:deploy_token, :group, read_package_registry: true) }
let_it_be(:group_deploy_token) { create(:group_deploy_token, deploy_token: user, group: group) }
shared_examples 'handling all conditions' do
where(:group_visibility, :subgroup_visibility, :project2_visibility, :shared_example_name) do
'PUBLIC' | 'PUBLIC' | 'PUBLIC' | 'returning both packages'
'PUBLIC' | 'PUBLIC' | 'PRIVATE' | 'returning both packages'
......@@ -132,24 +131,6 @@ RSpec.describe ::Packages::FinderHelper do
it_behaves_like params[:shared_example_name]
end
end
context 'with packages_finder_helper_deploy_token enabled' do
before do
expect(group).not_to receive(:all_projects)
end
it_behaves_like 'handling all conditions'
end
context 'with packages_finder_helper_deploy_token disabled' do
before do
stub_feature_flags(packages_finder_helper_deploy_token: false)
expect(group).to receive(:all_projects).and_call_original
end
it_behaves_like 'handling all conditions'
end
end
end
describe '#projects_visible_to_user' do
......@@ -236,7 +217,6 @@ RSpec.describe ::Packages::FinderHelper do
let_it_be(:user) { create(:deploy_token, :group, read_package_registry: true) }
let_it_be(:group_deploy_token) { create(:group_deploy_token, deploy_token: user, group: group) }
shared_examples 'handling all conditions' do
where(:group_visibility, :subgroup_visibility, :project2_visibility, :shared_example_name) do
'PUBLIC' | 'PUBLIC' | 'PUBLIC' | 'returning both projects'
'PUBLIC' | 'PUBLIC' | 'PRIVATE' | 'returning both projects'
......@@ -255,23 +235,5 @@ RSpec.describe ::Packages::FinderHelper do
it_behaves_like params[:shared_example_name]
end
end
context 'with packages_finder_helper_deploy_token enabled' do
before do
expect(group).not_to receive(:all_projects)
end
it_behaves_like 'handling all conditions'
end
context 'with packages_finder_helper_deploy_token disabled' do
before do
stub_feature_flags(packages_finder_helper_deploy_token: false)
expect(group).to receive(:all_projects).and_call_original
end
it_behaves_like 'handling all conditions'
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