Fix duplicate merge request pipelines created by Sidekiq worker retry
What does this MR do?
MergeRequest#merge_request_pipeline_exists? has several problems.
- The name. We changed the terminology about merge request pipelines, and it's still referring to the old terminology.
- It cannot check if (attached) merge request pipelines exist or not. Because, merge request pipelines stores merge-sha (Generated by
diff_head_shanever matches those shas. We have to use
for_sha_or_source_shain this case.
- We thrive reducing the number of scopes for "Find pipelines for merge requests" in
MergeRequestmodel, and having a dedicated method for compatible any cases. This is good from two PoV 1) We can easily maintain 2) Reduce the number of mistakes from developers using a wrong method.
- CE: Here
- EE: gitlab-ee!12212 (merged)
What are the relevant issue numbers?
Does this MR meet the acceptance criteria?
- [-] Changelog entry added, if necessary
- [-] Documentation created/updated via this MR
- [-] Documentation reviewed by technical writer or follow-up review issue created
- [-] Tests added for this feature/bug
- [-] Tested in all supported browsers
- Conforms to the code review guidelines
- Conforms to the merge request performance guidelines
- Conforms to the style guides
- Conforms to the database guides
- [-] Link to e2e tests MR added if this MR has Requires e2e tests label. See the Test Planning Process.
- Security reports checked/validated by reviewer