"Pipelines must succeed" does not work correctly with a broken .gitlab-ci.yaml and external pipeline

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Summary

"Pipelines must succeed" does not work correctly with a broken .gitlab-ci.yaml and external pipeline

Steps to reproduce

  • Create a project with a simple working .gitlab-ci.yml and enable Pipelines must succeed via Settings > Merge requests > Merge checks:
test:
  script:
    - echo "this is a test
  • Create a new branch, add a "bad" commit that breaks the CI/CD YAML, create a merge request based on this branch. The resulting pipeline prevents merging this MR.
  • Set the pipeline status of a commit in the merge request to status=success via https://docs.gitlab.com/api/commits/#set-the-pipeline-status-of-a-commit to emulate external pipeline.
  • After that, it becomes possible to merge the MR although .gitlab-ci.yaml is still broken.

What is the current bug behavior?

Pipelines must succeed does not work correctly with broken .gitlab-ci.yaml when external pipeline updates the status via https://docs.gitlab.com/api/commits/#set-the-pipeline-status-of-a-commit

What is the expected correct behavior?

Pipelines must succeed should prevent the merge in this scenario.

Relevant logs and/or screenshots

n/a

Output of checks

This bug happens on GitLab.com

Edited by 🤖 GitLab Bot 🤖