mozautomation package

Submodules

mozautomation.bugzilla module

Obtain Bugzilla auth cookies from Firefox.

This returns an iterable of 2-tuples of (login, cookie) sorted by the preferred usage order.

mozautomation.buildbotdata module

class mozautomation.buildbotdata.BuildInfo(o)

Bases: object

Describes buildbot data for a specific build/job

class mozautomation.buildbotdata.BuildbotDump(load_time=None)

Bases: object

Represents information from a buildbot dump file.

jobs_timeline()

Obtain a timeline of events for all jobs.

This is a generator of tuples describing events as they occur over time.

load_date(d)
load_dump(o)
load_time(t)
slave_efficiency(slave_id=None, slave_name=None)

Obtain a summary of activity on a given slave.

slave_groups()

Obtain information about groups of related slaves.

Returns a dictionary mapping the group name to a set of slave names.

slave_name(slave_id)
slave_names
slave_timeline(slave_id=None, slave_name=None)

Obtain a timeline of events on a given slave.

class mozautomation.buildbotdata.BuilderInfo(category, master_id, name, slave_ids)

Bases: tuple

category

Alias for field number 0

master_id

Alias for field number 1

name

Alias for field number 2

slave_ids

Alias for field number 3

mozautomation.buildbotdata.available_buildbot_dump_files()

Obtain URLs of all buildbot dump files containing raw info for jobs.

mozautomation.buildstatus module

class mozautomation.buildstatus.BuildStatusClient(base_uri=u'https://tbpl.mozilla.org/php/')

Bases: object

Client to interface with build status API.

revision_builds(repo, changeset)

Obtain the build status for a single changeset in a repository.

class mozautomation.buildstatus.BuildStatusResult(o)

Bases: object

class mozautomation.buildstatus.JobResult(d)

Bases: object

Represents the result of an individual automation job.

mozautomation.buildstatus.parse_builder_name(b)

Parse a builder name into metadata.

mozautomation.changetracker module

class mozautomation.changetracker.ChangeTracker(path)

Bases: object

Data store for tracking changes and bugs and repository events.

add_pushes(tree, pushes)

Insert an iterable of pushes for a tree.

pushes is an iterable of tuples of (pushid, who, when, nodes).

associate_bugs_with_changeset(bugs, changeset)

Associate a numeric bug number with a changeset.

This facilitates rapidly looking up changesets associated with bugs.

changesets_with_bug(bug)
last_push_id(tree)

Return the push ID of the last recorded push to a tree.

Returns an integer or None if no pushes are recorded.

load_pushlog(tree)
pushes_for_changeset(changeset)
tree_id(tree, url=None)
tree_push_head_changesets(tree)

Obtain all pushes on a given tree.

Returns pairs (push_id, head_changeset) like (1, ‘ay¡ø­0;¬N˜!97’).

Use binascii.hexlify to convert to a hexadecimal hash.

wipe_bugs()
wipe_pushlog()

mozautomation.commitparser module

Add hyperlinks to a commit message.

This is useful to be used as a Mercurial template filter for converting plain text into rich HTML.

mozautomation.commitparser.filter_reviewers(s)

Given a string, extract meaningful reviewer names.

mozautomation.commitparser.is_backout(commit_desc)

Returns True if the first line of the commit description appears to contain a backout.

Backout commits should always result in is_backout() returning True, and parse_backouts() not returning None. Malformed backouts may return True here and None from parse_backouts().

mozautomation.commitparser.parse_backouts(commit_desc, strict=False)

Look for backout annotations in a string.

Returns a 2-tuple of (nodes, bugs) where each entry is an iterable of changeset identifiers and bug numbers that were backed out, respectively. Or return None if no backout info is available.

Setting strict to True will enable stricter validation of the commit description (eg. ensuring N commits are provided when given N commits are being backed out).

mozautomation.commitparser.parse_bugs(s)
mozautomation.commitparser.parse_commit_id(s)

Parse a MozReview-Commit-ID value out of a string.

Returns None if the commit ID is not found.

mozautomation.commitparser.parse_requal_reviewers(commit_description)
mozautomation.commitparser.parse_reviewers(commit_description, flag_re=None)
mozautomation.commitparser.parse_rquestion_reviewers(commit_description)
mozautomation.commitparser.replace_reviewers(commit_description, reviewers)
mozautomation.commitparser.strip_commit_metadata(s)

Strips metadata related to commit tracking.

Will strip lines like “MozReview-Commit-ID: foo” from the commit message.

mozautomation.firefoxprofile module

mozautomation.firefoxprofile.find_profiles(find_times=False)

Find Firefox profile directories.

Returns an iterable of profile directories. The first entry is the active/default profile.

mozautomation.firefoxprofile.get_cookies(profile_path, host=None)

Obtain cookies from the profile.

Returns an iterable of dicts containing the raw entries from the cookies database.

host can be specified as a unicode string or an iterable of hostnames to limit results to.

mozautomation.firefoxprofile.sqlite_safe_open(*args, **kwds)

Helper to open SQLite databases in profiles.

Firefox locks database files, preventing new connections. So, we need to copy the entire file and delete it when we’re done.

mozautomation.releases module

class mozautomation.releases.Releases(d)

Bases: object

Holds information about Firefox releases.

Instances of this class are derived from the Releases API results.

firefox_nightly_releases()

All releases for Firefox Nightly.

class mozautomation.releases.ReleasesClient(base_uri=u'http://releases-api.mozilla.org/', opener=None)

Bases: object

Client to the releases API.

The releases API exposes information about builds on Firefox release channels.

releases()

mozautomation.repository module

class mozautomation.repository.MercurialRepository(url)

Bases: object

Interface with a Mozilla Mercurial repository.

push_info(full=False, start_id=0)

Obtain all pushlog info for a repository.

push_info_for_changeset(changeset)

Obtain the push information for a single changeset.

Returns a PushInfo on success or None if no push info is available.

class mozautomation.repository.PushInfo(push_id, d)

Bases: object

Represents an entry from the repository pushlog.

first_node
last_node
nodes

All the changesets pushed in this push.

mozautomation.repository.resolve_trees_to_official(trees)
mozautomation.repository.resolve_trees_to_uris(trees, write_access=False)

Resolve tree names to repositories URIs.

The caller passes in an iterable of tree names. These can be common names, aliases, or official names.

A list of 2-tuples is returned. If a repository could be resolved to a URI, the tuple is (common_name, uri). If a repository could not be resolved to a URI, the tuple is (specified_name, None).

mozautomation.repository.resolve_uri_to_tree(uri)

Try to resolve a URI back to a known tree.

mozautomation.repository.treeherder_url(tree, rev)

Obtain the Treeherder url for a push.

mozautomation.selfserve module

class mozautomation.selfserve.Branch(client, name, meta=None)

Bases: object

build(build_id)

Obtain info about a build specified by its ID.

builder(builder)

Return info on a single bingler.

builders()

Return info on builders building for this branch.

builds()

Returns a list of builds on this branch.

cancel_build(build_id)

Cancel a build specified by its ID.

rebuild(build_id)

Rebuild the build specified by its ID.

class mozautomation.selfserve.SelfServeClient(uri, opener=None)

Bases: object

branches()

Returns all the branches as Branch instances.

get_job(job_id)

Return information about a specific job.

jobs()

Returns a list of past self-serve request.

mozautomation.selfserve.get_mozilla_self_serve(username, password)

mozautomation.treestatus module

class mozautomation.treestatus.TreeLog(d)

Bases: object

Represents a change in a tree’s status.

class mozautomation.treestatus.TreeStatus(d)

Bases: object

Represents the status of an individual tree.

APPROVAL_REQUEST = u'approval required'
CLOSED = u'closed'
OPEN = u'open'
approval_required
closed
open
class mozautomation.treestatus.TreeStatusClient(base_uri=u'https://treestatus.mozilla-releng.net/', opener=None)

Bases: object

Client to the Mozilla Tree Status API.

The tree status API controls whether Mozilla’s main source repositories are open or closed.

all()

Obtain the status of all trees.

Returns a dict of tree names to TreeStatus instances.

tree_logs(tree)
tree_status(tree)

Obtain the status of a single tree.

Returns a TreeStatus instance.

Module contents