diff options
author | Sean McGivern <sean@gitlab.com> | 2018-01-11 16:20:13 +0000 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2018-01-12 13:19:05 +0000 |
commit | f3cf8cc8d1625ae1cd532474191739cd36419425 (patch) | |
tree | eb837a49f9d8d9546a505f62b62e2b59307bb2b4 /spec/models/commit_range_spec.rb | |
parent | 678a00d60a21fcd39fa5c8043fadc4a94e618f4d (diff) | |
download | gitlab-ce-f3cf8cc8d1625ae1cd532474191739cd36419425.tar.gz |
Only search for MR revert commits on notes after MR was merged41807-15665-consistently-502s-because-it-fetches-every-commit
If we search for notes before the MR was merged, we have to load every commit
that was ever part of the MR, or mentioned in a push. In extreme cases, this can
be tens of thousands of commits to load, but we know they can't revert the merge
commit, because they are from before the MR was merged.
In the (rare) case that we don't have a `merged_at` value for the MR, we can
still search all notes.
Diffstat (limited to 'spec/models/commit_range_spec.rb')
-rw-r--r-- | spec/models/commit_range_spec.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/models/commit_range_spec.rb b/spec/models/commit_range_spec.rb index 38829773599..f2efcd9d0e9 100644 --- a/spec/models/commit_range_spec.rb +++ b/spec/models/commit_range_spec.rb @@ -151,11 +151,11 @@ describe CommitRange do .with(commit1, user) .and_return(true) - expect(commit1.has_been_reverted?(user, issue)).to eq(true) + expect(commit1.has_been_reverted?(user, issue.notes_with_associations)).to eq(true) end - it 'returns false a commit has not been reverted' do - expect(commit1.has_been_reverted?(user, issue)).to eq(false) + it 'returns false if the commit has not been reverted' do + expect(commit1.has_been_reverted?(user, issue.notes_with_associations)).to eq(false) end end end |