From 5b5cc74cd08a4bf93e17cf2a0d112b5dc908d305 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Tue, 23 Apr 2019 13:01:18 +0000 Subject: [PATCH] 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 (cherry picked from commit 6c913f2c65ec4ddffaf4a79fc15ea933325e51f4) 681db75b Add feature flag to disable LFS check a26c5efe Apply suggestion to spec/lib/gitlab/checks/lfs_check_spec.rb --- lib/gitlab/checks/lfs_check.rb | 1 + spec/lib/gitlab/checks/lfs_check_spec.rb | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/lib/gitlab/checks/lfs_check.rb b/lib/gitlab/checks/lfs_check.rb index cc6a14d2d9a..67a65d61441 100644 --- a/lib/gitlab/checks/lfs_check.rb +++ b/lib/gitlab/checks/lfs_check.rb @@ -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 def validate! + return unless Feature.enabled?(:lfs_check, default_enabled: true) return unless project.lfs_enabled? return if skip_lfs_integrity_check diff --git a/spec/lib/gitlab/checks/lfs_check_spec.rb b/spec/lib/gitlab/checks/lfs_check_spec.rb index 35f8069c8a4..dad14e100a7 100644 --- a/spec/lib/gitlab/checks/lfs_check_spec.rb +++ b/spec/lib/gitlab/checks/lfs_check_spec.rb @@ -27,6 +27,18 @@ describe Gitlab::Checks::LfsCheck do allow(project).to receive(:lfs_enabled?).and_return(true) 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 let(:changes) { { oldrev: oldrev, ref: ref } } -- GitLab