Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
cb4c3fa0
Commit
cb4c3fa0
authored
May 21, 2021
by
David Fernandez
Committed by
Sean McGivern
May 21, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove the packages_finder_helper_deploy_token feature flag
Update the related specs Changelog: other
parent
530a93a0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
69 deletions
+28
-69
app/finders/concerns/packages/finder_helper.rb
app/finders/concerns/packages/finder_helper.rb
+1
-1
changelogs/unreleased/326808-cleanup-feature-flag.yml
changelogs/unreleased/326808-cleanup-feature-flag.yml
+5
-0
config/feature_flags/development/packages_finder_helper_deploy_token.yml
...flags/development/packages_finder_helper_deploy_token.yml
+0
-8
spec/finders/concerns/packages/finder_helper_spec.rb
spec/finders/concerns/packages/finder_helper_spec.rb
+22
-60
No files found.
app/finders/concerns/packages/finder_helper.rb
View file @
cb4c3fa0
...
...
@@ -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
...
...
changelogs/unreleased/326808-cleanup-feature-flag.yml
0 → 100644
View file @
cb4c3fa0
---
title
:
Removed packages_finder_helper_deploy_token feature flag
merge_request
:
62189
author
:
type
:
other
config/feature_flags/development/packages_finder_helper_deploy_token.yml
deleted
100644 → 0
View file @
530a93a0
---
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
spec/finders/concerns/packages/finder_helper_spec.rb
View file @
cb4c3fa0
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment