WIP: Make sure head pippeline always corresponds with an MR
WIP
- need to check the case described in the issue comments
What does this MR do?
It does not update the head_pipeline of merge requests directly from Ci::CreatePipelineService
but enqueues the update instead.
Are there points in the code the reviewer needs to double check?
Error handling in the worker
Why was this MR needed?
As described in the issue it can happen that the head pipeline of a merge request is set to the pipeline that is actually not the pipeline that should be associated to the merge request.
This can happen due to the following workflow:
- a user pushes a change
-
GitPushService
is called - from this service
-
UpdateMergeRequestsWorker
job is enqueued -
Ci::CreatePipelineService
is executed
- inside
Ci::CreatePipelineService
- a new pipeline is created
-
head_pipeline_id
of all merge requests that have the same source_project and source_branch as the created pipeline are updated to the id of the created pipeline
-
head_pipeline
can be updated before a merge request is refreshed fromUpdateMergeRequestsWorker
-> the merge request still references an old sha but associated pipeline already a new sha
Screenshots (if relevant)
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
API support added -
Tests added for this feature/bug - Review
-
Has been reviewed by UX -
Has been reviewed by Frontend -
Has been reviewed by Backend -
Has been reviewed by Database
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Squashed related commits together
What are the relevant issue numbers?
Closes #37354