"Pipelines must succeed" checkbox is ignored if CI is skipped
### Summary Customers want to use [the "Pipelines must succeed" button](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html#only-allow-merge-requests-to-be-merged-if-the-pipeline-succeeds) to enforce a policy that a commit must pass its tests before it can be merged. But it's possible for developers to bypass the policy entirely using [CI skipping](https://docs.gitlab.com/ee/ci/yaml/#skipping-jobs). ### Steps to reproduce 1. Create a new project with a README and a simple `.gitlab-ci.yml` (see below) 2. Turn on "Pipelines must succeed" 3. Protect the `master` branch and set "Allowed to Push" to "No One" for `master` 4. Create a branch and MR 5. In your branch, edit `exit 0` to say `exit 1` (which is a failure) 6. Commit your change with "[skip ci]" as the commit message 7. Push your change 8. Navigate to the Merge Request. The merge button appears, and it's possible to merge - even though you just broke the build and insisted that Pipelines must succeed. Here's a CI configuration that will work: ``` test: script: - exit 0 only: ['merge_requests'] ``` ### Example Project https://gitlab.com/fpotter/examples/skip-ci **Note** While in the steps above I use the `[skip ci]` commit message, I assume (have not tested) that the `ci.skip` push option would similarly allow a developer to bypass the pipeline success requirement. ### What is the current *bug* behavior? The Merge button appears in the MR. It can be merged. Even though you set a policy that pipelines must succeed, and the build is completely broken. ### What is the expected *correct* behavior? A message that says something like: > The pipeline for this merge request was skipped. Please run a successful pipeline on this branch. The format could be the same as is currently shown when the Pipeline is blocked or failed (see below). ### Relevant logs and/or screenshots The "Pipelines must succeed" button: ![pipelines-must-succeed](/uploads/7b1971cb1274359ea948779f833278fb/pipelines-must-succeed.png) The "Merge" button that appears: ![merge-button](/uploads/a32e499a3421b68d040f6b20686d7b41/merge-button.png) The "Blocked" message, which indicates a possible format for the "skipped" message: ![blocked-message](/uploads/6a1ff9be8c37be3f1fd4e94e0355934c/blocked-message.png) The "Failed" message, also to indicate format: ![failed-message](/uploads/c0e2cd7d55b3b18d3c52d9aeea64fdc1/failed-message.png) ### Output of checks This bug happens on GitLab.com. ### Possible fixes ? ### Customer impact Major issue for [at least one enterprise customer](https://gitlab.my.salesforce.com/0016100001E1mmH) /cc @jlenny @williamchia @dhavens @jmiklos
issue