Manual deploy button used as ReDeploy button and without interval/restriction

Summary

In the environment page, the manual deploy button should be disabled when the task is already running and also when the task succeeds

Steps to reproduce

Setup a manual environment task and hit the deploy button 2 or 3 times successively, many jobs will be launched simultaneously

What is the current bug behavior?

We have two environments in our pipeline, staging and production, the production deploy task is set to manual, nothing special so far. The problem lies when we trigger the deploy manually, we noticed that we can do it as many times as we want using the same button, triggering multiple deployments for the same REVISION

What is the expected correct behavior?

We think this shouldn't be allowed for these reasons:

  • Semantically speaking, only the ReDeploy button should allow us to do that, and the manual action should be disabled when the task succeeds. as long as a new revision hasn't been pushed.
  • The manual deploy button could be hit as many times as we want without even waiting for the task to finish! 2 or more simultaneous tasks could be triggered within seconds!
  • If Gitlab exposes in the future a CI variable to inform the task about the action[button] used, the information would not be reliable.

Relevant logs and/or screenshots

Pasted_Image_10_19_17__11_44_AM

Results of GitLab environment info

System information
System:		Ubuntu 16.04
Current User:	git
Using RVM:	no
Ruby Version:	2.3.5p376
Gem Version:	2.6.13
Bundler Version:1.13.7
Rake Version:	12.0.0
Redis Version:	3.2.5
Git Version:	2.13.5
Sidekiq Version:5.0.4
Go Version:	unknown

GitLab information Version: 10.0.3 Revision: 8895150 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql URL: http://OUR_HOSTNAME HTTP Clone URL: http://OUR_HOSTNAME/some-group/some-project.git SSH Clone URL: git@OUR_HOSTNAME:some-group/some-project.git Using LDAP: no Using Omniauth: no

GitLab Shell Version: 5.9.0 Repository storage paths:

  • default: /var/opt/gitlab/git-data/repositories
  • storage1: /mnt/gitlab/git-data/repositories Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks Git: /opt/gitlab/embedded/bin/git

Possible fixes

Disable the manual action if the task is running, if it fails, re-enable, otherwise keep it disabled as long as the revision didn't change

/label ~bug

Edited Oct 29, 2017 by Aboubakr Gasmi
Assignee Loading
Time tracking Loading