Merge button disabled without clear explanation | Merge blocked by "Pipelines must succeed" option
Summary
The merge button in the merge request is disabled without clear explanation. It happens on this repo since last Friday and other repos under the same project is not affected. On this repo, merging to both protected and unprotected branches is disable.
Steps to reproduce
On this repo, create a merge request to any branch and wait for the enough approvals. Then the "merge" button is still disabled.
Example Project
See merge request for iris
What is the current bug behavior?
Then the "merge" button is disabled with message
You can only merge once the items above are resolved However, it doesn't mention what are the items to resolve.
What is the expected correct behavior?
The "merge" button should be enabled once the merge request receives enough approvals.
Relevant logs and/or screenshots
Output of checks
This bug happens on GitLab.com
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:env:info
)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production
)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true
)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true
)(we will only investigate if the tests are passing)
Possible fixes
(If you can, link to the line of code that might be responsible for the problem)
Solution
We basically have two scenarios to consider because of the following:
If pipelines are disabled for the project, but there is pipeline information associated with the current commit, ideally we would like to have access to that so we can showcase that. However, as pipelines are disabled for the project this is currently limited due to its implementation.
Basically the check for disabling pipelines cuts off the entire flow of pipeline information instead of it still being accessible for situations like this.
Scenario 2 will need this in order to be feasible.
!14732 (closed) implements scenario 1 regardless of scenario 2 being feasible and could be seen as an iterative step where scenario 2 is the ideal solution.
Scenario 1
Situation | Pipelines must succeed | Pipelines enabled | Commit has pipeline associated | CI configuration available |
---|---|---|---|---|
A | ||||
B | ||||
C | N/A | |||
D | ||||
E |
graph LR
PMS{Pipelines must succeed}
PE{Pipelines enabled}
CHPA1{Commit has pipeline associated}
CHPA2{Commit has pipeline associated}
CCA1{CI configuration available}
CCA2{CI configuration available}
CCA3{CI configuration available}
CCA4{CI configuration available}
A(A)
B(B)
C(C)
D(D)
E(E)
Y1[Yes]
Y2[Yes]
Y3[Yes]
Y4[Yes]
Y5[Yes]
Y6[Yes]
Y7[Yes]
N1[No]
N2[No]
N3[No]
N4[No]
N5[No]
N6[No]
N7[No]
PMS-->K[Yes]
K-->PE
PE-->Y1
PE-->N1
Y1-->CHPA1
N1-->CHPA2
CHPA1-->Y2
CHPA1-->N2
CHPA2-->Y3
CHPA2-->N3
Y2-->CCA1
N2-->CCA2
Y3-->CCA3
N3-->CCA4
CCA1-->Y4
CCA1-->N4
CCA2-->Y5
CCA2-->N5
CCA3-->Y6
CCA3-->N6
CCA4-->Y7
CCA4-->N7
Y4-->A
N4-->I(external ci?)
Y5-->D
N5-->E
Y6-->B
N6-->J(external ci?)
Y7-->C
N7-->C
A. Pipelines are enabled and must succeed (existing behavior, small copy change here)
- Settings -> General -> Merge Requests -> Merge checks -> "Pipelines must succeed" is enabled
- Settings -> General -> Visibility, project features, permissions -> "Pipelines" is enabled
- Pipeline section of the merge request widget states the default pipeline information.
- The merge section of the merge request widget states:
Pipelines must succeed for merge requests to be eligible to merge. Please retry or push a new commit to fix the failure.
B. Pipelines are disabled and there is pipeline information available for the commit (pipelines were enabled when the commit was created):
- Settings -> General -> Merge Requests -> Merge checks -> "Pipelines must succeed" is enabled
- Settings -> General -> Visibility, project features, permissions -> "Pipelines" is disabled
- Pipeline information is generally not shown anymore except in merge requests where it is required to succeed.
- Pipeline section of the merge request widget states:
A failed pipeline was run for this commit
- In case of a succeeded or other status pipeline we should state:
A [Insert status] pipeline was run for this commit
- In case of a succeeded or other status pipeline we should state:
- The merge section of the merge request widget states:
Pipelines must succeed for merge requests to be eligible to merge. Please enable pipelines for this project to continue. For more information, see the documentation.
C. Pipelines are disabled and there is no pipeline information available for the commit (pipelines were not enabled or there was no ci configuration when the commit was created):
- Settings -> General -> Merge Requests -> Merge checks -> "Pipelines must succeed" is enabled
- Settings -> General -> Visibility, project features, permissions -> "Pipelines" is disabled
- Pipeline information is generally not shown anymore except in merge requests where it is required to succeed.
- Pipeline section of merge request widget states:
No pipeline was run for this commit.
- The merge section of the merge request widget states:
Pipelines must succeed for merge requests to be eligible to merge. Please enable pipelines for this project to continue. For more information, see the documentation.
D. Pipelines are enabled and there is no pipeline information available for the commit and there is a ci configuration available (pipelines were not enabled or there was no ci configuration when the commit was created):
- Settings -> General -> Merge Requests -> Merge checks -> "Pipelines must succeed" is enabled
- Settings -> General -> Visibility, project features, permissions -> "Pipelines" is enabled
- Pipeline section of merge request widget states:
No pipeline was run for this commit.
- The merge section of the merge request widget states:
Pipelines must succeed for merge requests to be eligible to merge. Please retry the job or push a new commit to fix the failure. For more information, see the documentation.
E. Pipelines are enabled and there is no pipeline information available for the commit and there is no ci configuration available (pipelines were not enabled or there was no ci configuration when the commit was created):
- Settings -> General -> Merge Requests -> Merge checks -> "Pipelines must succeed" is enabled
- Settings -> General -> Visibility, project features, permissions -> "Pipelines" is enabled
- Pipeline section of merge request widget states:
No pipeline was run for this commit.
- The merge section of the merge request widget states:
Pipelines must succeed for merge requests to be eligible to merge. Please create a CI configuration. For more information, see the documentation.
Scenario 2
For scenario 2 there is a small edit where the pipeline information is made visible so we don't need to show a custom message:
B. Pipelines are disabled and there is pipeline information available for the commit (pipelines were enabled when the commit was created):
Pipeline section of the merge request widget states:A failed pipeline was run for this commit
- Pipeline section of the merge request widget states the default pipeline information as if pipelines were not disabled.
This also counts for non-failed pipelines