Skip to content

Test ci config for backend MR running as if for foss

Jennifer Li requested to merge jennli-test-ci-config-as-if-foss into master

What does this MR do and why?

To Verify CI configuration against a future backend MR pipelines labeled with pipeline:run-as-if-foss.

Related issue: #381624

This MR will create a manual job if CI configuration change has been made in an MR (i.e if .gitlab/ci/**.yml files are changed) to verify the potential jobs being created in a future backend MR with pipeline:run-as-if-foss.

Screen_Shot_2022-11-06_at_3.01.44_PM

How does this work

  1. Team member makes a change to a CI configuration yml in branch ci-config-branch and submit an MR, which automatically starts an MR pipeline (pipline1).
  2. A manual job will be available in the prepare state of the MR pipeline (pipeline1), which if started is allowed to fail.
  3. When triggered to run, this manual job creates a branch test-ci-config-ci-config-branch-backend-automated, makes a dummy change to the backend file pattern, pushes a commit and create a MR against the ci-config-branch with the label pipeline:run-as-if-foss.
  4. A "dry-run" pipeline, pipeline2, is therefore created for the dummy MR running CI following the new CI config from ci-config-branch. The jobs in pipeline2 will be canceled right away.
  5. The manual job from pipeline1 then validates the jobs created in pipeline2, user can check to see if the resulting jobs in the dry-run pipeline are expected.
  6. pipeline2 then gets canceled immediately to minimize resource consumption.
  7. When user triggers the manual job from pipeline1, they have the option to supply a REFERNCE_PIPELINE_ID, which will be used for comparison and help user better visualize which jobs in pipeline2 are potentially different from the reference pipeline.
  8. If REFERENCE_PIPELINE_ID is undefined, the job will simply list all the jobs that will be created for a sanity check.

Test results

Scenario Output
REFERENCE_PIPELINE_ID present, comparing the dry-run pipeline jobs with a previously ran pipeline Screen_Shot_2022-11-06_at_2.42.26_PM
REFERENCE_PIPELINE_ID not present, show job list being created by the dry-run pipeline Screen_Shot_2022-11-06_at_2.45.28_PM

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 Jennifer Li

Merge request reports