Commit b807307f authored by Kerri Miller's avatar Kerri Miller

Merge branch 'revert-bb80eb8a' into 'master'

Disable caching of MergeToRefService call in mergeability check

See merge request gitlab-org/gitlab!71909
parents 25f890fd 36f8fbf8
...@@ -157,9 +157,7 @@ module MergeRequests ...@@ -157,9 +157,7 @@ module MergeRequests
def merge_to_ref def merge_to_ref
params = { allow_conflicts: Feature.enabled?(:display_merge_conflicts_in_diff, project) } params = { allow_conflicts: Feature.enabled?(:display_merge_conflicts_in_diff, project) }
result = MergeRequests::MergeToRefService result = MergeRequests::MergeToRefService.new(project: project, current_user: merge_request.author, params: params).execute(merge_request)
.new(project: project, current_user: merge_request.author, params: params)
.execute(merge_request, true)
result[:status] == :success result[:status] == :success
end end
......
...@@ -132,15 +132,6 @@ RSpec.describe MergeRequests::MergeabilityCheckService, :clean_gitlab_redis_shar ...@@ -132,15 +132,6 @@ RSpec.describe MergeRequests::MergeabilityCheckService, :clean_gitlab_redis_shar
it_behaves_like 'mergeable merge request' it_behaves_like 'mergeable merge request'
it 'calls MergeToRefService with cache parameter' do
service = instance_double(MergeRequests::MergeToRefService)
expect(MergeRequests::MergeToRefService).to receive(:new).once { service }
expect(service).to receive(:execute).once.with(merge_request, true).and_return(success: true)
described_class.new(merge_request).execute(recheck: true)
end
context 'when concurrent calls' do context 'when concurrent calls' do
it 'waits first lock and returns "cached" result in subsequent calls' do it 'waits first lock and returns "cached" result in subsequent calls' do
threads = execute_within_threads(amount: 3) threads = execute_within_threads(amount: 3)
......
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