WIP: Add scheduled job support in gitlab-ci.yml
What does this MR do?
This MR introduces a new syntax for job.when
in gitlab-ci.yml
.
Now it will be possible to postpone a job using something like this
my job:
script: "echo 'ok'"
when: in 1 hr
Here we are introducing a new state, :scheduled
, in HasStatus
A new Ci::Build
with this new syntax will transition from :created
to :scheduled
, after that transition a Ci::EnqueueBuildWorker
will be scheduled according to the time expressed in job.when
.
A scheduled job behaves like a manual job before it enters the :running
state (i.e. it can be run manually or canceled)
What are the relevant issue numbers?
See gitlab-org/gitlab-ee#1660
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
Tests added for this feature/bug -
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the database guides
Edited by Alessio Caiazza