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
f45257e2
Commit
f45257e2
authored
Dec 11, 2020
by
Tiger
Committed by
Jose Vargas
Jan 04, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove :deploy_board licensed feature
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/47147
parent
5f181b2d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
22 deletions
+14
-22
app/policies/project_policy.rb
app/policies/project_policy.rb
+1
-0
ee/app/models/license.rb
ee/app/models/license.rb
+0
-2
ee/app/policies/ee/project_policy.rb
ee/app/policies/ee/project_policy.rb
+0
-6
ee/spec/models/ee/namespace_spec.rb
ee/spec/models/ee/namespace_spec.rb
+1
-1
ee/spec/models/license_spec.rb
ee/spec/models/license_spec.rb
+10
-11
ee/spec/support/helpers/ee/license_helpers.rb
ee/spec/support/helpers/ee/license_helpers.rb
+2
-2
No files found.
app/policies/project_policy.rb
View file @
f45257e2
...
...
@@ -240,6 +240,7 @@ class ProjectPolicy < BasePolicy
enable
:read_commit_status
enable
:read_build
enable
:read_container_image
enable
:read_deploy_board
enable
:read_pipeline
enable
:read_pipeline_schedule
enable
:read_environment
...
...
ee/app/models/license.rb
View file @
f45257e2
...
...
@@ -72,7 +72,6 @@ class License < ApplicationRecord
db_load_balancing
default_branch_protection_restriction_in_groups
default_project_deletion_protection
deploy_board
disable_name_update_for_users
email_additional_text
epics
...
...
@@ -189,7 +188,6 @@ class License < ApplicationRecord
# Add on codes that may occur in legacy licenses that don't have a plan yet.
FEATURES_FOR_ADD_ONS
=
{
'GitLab_Auditor_User'
=>
:auditor_user
,
'GitLab_DeployBoard'
=>
:deploy_board
,
'GitLab_FileLocks'
=>
:file_locks
,
'GitLab_Geo'
=>
:geo
}.
freeze
...
...
ee/app/policies/ee/project_policy.rb
View file @
f45257e2
...
...
@@ -12,9 +12,6 @@ module EE
with_scope
:subject
condition
(
:repository_mirrors_enabled
)
{
@subject
.
feature_available?
(
:repository_mirrors
)
}
with_scope
:subject
condition
(
:deploy_board_disabled
)
{
!
@subject
.
feature_available?
(
:deploy_board
)
}
with_scope
:subject
condition
(
:iterations_available
)
{
@subject
.
feature_available?
(
:iterations
)
}
...
...
@@ -188,7 +185,6 @@ module EE
rule
{
can?
(
:reporter_access
)
}.
policy
do
enable
:admin_board
enable
:read_deploy_board
enable
:admin_epic_issue
enable
:read_group_timelogs
end
...
...
@@ -254,8 +250,6 @@ module EE
rule
{
repository_mirrors_enabled
&
((
mirror_available
&
can?
(
:admin_project
))
|
admin
)
}.
enable
:admin_mirror
rule
{
deploy_board_disabled
&
~
is_development
}.
prevent
:read_deploy_board
rule
{
can?
(
:maintainer_access
)
}.
policy
do
enable
:push_code_to_protected_branches
enable
:admin_path_locks
...
...
ee/spec/models/ee/namespace_spec.rb
View file @
f45257e2
...
...
@@ -481,7 +481,7 @@ RSpec.describe Namespace do
end
context
'when feature not available in the plan'
do
let
(
:feature
)
{
:
deploy_board
}
let
(
:feature
)
{
:
cluster_deployments
}
let
(
:hosted_plan
)
{
create
(
:bronze_plan
)
}
it
'returns false'
do
...
...
ee/spec/models/license_spec.rb
View file @
f45257e2
...
...
@@ -368,7 +368,7 @@ RSpec.describe License do
it
'returns features for premium plan'
do
expect
(
described_class
.
features_for_plan
(
'premium'
))
.
to
include
(
:multiple_issue_assignees
,
:
deploy_board
,
:file_locks
,
:group_wikis
)
.
to
include
(
:multiple_issue_assignees
,
:
cluster_deployments
,
:file_locks
,
:group_wikis
)
end
it
'returns empty array if no features for given plan'
do
...
...
@@ -377,7 +377,7 @@ RSpec.describe License do
end
describe
'.plan_includes_feature?'
do
let
(
:feature
)
{
:
deploy_board
}
let
(
:feature
)
{
:
cluster_deployments
}
subject
{
described_class
.
plan_includes_feature?
(
plan
,
feature
)
}
...
...
@@ -735,15 +735,15 @@ RSpec.describe License do
context
'with add-ons'
do
it
'returns all available add-ons'
do
license
=
build_license_with_add_ons
({
'GitLab_
DeployBoard'
=>
1
,
'GitLab_
FileLocks'
=>
2
})
license
=
build_license_with_add_ons
({
'GitLab_FileLocks'
=>
2
})
expect
(
license
.
features_from_add_ons
).
to
match_array
([
:deploy_board
,
:file_locks
])
expect
(
license
.
features_from_add_ons
).
to
eq
([
:file_locks
])
end
end
context
'with nil add-ons'
do
it
'returns an empty array'
do
license
=
build_license_with_add_ons
({
'GitLab_
DeployBoard'
=>
nil
,
'GitLab_
FileLocks'
=>
nil
})
license
=
build_license_with_add_ons
({
'GitLab_FileLocks'
=>
nil
})
expect
(
license
.
features_from_add_ons
).
to
eq
([])
end
...
...
@@ -752,9 +752,9 @@ RSpec.describe License do
describe
'#feature_available?'
do
it
'returns true if add-on exists and have a quantity greater than 0'
do
license
=
build_license_with_add_ons
({
'GitLab_
DeployBoard
'
=>
1
})
license
=
build_license_with_add_ons
({
'GitLab_
FileLocks
'
=>
1
})
expect
(
license
.
feature_available?
(
:
deploy_board
)).
to
eq
(
true
)
expect
(
license
.
feature_available?
(
:
file_locks
)).
to
eq
(
true
)
end
it
'returns true if the feature is included in the plan do'
do
...
...
@@ -764,16 +764,15 @@ RSpec.describe License do
end
it
'returns false if add-on exists but have a quantity of 0'
do
license
=
build_license_with_add_ons
({
'GitLab_
DeployBoard
'
=>
0
})
license
=
build_license_with_add_ons
({
'GitLab_
FileLocks
'
=>
0
})
expect
(
license
.
feature_available?
(
:
deploy_board
)).
to
eq
(
false
)
expect
(
license
.
feature_available?
(
:
file_locks
)).
to
eq
(
false
)
end
it
'returns false if add-on does not exists'
do
license
=
build_license_with_add_ons
({})
expect
(
license
.
feature_available?
(
:deploy_board
)).
to
eq
(
false
)
expect
(
license
.
feature_available?
(
:auditor_user
)).
to
eq
(
false
)
expect
(
license
.
feature_available?
(
:file_locks
)).
to
eq
(
false
)
end
context
'with an expired trial license'
do
...
...
ee/spec/support/helpers/ee/license_helpers.rb
View file @
f45257e2
...
...
@@ -8,9 +8,9 @@ module EE
#
# Example:
#
# stub_licensed_features(geo: true,
deploy_board
: false)
# stub_licensed_features(geo: true,
file_locks
: false)
#
# This enables `geo` and disables `
deploy_board
` features for a spec.
# This enables `geo` and disables `
file_locks
` features for a spec.
# Other features are still enabled/disabled as defined in the license.
prepended
do
...
...
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