Skip to content

Pipeline must be present if "Pipeline must succeed" is set

What does this MR do?

Related issue: https://gitlab.com/gitlab-org/gitlab-ce/issues/54226

Previously, when a user sets Pipeline must succeed checkbox in the project settings (also known internally as only_allow_merge_if_pipeline_succeeds), we were allowing merge if no pipelines were created.

This has been considered a bug especially when dealing with external CI integrations. We may trigger external CI builds in a variety of ways and we don't have a pipeline record until the external CI provider submits commit status updates. In the meantime, as we don't have a pipeline we were allowing merge.

This MR enforces the presence of a pipeline when the user explicitly selects only_allow_merge_if_pipeline_succeeds and this prevents race conditions with external builds.

This is what the merge request shows when no pipelines available and Pipeline must succeeds is set.

image

Does this MR meet the acceptance criteria?

Conformity

Performance and testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Grzegorz Bizon

Merge request reports