Refactor all_pipelines in Merge request in order to support all pipelines for merge request
What does this MR do?
MergeRequest#all_pipelines
(which uses Ci::Pipeline.for_merge_request
) cannot get detached merge request pipelines (See the terminoligy in https://gitlab.com/gitlab-org/gitlab-ee/issues/7380) because those pipelines have a head ref of the merge request (e.g. refs/merge-requests/:iid/head
) instead of the branch name (e.g. feature-1
). This MR address the problem to let MergeRequest#all_pipelines
fetch all relevant pipelines on the merge request.
This MR also drops the scope Ci::Pipeline.for_merge_request
and implement the get-related-pipelines-logic in MergeRequest#all_pipelines
. We reduce the number of the scopes for the SSOT that MergeRequest#all_pipelines
fetches the related pipeliens whereas Ci::Pipeline#all_merge_requests
fetches the related merge requests. This was the conclusion brought with @ayufan in the previous (abandoned) MR.
What are the relevant issue numbers?
Related gitlab-ee#7380 #58454 (moved)
EE MR for test purpose => https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/9871
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