buildbot_bridge

This module contains helper methods to help schedule tasks on TaskCluster which will use the buildbot-bridge system to trigger them on buildbot.

Instead of using LDAP credentials like for Buildapi, you need to have a set of credentials with a couple of scopes for this purpose.

At this moment only a limited number of a Mozilla employee can create credentials for you:

After you receive your credentials you can specify your credentials with:

  • export TASKCLUSTER_CLIENT_ID=<value>
  • export TASKCLUSTER_ACCESS_TOKEN=<value>

You can use the script https://github.com/mozilla/mozilla_ci_tools/blob/master/mozci/scripts/buildbot_to_taskcluster.py to schedule Buildbot jobs via TaskCluster.

mozci.sources.buildbot_bridge.buildbot_graph_builder(builders, revision)

Return graph of builders based on a list of builders.

# XXX: It would be better if had a BuildbotGraph class instead of messing
with dictionaries. https://github.com/mozilla/mozilla_ci_tools/issues/353

Input: a list of builders and a revision Output: a graph with the builders we received and the necessary upstream jobs

Graph of N levels:
{
‘Builder a1’: {
‘Builder a2’: {
...
‘Builder aN’: None

},

}, ‘Builder b1’: None

}

Parameters:
  • builders (list) – List of builder names
  • revision (str) – push revision
Returns:

A graph of buildernames (single level of graphs)

Return type:

dict

mozci.sources.buildbot_bridge.generate_builders_tc_graph(repo_name, revision, builders_graph)

Return TaskCluster graph based on builders_graph.

NOTE: We currently only support depending on one single parent.

:param repo_name The name of a repository e.g. mozilla-inbound :type repo_name: str :param revision: push revision :type revision: str :param builders_graph:

It is a graph made up of a dictionary where each key is a Buildbot buildername. The value for each key is either None or another graph of dependent builders.
Returns:return None or a valid taskcluster task graph.
Return type:dict
mozci.sources.buildbot_bridge.generate_graph_from_builders(repo_name, revision, buildernames, *args, **kwargs)

Return TaskCluster graph based on a list of buildernames.

:param repo_name The name of a repository e.g. mozilla-inbound :type repo_name: str :param revision: push revision :type revision: str :param buildernames: List of Buildbot buildernames :type buildernames: list

Returns:return None or a valid taskcluster task graph.
Return type:dict
mozci.sources.buildbot_bridge.trigger_builders_based_on_task_id(repo_name, revision, task_id, builders, *args, **kwargs)

Create a graph of tasks which will use a TC task as their parent task.

:param repo_name The name of a repository e.g. mozilla-inbound :type repo_name: str :param revision: push revision :type revision: str :returns: Result of scheduling a TC graph :rtype: dict