mozci

This module is generally your starting point.

In here, you will also find high level functions that will do various low level interactions with distinct modules to meet your needs.

mozci.mozci.determine_trigger_objective(revision, buildername, trigger_build_if_missing=True)

Determine if we need to trigger any jobs and which job.

Returns:

  • The name of the builder we need to trigger
  • Files, if needed, to trigger such builder
mozci.mozci.find_backfill_revlist(buildername, revision, max_revisions)

Determine which revisions we need to trigger in order to backfill.

This function is generally called by automatic backfilling on pulse_actions. We need to take into consideration that a job might not be run for many revisions due to SETA. We also might have a permanent failure appear after a reconfiguration (a new job is added).

When a permanent failure appears, we keep on adding load unnecessarily by triggering coalesced jobs in between pushes.

Long lived failing job (it could be hidden): * push N -> failed job * push N-1 -> failed/coalesced job * push N-2 -> failed/coalesced job ... * push N-max_revisions-1 -> failed/coalesced job

If the list of revision we need to trigger is larger than max_revisions it means that we either have not had that job scheduled beyond max_revisions or it has been failing forever.

mozci.mozci.manual_backfill(revision, buildername, max_revisions, dry_run=False)

This function is used to trigger jobs for a range of revisions when a user clicks the backfill icon for a job on Treeherder.

It backfills to the last known job on Treeherder.

mozci.mozci.query_builders(repo_name=None)

Return list of all builders or the builders associated to a repo.

mozci.mozci.query_repo_name_from_buildername(buildername, clobber=False)

Return the repository name from a given buildername.

Raises MozciError if there is no repository name in buildername.

mozci.mozci.query_repo_url_from_buildername(buildername)

Return the full repository URL for a given known buildername.

mozci.mozci.query_revisions_range(repo_name, from_revision, to_revision)

Return a list of revisions for that range.

mozci.mozci.set_query_source(query_source='buildapi')

Function to set the global QUERY_SOURCE

mozci.mozci.trigger(builder, revision, files=[], dry_run=False, extra_properties=None)

Helper to trigger a job.

Returns a request.

mozci.mozci.trigger_all_talos_jobs(repo_name, revision, times, dry_run=False)

Trigger talos jobs (excluding ‘pgo’) for a given revision.

mozci.mozci.trigger_job(revision, buildername, times=1, files=None, dry_run=False, extra_properties=None, trigger_build_if_missing=True)

Trigger a job through self-serve.

We return a list of all requests made.

mozci.mozci.trigger_missing_jobs_for_revision(repo_name, revision, dry_run=False)

Trigger missing jobs for a given revision. Jobs containing ‘b2g’ or ‘pgo’ in their buildername will not be triggered.

mozci.mozci.trigger_range(buildername, revisions, times=1, dry_run=False, files=None, extra_properties=None, trigger_build_if_missing=True)

Schedule the job named “buildername” (“times” times) in every revision on ‘revisions’.

mozci.mozci.valid_builder(buildername)

Determine if the builder you’re trying to trigger is valid.