When pipeline is creating, consider it as in progress

What does this MR do and why?

Fixes a race condition where the merge button briefly appears as clickable during pipeline creation, resulting in immediate merges instead of auto merge. This addresses the issue in #429516 where users could merge directly.

The fix ensures that when a pipeline is in the "creating" state, the merge request is considered as having an in-progress pipeline, preventing the merge button from being enabled prematurely.

Changes

  • Modified diff_head_pipeline_considered_in_progress? in MergeRequest model to check if a pipeline is currently being created
  • Added test coverage for the new behavior when pipeline is in creating state

#429516

How to set up and validate locally

  1. Create a merge request on a project with CI/CD pipeline configured
  2. Verify that the merge button is disabled while the pipeline is in "creating" state
  3. Confirm the button becomes enabled only after the pipeline has fully initialized

MR acceptance checklist

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

Edited by Marc Shaw

Merge request reports

Loading