Fix commit status API incorrectly overwriting MR head pipeline
The commit status API would sometimes incorrectly overwrite the merge request head pipeline with a branch pipeline when a merge request pipeline also existed for the same commit. This was due to a duplicate and incorrect implementation of the required logic. The solution is to instead fire a `Ci::PipelineCreatedEvent` _if_ an `external` pipeline is created, as this is the canonical way to trigger the `head_pipeline_id` update. There is no need to update the `head_pipeline_id` for pre-existing pipelines, as these would already have fired the required events. See https://gitlab.com/gitlab-org/gitlab/-/issues/450176 Changelog: fixed
显示
- app/services/ci/create_commit_status_service.rb 4 个添加, 9 个删除app/services/ci/create_commit_status_service.rb
- spec/requests/api/commit_statuses_spec.rb 4 个添加, 2 个删除spec/requests/api/commit_statuses_spec.rb
- spec/services/ci/create_commit_status_service_spec.rb 30 个添加, 2 个删除spec/services/ci/create_commit_status_service_spec.rb
加载中
想要评论请 注册 或 登录