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.
Pipeline must succeeds
is set.
This is what the merge request shows when no pipelines available and
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation created/updated or follow-up review issue created -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Performance and testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers
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