Commit f45257e2 authored by Tiger's avatar Tiger Committed by Jose Vargas

Remove :deploy_board licensed feature

https://gitlab.com/gitlab-org/gitlab/-/merge_requests/47147
parent 5f181b2d
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
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