Commit 6c913f2c authored by Douwe Maan's avatar Douwe Maan

Merge branch 'id-feature-flag-to-disable-lfs-check' into 'master'

Add feature flag to disable LFS check

Closes #60588

See merge request gitlab-org/gitlab-ce!27451
parents a59b97d7 fb1b1956
...@@ -7,6 +7,7 @@ module Gitlab ...@@ -7,6 +7,7 @@ module Gitlab
ERROR_MESSAGE = 'LFS objects are missing. Ensure LFS is properly set up or try a manual "git lfs push --all".'.freeze ERROR_MESSAGE = 'LFS objects are missing. Ensure LFS is properly set up or try a manual "git lfs push --all".'.freeze
def validate! def validate!
return unless Feature.enabled?(:lfs_check, default_enabled: true)
return unless project.lfs_enabled? return unless project.lfs_enabled?
return if skip_lfs_integrity_check return if skip_lfs_integrity_check
......
...@@ -27,6 +27,18 @@ describe Gitlab::Checks::LfsCheck do ...@@ -27,6 +27,18 @@ describe Gitlab::Checks::LfsCheck do
allow(project).to receive(:lfs_enabled?).and_return(true) allow(project).to receive(:lfs_enabled?).and_return(true)
end end
context 'with lfs_check feature disabled' do
before do
stub_feature_flags(lfs_check: false)
end
it 'skips integrity check' do
expect_any_instance_of(Gitlab::Git::LfsChanges).not_to receive(:new_pointers)
subject.validate!
end
end
context 'deletion' do context 'deletion' do
let(:changes) { { oldrev: oldrev, ref: ref } } let(:changes) { { oldrev: oldrev, ref: ref } }
......
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