Fix unexpected exception by failure of finding an actual head pipeline
What does this MR do?
As https://gitlab.com/gitlab-org/gitlab-ce/issues/56113 indicates, sometimes MergeRequest#find_actual_head_pipeline
returns nil
as failed to find an actual pipeline. This could happen by a race condition that a pipeline corresponding to the diff_head_sha
has not been created yet. In this case, we should not raise an exception, nor change the head pipeline to nil
. We simply update head pipeline only if a new pipeline is found.
What are the relevant issue numbers?
Close https://gitlab.com/gitlab-org/gitlab-ce/issues/56113
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary - [-] Documentation created/updated
-
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
Edited by Shinya Maeda