Prevent "Accept Merge Request" if a pipeline hasn't been run yet.
Summary
If a pipeline is set to run manually (there is no automatic steps), it is possible to accept a merge request when the "Only allow merge requests to be merged if the pipeline succeeds" setting is enabled.
Steps to reproduce
- Create a one-step CI pipeline where it has to be triggered manually.
- Make sure "Only allow merge requests to be merged if the pipeline succeeds" is enabled.
- Create a merge request.
- Note that you can accept the merge request without ever having run the pipeline.
What is the current bug behavior?
Merge requests can be accepted with no pipeline ever being run when you have "Only allow merge requests to be merged if the pipeline succeeds" enabled.
What is the expected correct behavior?
If I have enabled "Only allow merge requests to be merged if the pipeline succeeds", then I would expect the Accept Merge Request button to be disabled until such time that a pipeline has been successfully run, whether its automatically run or manually run.
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: Ubuntu 16.04 Current User: git Using RVM: no Ruby Version: 2.3.3p222 Gem Version: 2.6.6 Bundler Version:1.13.7 Rake Version: 10.5.0 Redis Version: 3.2.5 Git Version: 2.11.1 Sidekiq Version:5.0.0GitLab information Version: 9.2.2 Revision: cbde95c Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql URL: http://192.168.0.200 HTTP Clone URL: http://192.168.0.200/some-group/some-project.git SSH Clone URL: git@192.168.0.200:some-group/some-project.git Using LDAP: no Using Omniauth: no
GitLab Shell Version: 5.0.4 Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks Git: /opt/gitlab/embedded/bin/git
Results of GitLab application Check
Expand for output related to the GitLab application check
Checking GitLab Shell ...GitLab Shell version >= 5.0.4 ? ... OK (5.0.4) Repo base directory exists? default... yes Repo storage directories are symlinks? default... no Repo paths owned by git:root, or git:git? default... yes Repo paths access is drwxrws---? default... yes hooks directories in repos are links: ... 2/1 ... ok 1/2 ... ok 3/3 ... ok Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Check GitLab API access: OK Access to /var/opt/gitlab/.ssh/authorized_keys: OK Send ping to redis server: OK gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Reply by email ...
Reply by email is disabled in config/gitlab.yml
Checking Reply by email ... Finished
Checking LDAP ...
LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab ...
Git configured with autocrlf=input? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config outdated? ... no Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory setup correctly? ... yes Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) projects have namespace: ... 2/1 ... yes 1/2 ... yes 3/3 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.1.0 ? ... yes (2.3.3) Your git bin path is "/opt/gitlab/embedded/bin/git" Git version >= 2.7.3 ? ... yes (2.11.1) Active users: 3
Checking GitLab ... Finished