Commit 4100653c authored by Mike Terhar's avatar Mike Terhar Committed by Dmytro Zaporozhets

Remove feature availability check for design_management

This allows any project that meets the technical specs to use
design_management features.
parent b22ee346
---
title: Remove design management as a license feature
merge_request: 28589
author:
type: added
...@@ -57,7 +57,7 @@ The following table depicts the various user permission levels in a project. ...@@ -57,7 +57,7 @@ The following table depicts the various user permission levels in a project.
| View Dependency list **(ULTIMATE)** | ✓ (*1*) | ✓ | ✓ | ✓ | ✓ | | View Dependency list **(ULTIMATE)** | ✓ (*1*) | ✓ | ✓ | ✓ | ✓ |
| View License list **(ULTIMATE)** | ✓ (*1*) | ✓ | ✓ | ✓ | ✓ | | View License list **(ULTIMATE)** | ✓ (*1*) | ✓ | ✓ | ✓ | ✓ |
| View licenses in Dependency list **(ULTIMATE)** | ✓ (*1*) | ✓ | ✓ | ✓ | ✓ | | View licenses in Dependency list **(ULTIMATE)** | ✓ (*1*) | ✓ | ✓ | ✓ | ✓ |
| View [Design Management](project/issues/design_management.md) pages **(PREMIUM)** | ✓ | ✓ | ✓ | ✓ | ✓ | | View [Design Management](project/issues/design_management.md) pages | ✓ | ✓ | ✓ | ✓ | ✓ |
| View project code | ✓ (*1*) | ✓ | ✓ | ✓ | ✓ | | View project code | ✓ (*1*) | ✓ | ✓ | ✓ | ✓ |
| Pull project code | ✓ (*1*) | ✓ | ✓ | ✓ | ✓ | | Pull project code | ✓ (*1*) | ✓ | ✓ | ✓ | ✓ |
| View GitLab Pages protected by [access control](project/pages/introduction.md#gitlab-pages-access-control-core) | ✓ | ✓ | ✓ | ✓ | ✓ | | View GitLab Pages protected by [access control](project/pages/introduction.md#gitlab-pages-access-control-core) | ✓ | ✓ | ✓ | ✓ | ✓ |
...@@ -87,7 +87,7 @@ The following table depicts the various user permission levels in a project. ...@@ -87,7 +87,7 @@ The following table depicts the various user permission levels in a project.
| Create/edit/delete [Releases](project/releases/index.md)| | | ✓ | ✓ | ✓ | | Create/edit/delete [Releases](project/releases/index.md)| | | ✓ | ✓ | ✓ |
| Pull from [Conan repository](packages/conan_repository/index.md), [Maven repository](packages/maven_repository/index.md), or [NPM registry](packages/npm_registry/index.md) **(PREMIUM)** | | ✓ | ✓ | ✓ | ✓ | | Pull from [Conan repository](packages/conan_repository/index.md), [Maven repository](packages/maven_repository/index.md), or [NPM registry](packages/npm_registry/index.md) **(PREMIUM)** | | ✓ | ✓ | ✓ | ✓ |
| Publish to [Conan repository](packages/conan_repository/index.md), [Maven repository](packages/maven_repository/index.md), or [NPM registry](packages/npm_registry/index.md) **(PREMIUM)** | | | ✓ | ✓ | ✓ | | Publish to [Conan repository](packages/conan_repository/index.md), [Maven repository](packages/maven_repository/index.md), or [NPM registry](packages/npm_registry/index.md) **(PREMIUM)** | | | ✓ | ✓ | ✓ |
| Upload [Design Management](project/issues/design_management.md) files **(PREMIUM)** | | | ✓ | ✓ | ✓ | | Upload [Design Management](project/issues/design_management.md) files | | | ✓ | ✓ | ✓ |
| Create new branches | | | ✓ | ✓ | ✓ | | Create new branches | | | ✓ | ✓ | ✓ |
| Push to non-protected branches | | | ✓ | ✓ | ✓ | | Push to non-protected branches | | | ✓ | ✓ | ✓ |
| Force push to non-protected branches | | | ✓ | ✓ | ✓ | | Force push to non-protected branches | | | ✓ | ✓ | ✓ |
......
# Design Management **(PREMIUM)** # Design Management
> [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/660) in [GitLab Premium](https://about.gitlab.com/pricing/) 12.2. > [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/660) in [GitLab Premium](https://about.gitlab.com/pricing/) 12.2.
......
...@@ -126,7 +126,7 @@ associated label or assignee will change to match that of the new column. The en ...@@ -126,7 +126,7 @@ associated label or assignee will change to match that of the new column. The en
board can also be filtered to only include issues from a certain milestone or an overarching board can also be filtered to only include issues from a certain milestone or an overarching
label. label.
### Design Management **(PREMIUM)** ### Design Management
With [Design Management](design_management.md), you can upload design With [Design Management](design_management.md), you can upload design
assets to issues and view them all together to easily share and assets to issues and view them all together to easily share and
......
...@@ -75,7 +75,7 @@ The following items will be exported: ...@@ -75,7 +75,7 @@ The following items will be exported:
- Project configuration, including services - Project configuration, including services
- Issues with comments, merge requests with diffs and comments, labels, milestones, snippets, - Issues with comments, merge requests with diffs and comments, labels, milestones, snippets,
and other project entities and other project entities
- Design Management files and data **(PREMIUM)** - Design Management files and data
- LFS objects - LFS objects
- Issue boards - Issue boards
- Pipelines history - Pipelines history
......
...@@ -650,8 +650,7 @@ module EE ...@@ -650,8 +650,7 @@ module EE
# a few releases until we are able to understand the impact of the # a few releases until we are able to understand the impact of the
# hashed storage requirement for existing design management projects. # hashed storage requirement for existing design management projects.
# See https://gitlab.com/gitlab-org/gitlab/issues/13428#note_238729038 # See https://gitlab.com/gitlab-org/gitlab/issues/13428#note_238729038
(hashed_storage?(:repository) || ::Feature.disabled?(:design_management_require_hashed_storage, self, default_enabled: true)) && (hashed_storage?(:repository) || ::Feature.disabled?(:design_management_require_hashed_storage, self, default_enabled: true))
feature_available?(:design_management)
end end
def design_repository def design_repository
......
...@@ -64,7 +64,6 @@ class License < ApplicationRecord ...@@ -64,7 +64,6 @@ class License < ApplicationRecord
default_project_deletion_protection default_project_deletion_protection
dependency_proxy dependency_proxy
deploy_board deploy_board
design_management
disable_name_update_for_users disable_name_update_for_users
email_additional_text email_additional_text
epics epics
......
...@@ -2048,18 +2048,19 @@ describe Project do ...@@ -2048,18 +2048,19 @@ describe Project do
describe '#design_management_enabled?' do describe '#design_management_enabled?' do
let(:project) { build(:project) } let(:project) { build(:project) }
where(:license_enabled, :lfs_enabled, :hashed_storage_enabled, :hash_storage_required, :expectation) do where(:lfs_enabled, :hashed_storage_enabled, :hash_storage_required, :expectation) do
false | false | false | false | false false | false | false | false
true | false | false | false | false false | true | true | false
true | true | false | false | true false | true | false | false
true | true | false | true | false false | false | true | false
true | true | true | false | true true | false | false | true
true | true | true | true | true true | true | true | true
true | true | false | true
true | false | true | false
end end
with_them do with_them do
before do before do
stub_licensed_features(design_management: license_enabled)
stub_feature_flags(design_management_require_hashed_storage: hash_storage_required) stub_feature_flags(design_management_require_hashed_storage: hash_storage_required)
expect(project).to receive(:lfs_enabled?).and_return(lfs_enabled) expect(project).to receive(:lfs_enabled?).and_return(lfs_enabled)
allow(project).to receive(:hashed_storage?).with(:repository).and_return(hashed_storage_enabled) allow(project).to receive(:hashed_storage?).with(:repository).and_return(hashed_storage_enabled)
......
...@@ -99,19 +99,9 @@ describe DesignManagement::DesignPolicy do ...@@ -99,19 +99,9 @@ describe DesignManagement::DesignPolicy do
it { is_expected.to be_disallowed(:create_design, :destroy_design) } it { is_expected.to be_disallowed(:create_design, :destroy_design) }
end end
context "when the license does not include the feature" do context "when DesignManagement is not enabled" do
before do before do
stub_licensed_features(design_management: false) enable_design_management(false)
allow(Gitlab.config.lfs).to receive(:enabled).and_return(true)
end
it_behaves_like "design abilities not available"
end
context "when LFS is not enabled" do
before do
stub_licensed_features(design_management: true)
allow(Gitlab.config.lfs).to receive(:enabled).and_return(false)
end end
it_behaves_like "design abilities not available" it_behaves_like "design abilities not available"
......
...@@ -45,25 +45,6 @@ describe 'Getting designs related to an issue' do ...@@ -45,25 +45,6 @@ describe 'Getting designs related to an issue' do
Gitlab::UrlBuilder.build(design, ref: ref, size: size) Gitlab::UrlBuilder.build(design, ref: ref, size: size)
end end
context 'when the feature is not available' do
before do
stub_licensed_features(design_management: false)
stub_feature_flags(design_managment: false)
end
it_behaves_like 'a working graphql query' do
before do
post_graphql(query, current_user: current_user)
end
end
it 'returns no designs' do
post_graphql(query, current_user: current_user)
expect(design_collection).to be_nil
end
end
context 'when the feature is available' do context 'when the feature is available' do
before do before do
enable_design_management enable_design_management
......
...@@ -2,9 +2,11 @@ ...@@ -2,9 +2,11 @@
require 'spec_helper' require 'spec_helper'
describe DesignManagement::SaveDesignsService do describe DesignManagement::SaveDesignsService do
let(:issue) { create(:issue, project: project) } include DesignManagementTestHelpers
let(:project) { create(:project) }
let(:developer) { create(:user) } let_it_be(:developer) { create(:user) }
let(:project) { issue.project }
let(:issue) { create(:issue) }
let(:user) { developer } let(:user) { developer }
let(:files) { [rails_sample] } let(:files) { [rails_sample] }
let(:design_repository) { EE::Gitlab::GlRepository::DESIGN.repository_resolver.call(project) } let(:design_repository) { EE::Gitlab::GlRepository::DESIGN.repository_resolver.call(project) }
...@@ -70,7 +72,7 @@ describe DesignManagement::SaveDesignsService do ...@@ -70,7 +72,7 @@ describe DesignManagement::SaveDesignsService do
describe '#execute' do describe '#execute' do
context 'when the feature is not available' do context 'when the feature is not available' do
before do before do
stub_licensed_features(design_management: false) enable_design_management(false)
end end
it_behaves_like 'a service error' it_behaves_like 'a service error'
...@@ -78,16 +80,7 @@ describe DesignManagement::SaveDesignsService do ...@@ -78,16 +80,7 @@ describe DesignManagement::SaveDesignsService do
context 'when the feature is available' do context 'when the feature is available' do
before do before do
stub_licensed_features(design_management: true) enable_design_management(true)
end
context 'when LFS is not enabled' do
it_behaves_like 'a service error'
end
context 'when LFS is enabled' do
before do
allow(project).to receive(:lfs_enabled?).and_return(true)
end end
describe 'repository existence' do describe 'repository existence' do
...@@ -346,11 +339,10 @@ describe DesignManagement::SaveDesignsService do ...@@ -346,11 +339,10 @@ describe DesignManagement::SaveDesignsService do
expect(first_updated_design.versions.size).to eq(1) expect(first_updated_design.versions.size).to eq(1)
end end
end end
end
describe 'scalability' do describe 'scalability', skip: 'See: https://gitlab.com/gitlab-org/gitlab/-/issues/213169' do
before do before do
run_service([dk_png]) # ensure project, issue, etc are created run_service([sample_image('banana_sample.gif')]) # ensure project, issue, etc are created
end end
it 'runs the same queries for all requests, regardless of number of files' do it 'runs the same queries for all requests, regardless of number of files' do
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
module DesignManagementTestHelpers module DesignManagementTestHelpers
def enable_design_management(enabled = true, ref_filter = true) def enable_design_management(enabled = true, ref_filter = true)
stub_licensed_features(design_management: enabled)
stub_lfs_setting(enabled: enabled) stub_lfs_setting(enabled: enabled)
stub_feature_flags(design_management_reference_filter_gfm_pipeline: ref_filter) stub_feature_flags(design_management_reference_filter_gfm_pipeline: ref_filter)
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