Make it possible to define `when` policy for manual actions
Description
Currently are able to define following when policies for jobs (as per docs):
whenis used to implement jobs that are run in case of failure or despite the failure.
whencan be set to one of the following values:
on_success- execute job only when all jobs from prior stages succeed. This is the default.
on_failure- execute job only when at least one job from prior stages fails.
always- execute job regardless of the status of jobs from prior stages.
manual- execute job manually (added in GitLab 8.10). Read about manual actions below.
Because we use when: manual for manual actions it is not possible to define anything else here, so we fallback to on_success. In other words manual actions will be available only if previous stage succeeded.
Proposal
It is not completely obvious if manual fits well into usage with when keyword. Maybe we should make it a first-class configuration entry for job, like
deploy:
script: cap production deploy
manual: blocking
when: always
Links / references
https://gitlab.com/gitlab-org/gitlab-ce/issues/20280
/cc @markpundsack @ayufan