Skip to content

Fix commit status API incorrectly overwriting MR head pipeline

What does this MR do and why?

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 #450176 (closed)

Changelog: fixed

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Merge request reports