WIP: Implement distributing pipeline cron jobs
What does this MR do?
First
It is just a proposal :)
We allow users to select daily/weekly/monthly schedule options at 4am.
GitLab.com
runs PipelineScheduleWorker
every 5 minutes.
So these all jobs runs at 04:05 am. With this approach, we can distribute newly created jobs from 4:00 to 4:59
. (Actually it will run at 4:05, 4:10, .., 4:50, 4:55
because of pipeline_schedule_worker[cron]
setting of GitLab.com)
This MR also includes some refactoring and new tests.
ref #33098 (closed)
Before changing pipeline_schedule_worker[cron]
from 19 * * * *
to */5 * * * *
(I am not sure when), GitLab.com used to run PipelineScheduleWorker
at only 19th minute of hours. Right now, it runs at every 5 minutes. So when a user select 18 4 * * *
, it will run at 04:20
.
We have another proposal suggesting that storing input_source
to distinguish between user 4 am selection and manual input. Since that approach requires new column, I just want to share this proposal.
In this MR, it just randomly set a minute for 4 am selections, and users can see this value before saving.
Screenshots
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team