Skip to content

trigger-jobs: Rewrite trigger-jobs to only run required post-merge jobs

The changes on trigger-jobs.py was condensed in one commit, three main reasons for this:

  1. The script was triggering jobs from pipelines with commits that were not necessarily merged into the main branch, wasting resources.
  2. Use the ETL wrapper for Gitlab to make it more uniform with the rest of the repository.
  3. Follow Python best-practices. Use functions and only run the script if it is called from terminal, not when it is imported as module.

In more details, the rewritten script only triggers performance jobs for GitLab pipelines associated with merge requests merged into the main branch.

  1. Connects to GitLab using the GitlabConnector class.
  2. Retrieves merge requests merged into the main branch within the last day.
  3. Sorts the merge requests by their merge date.
  4. Retrieves pipelines associated with the merge requests.
  5. Processes performance jobs in the pipelines, adding untriggered jobs to a list.
  6. Stops processing once it encounters a pipeline with triggered performance jobs.
  7. Triggers the untriggered performance jobs in chronological order.

Merge request reports