Skip to content

Ensure schedule_next_run is run only once

What does this MR do and why?

This is second one of the follow-up MRs for !106661 (merged) that to ensure the schedule_next_run! is run in either PipelineScheduleService or RunPipelineScheduleWorker to prevent it from failing the check schedule.next_run_at > Time.current at https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/workers/run_pipeline_schedule_worker.rb#L23 when feature flag ci_use_run_pipeline_schedule_worker is enabled.

Otherwise, because PipelineScheduleService is used in two different places, one of them is for Play button for schedule job, the Play won't be able to run the schedule job immediately.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

How to set up and validate locally

  1. create a new project 338609-test-play-button
  2. add CI config by going to CI/CD -> Editor with the following content:
    image: busybox:latest
    
    build:
      script:
        - echo "Do your build here"
        - sleep 15
  3. go to CI/CD -> Schedules and create a schedule
  4. click the Play button for the created schedule
  5. go to CI/CD -> Pipelines and check if the pipeline for this schedule is created and runs

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #338609 (closed)

Merge request reports

Loading