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,41 +113,22 @@ 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'
'PUBLIC' | 'PRIVATE' | 'PRIVATE' | 'returning both packages'
'PRIVATE' | 'PRIVATE' | 'PRIVATE' | 'returning both packages'
end
with_them do
before do
project2.update!(visibility_level: Gitlab::VisibilityLevel.const_get(project2_visibility, false))
subgroup.update!(visibility_level: Gitlab::VisibilityLevel.const_get(subgroup_visibility, false))
project1.update!(visibility_level: Gitlab::VisibilityLevel.const_get(group_visibility, false))
group.update!(visibility_level: Gitlab::VisibilityLevel.const_get(group_visibility, false))
end
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'
where(:group_visibility, :subgroup_visibility, :project2_visibility, :shared_example_name) do
'PUBLIC' | 'PUBLIC' | 'PUBLIC' | 'returning both packages'
'PUBLIC' | 'PUBLIC' | 'PRIVATE' | 'returning both packages'
'PUBLIC' | 'PRIVATE' | 'PRIVATE' | 'returning both packages'
'PRIVATE' | 'PRIVATE' | 'PRIVATE' | 'returning both packages'
end
context 'with packages_finder_helper_deploy_token disabled' do
with_them do
before do
stub_feature_flags(packages_finder_helper_deploy_token: false)
expect(group).to receive(:all_projects).and_call_original
project2.update!(visibility_level: Gitlab::VisibilityLevel.const_get(project2_visibility, false))
subgroup.update!(visibility_level: Gitlab::VisibilityLevel.const_get(subgroup_visibility, false))
project1.update!(visibility_level: Gitlab::VisibilityLevel.const_get(group_visibility, false))
group.update!(visibility_level: Gitlab::VisibilityLevel.const_get(group_visibility, false))
end
it_behaves_like 'handling all conditions'
it_behaves_like params[:shared_example_name]
end
end
end
......@@ -236,41 +217,22 @@ 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'
'PUBLIC' | 'PRIVATE' | 'PRIVATE' | 'returning both projects'
'PRIVATE' | 'PRIVATE' | 'PRIVATE' | 'returning both projects'
end
with_them do
before do
project2.update!(visibility_level: Gitlab::VisibilityLevel.const_get(project2_visibility, false))
subgroup.update!(visibility_level: Gitlab::VisibilityLevel.const_get(subgroup_visibility, false))
project1.update!(visibility_level: Gitlab::VisibilityLevel.const_get(group_visibility, false))
group.update!(visibility_level: Gitlab::VisibilityLevel.const_get(group_visibility, false))
end
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'
where(:group_visibility, :subgroup_visibility, :project2_visibility, :shared_example_name) do
'PUBLIC' | 'PUBLIC' | 'PUBLIC' | 'returning both projects'
'PUBLIC' | 'PUBLIC' | 'PRIVATE' | 'returning both projects'
'PUBLIC' | 'PRIVATE' | 'PRIVATE' | 'returning both projects'
'PRIVATE' | 'PRIVATE' | 'PRIVATE' | 'returning both projects'
end
context 'with packages_finder_helper_deploy_token disabled' do
with_them do
before do
stub_feature_flags(packages_finder_helper_deploy_token: false)
expect(group).to receive(:all_projects).and_call_original
project2.update!(visibility_level: Gitlab::VisibilityLevel.const_get(project2_visibility, false))
subgroup.update!(visibility_level: Gitlab::VisibilityLevel.const_get(subgroup_visibility, false))
project1.update!(visibility_level: Gitlab::VisibilityLevel.const_get(group_visibility, false))
group.update!(visibility_level: Gitlab::VisibilityLevel.const_get(group_visibility, false))
end
it_behaves_like 'handling all conditions'
it_behaves_like params[:shared_example_name]
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