Skip to content

Always run `package-and-qa` in scheduled pipelines

Mark Lapierre requested to merge ml-fix-package-and-qa-in-master into master

What does this MR do and why?

It stops the package-and-qa job trying to find diffs when it runs in a master pipeline.

  • Rename the script that checks if package-and-qa should run to package_and_qa_check.
  • Exit package_and_qa_check with a success code if the QA suite should run. Exit with code 2 if the QA suite should be skipped.
  • Report if find_change_diffs runs in a non-MR pipeline, but don't fail the job so it can run safely in a scheduled master pipeline.

Closes #345103 (closed)

How to set up and validate locally

To confirm that tooling/bin/find_change_diffs exits cleanly when run in a scheduled pipeline:

$ export PROJECT_TOKEN_FOR_CI_SCRIPTS_API_USAGE="token"
$ export CI_API_V4_URL=https://gitlab.com/api/v4
$ tooling/bin/find_change_diffs diffs
CI_MERGE_REQUEST_PROJECT_PATH is missing.
CI_MERGE_REQUEST_IID is missing.
Exiting as this does not appear to be a merge request pipeline.

The script should exit with code 0.

To confirm that tooling/bin/qa/package_and_qa_check returns the expected values:

$ export CI_MERGE_REQUEST_IID=73119 # Only 1 test being put in quarantine                                 
$ export CI_MERGE_REQUEST_PROJECT_PATH=gitlab-org/gitlab  
$ tooling/bin/find_change_diffs diffs
$ tooling/bin/qa/package_and_qa_check diffs
$ echo $?
2 # This indicates to skip the QA suite
$ rm -r diffs
$ export CI_MERGE_REQUEST_IID=73120 # Includes 1 test into quarantine and one QA framework change                                 
$ tooling/bin/find_change_diffs diffs
$ tooling/bin/qa/package_and_qa_check diffs
$ echo $?
0 # This indicates to run the QA suite
$ rm -r diffs
$ export CI_MERGE_REQUEST_IID=73123 # Includes 1 test into quarantine and another test change
$ tooling/bin/find_change_diffs diffs
$ tooling/bin/qa/package_and_qa_check diffs
$ echo $?
0 # This indicates to run the QA suite

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 Rémy Coutable

Merge request reports

Loading