diff --git a/config/feature_flags/development/changes_batch_commits.yml b/config/feature_flags/development/changes_batch_commits.yml deleted file mode 100644 index 2b276759fb1fa347a36db0b4a6619c44b1484850..0000000000000000000000000000000000000000 --- a/config/feature_flags/development/changes_batch_commits.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: changes_batch_commits -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/66731 -rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/336992 -milestone: '14.2' -type: development -group: group::gitaly -default_enabled: false diff --git a/lib/gitlab/checks/changes_access.rb b/lib/gitlab/checks/changes_access.rb index 9ecc93f871be266682f43ddcd1e0c9bee88efbca..abc5fca9eee3b545b2a75f56365bc87ff991c054 100644 --- a/lib/gitlab/checks/changes_access.rb +++ b/lib/gitlab/checks/changes_access.rb @@ -81,7 +81,7 @@ def commits_for(newrev) def single_access_checks! # Iterate over all changes to find if user allowed all of them to be applied changes.each do |change| - commits = Gitlab::Lazy.new { commits_for(change[:newrev]) } if Feature.enabled?(:changes_batch_commits) + commits = Gitlab::Lazy.new { commits_for(change[:newrev]) } # If user does not have access to make at least one change, cancel all # push by allowing the exception to bubble up diff --git a/spec/lib/gitlab/checks/changes_access_spec.rb b/spec/lib/gitlab/checks/changes_access_spec.rb index 4a74dfcec34ebf9aaf67d789954ad5422059837d..b6914a0a8f176e05498913907770717e594005fd 100644 --- a/spec/lib/gitlab/checks/changes_access_spec.rb +++ b/spec/lib/gitlab/checks/changes_access_spec.rb @@ -8,53 +8,35 @@ subject { changes_access } describe '#validate!' do - shared_examples '#validate!' do - before do - allow(project).to receive(:lfs_enabled?).and_return(true) - end - - context 'without failed checks' do - it "doesn't raise an error" do - expect { subject.validate! }.not_to raise_error - end - - it 'calls lfs checks' do - expect_next_instance_of(Gitlab::Checks::LfsCheck) do |instance| - expect(instance).to receive(:validate!) - end + before do + allow(project).to receive(:lfs_enabled?).and_return(true) + end - subject.validate! - end + context 'without failed checks' do + it "doesn't raise an error" do + expect { subject.validate! }.not_to raise_error end - context 'when time limit was reached' do - it 'raises a TimeoutError' do - logger = Gitlab::Checks::TimedLogger.new(start_time: timeout.ago, timeout: timeout) - access = described_class.new(changes, - project: project, - user_access: user_access, - protocol: protocol, - logger: logger) - - expect { access.validate! }.to raise_error(Gitlab::Checks::TimedLogger::TimeoutError) + it 'calls lfs checks' do + expect_next_instance_of(Gitlab::Checks::LfsCheck) do |instance| + expect(instance).to receive(:validate!) end - end - end - context 'with batched commits enabled' do - before do - stub_feature_flags(changes_batch_commits: true) + subject.validate! end - - it_behaves_like '#validate!' end - context 'with batched commits disabled' do - before do - stub_feature_flags(changes_batch_commits: false) - end + context 'when time limit was reached' do + it 'raises a TimeoutError' do + logger = Gitlab::Checks::TimedLogger.new(start_time: timeout.ago, timeout: timeout) + access = described_class.new(changes, + project: project, + user_access: user_access, + protocol: protocol, + logger: logger) - it_behaves_like '#validate!' + expect { access.validate! }.to raise_error(Gitlab::Checks::TimedLogger::TimeoutError) + end end end