Skip to content

WIP: Implement distributing pipeline cron jobs

Furkan Ayhan requested to merge 33098-pipeline-schedule-distribution into master

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

Screen_Shot_2020-01-30_at_16.29.07

Screen_Shot_2020-01-30_at_16.29.01

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

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
Edited by Furkan Ayhan

Merge request reports