Skip to content

Refactor Create Pipeline execution

Kasia Misirli requested to merge 207946/Fix_execute_for_pipeline_creation into master

What does this MR do and why?

Describe in detail what your merge request does and why.

This MR is adding a fix for the following issue #207946 (closed) We plan to retire the execute! method on CreatePipelineService in favour of the execute method as the former does not run sufficient checks eg save_on_errors: false scenario. For this change I have introduced a feature flag to ensure safety of the release.

Steps:

  1. Removing usage of the execute! on BaseHooksService
  2. Removing usage of the execute! on RunPipelineScheduleWorker
  3. Remove usage of execute! is spec files. -> WIP MR
  4. Remove the execute! method on CreatePipelineService -> WIP MR

The 3rd step mentioned above has been moved to its own MR as the change will require a refactor in multiple spec files. The idea is to use the execute method that already exists and is being used in CreatePipelineService.

**UPDATE: **

**We have changed the direction and instead of applying the changes (refactoring to use the execute method instead of execute!), we have decided to add a feature flag that will allow us to toggle the old and the new implementation to de-risk this change. ** Please see the issue that explains the feature flag details further: #378257 (closed)

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

BaseHooksService

This is called when we push to a branch rather than triggering one through the UI.

  1. Create a branch
  2. Push to the branch
  3. Ensure a pipeline runs as usual

RunPipelineScheduleWorker

  1. Create a pipeline schedule for an existing project with a CI file https://docs.gitlab.com/ee/ci/pipelines/schedules.html#add-a-pipeline-schedule
  2. Play the schedule
  3. Ensure the RunPipelineScheduleWorker runs via the logs
    tail -f <path_to_gdk>/gitlab/log/sidekiq.log
  4. Ensure the pipeline is scheduled

MR acceptance checklist

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

Edited by Kasia Misirli

Merge request reports

Loading