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
0317654a
Commit
0317654a
authored
Jun 10, 2021
by
Jaime Martinez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove allow_group_deploy_token feature flag
Changelog: removed
parent
dc41ce85
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
55 deletions
+31
-55
app/models/group_deploy_token.rb
app/models/group_deploy_token.rb
+0
-2
config/feature_flags/development/allow_group_deploy_token.yml
...ig/feature_flags/development/allow_group_deploy_token.yml
+0
-8
spec/models/deploy_token_spec.rb
spec/models/deploy_token_spec.rb
+31
-45
No files found.
app/models/group_deploy_token.rb
View file @
0317654a
...
...
@@ -9,8 +9,6 @@ class GroupDeployToken < ApplicationRecord
validates
:deploy_token_id
,
uniqueness:
{
scope:
[
:group_id
]
}
def
has_access_to?
(
requested_project
)
return
false
unless
Feature
.
enabled?
(
:allow_group_deploy_token
,
default_enabled:
true
)
requested_project_group
=
requested_project
&
.
group
return
false
unless
requested_project_group
return
true
if
requested_project_group
.
id
==
group_id
...
...
config/feature_flags/development/allow_group_deploy_token.yml
deleted
100644 → 0
View file @
dc41ce85
---
name
:
allow_group_deploy_token
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/23460
rollout_issue_url
:
milestone
:
'
12.8'
type
:
development
group
:
group::release
default_enabled
:
true
spec/models/deploy_token_spec.rb
View file @
0317654a
...
...
@@ -248,68 +248,54 @@ RSpec.describe DeployToken do
deploy_token
.
groups
<<
group
end
context
'and the allow_group_deploy_token feature flag is turned off'
do
it
'is false'
do
stub_feature_flags
(
allow_group_deploy_token:
false
)
is_expected
.
to
be_falsy
end
context
'and the passed-in project does not belong to any group'
do
it
{
is_expected
.
to
be_falsy
}
end
context
'and the allow_group_deploy_token feature flag is turned on'
do
before
do
stub_feature_flags
(
allow_group_deploy_token:
true
)
end
context
'and the passed-in project belongs to the token group'
do
it
'is true'
do
group
.
projects
<<
project
context
'and the passed-in project does not belong to any group'
do
it
{
is_expected
.
to
be_falsy
}
is_expected
.
to
be_truthy
end
end
context
'and the passed-in project belongs to the token
group'
do
it
'is true'
do
group
.
projects
<<
project
context
'and the passed-in project belongs to a sub
group'
do
let
(
:child_group
)
{
create
(
:group
,
parent_id:
group
.
id
)
}
let
(
:grandchild_group
)
{
create
(
:group
,
parent_id:
child_group
.
id
)
}
is_expected
.
to
be_truthy
end
before
do
grandchild_group
.
projects
<<
project
end
context
'and the passed-in project belongs to a subgroup'
do
let
(
:child_group
)
{
create
(
:group
,
parent_id:
group
.
id
)
}
let
(
:grandchild_group
)
{
create
(
:group
,
parent_id:
child_group
.
id
)
}
before
do
grandchild_group
.
projects
<<
project
end
context
'and the token group is an ancestor (grand-parent) of this group'
do
it
{
is_expected
.
to
be_truthy
}
end
context
'and the token group is an ancestor (grand-parent) of this group'
do
it
{
is_expected
.
to
be_truthy
}
end
context
'and the token group is not ancestor of this group'
do
let
(
:child2_group
)
{
create
(
:group
,
parent_id:
group
.
id
)
}
context
'and the token group is not ancestor of this group'
do
let
(
:child2_group
)
{
create
(
:group
,
parent_id:
group
.
id
)
}
it
'is false'
do
deploy_token
.
groups
=
[
child2_group
]
it
'is false'
do
deploy_token
.
groups
=
[
child2_group
]
is_expected
.
to
be_falsey
end
is_expected
.
to
be_falsey
end
end
end
context
'and the passed-in project does not belong to the token group'
do
it
{
is_expected
.
to
be_falsy
}
end
context
'and the passed-in project does not belong to the token group'
do
it
{
is_expected
.
to
be_falsy
}
end
context
'and the project belongs to a group that is parent of the token group'
do
let
(
:super_group
)
{
create
(
:group
)
}
let
(
:deploy_token
)
{
create
(
:deploy_token
,
:group
)
}
let
(
:group
)
{
create
(
:group
,
parent_id:
super_group
.
id
)
}
context
'and the project belongs to a group that is parent of the token group'
do
let
(
:super_group
)
{
create
(
:group
)
}
let
(
:deploy_token
)
{
create
(
:deploy_token
,
:group
)
}
let
(
:group
)
{
create
(
:group
,
parent_id:
super_group
.
id
)
}
it
'is false'
do
super_group
.
projects
<<
project
it
'is false'
do
super_group
.
projects
<<
project
is_expected
.
to
be_falsey
end
is_expected
.
to
be_falsey
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