Commit 24c51569 authored by Robert Speicher's avatar Robert Speicher

Merge branch '13428-make-hashed-storage-a-requirement-for-design-management' into 'master'

Make hashed storage required for Design Management

See merge request gitlab-org/gitlab!19259
parents 51ed53e3 4f398c1b
...@@ -33,6 +33,10 @@ to be enabled: ...@@ -33,6 +33,10 @@ to be enabled:
project level, navigate to your project's **Settings > General**, expand **Visibility, project features, permissions** project level, navigate to your project's **Settings > General**, expand **Visibility, project features, permissions**
and enable **Git Large File Storage**. and enable **Git Large File Storage**.
Design Management requires that projects are using
[hashed storage](../../../administration/repository_storage_types.html#hashed-storage)
(the default storage type since v10.0).
## Limitations ## Limitations
- Files uploaded must have a file extension of either `png`, `jpg`, `jpeg`, `gif`, `bmp`, `tiff` or `ico`. - Files uploaded must have a file extension of either `png`, `jpg`, `jpeg`, `gif`, `bmp`, `tiff` or `ico`.
......
...@@ -630,13 +630,18 @@ module EE ...@@ -630,13 +630,18 @@ module EE
super.presence || build_feature_usage super.presence || build_feature_usage
end end
# LFS and hashed repository storage are required for using Design Management.
def design_management_enabled? def design_management_enabled?
# LFS is required for using Design Management
#
# Checking both feature availability on the license, as well as the feature
# flag, because we don't want to enable design_management by default on
# on prem installs yet.
lfs_enabled? && lfs_enabled? &&
# We will allow the hashed storage requirement to be disabled for
# a few releases until we are able to understand the impact of the
# hashed storage requirement for existing design management projects.
# 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)) &&
# Check both feature availability on the license, as well as the feature
# flag, because we don't want to enable design_management by default on
# on prem installs yet.
# See https://gitlab.com/gitlab-org/gitlab/issues/13709
feature_available?(:design_management) && feature_available?(:design_management) &&
::Feature.enabled?(:design_management_flag, self, default_enabled: true) ::Feature.enabled?(:design_management_flag, self, default_enabled: true)
end end
......
---
title: Hashed storage is now a requirement for Design Management
merge_request: 19259
author:
type: changed
...@@ -1900,27 +1900,29 @@ describe Project do ...@@ -1900,27 +1900,29 @@ describe Project do
end end
end end
describe "#design_management_enabled?" do describe '#design_management_enabled?' do
let(:project) { build(:project) } let(:project) { build(:project) }
where( where(:feature_enabled, :license_enabled, :lfs_enabled, :hashed_storage_enabled, :hash_storage_required, :expectation) do
feature_enabled: [false, true], false | false | false | false | false | false
license_enabled: [false, true], true | false | false | false | false | false
lfs_enabled: [false, true] true | true | false | false | false | false
) true | true | true | false | false | true
true | true | true | false | true | false
true | true | true | true | false | true
true | true | true | true | true | true
end
with_them do with_them do
before do before do
stub_licensed_features(design_management: license_enabled) stub_licensed_features(design_management: license_enabled)
stub_feature_flags(design_management_flag: feature_enabled) stub_feature_flags(design_management_flag: feature_enabled, 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)
end end
# Design management is only available if all dependencies are enabled it do
let(:expected) { feature_enabled && license_enabled && lfs_enabled } expect(project.design_management_enabled?).to be(expectation)
it "knows if design management is available" do
expect(project.design_management_enabled?).to be(expected)
end end
end end
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