mozautomation package

Submodules

mozautomation.bugzilla module

mozautomation.buildbotdata module

mozautomation.buildstatus module

mozautomation.changetracker module

class mozautomation.changetracker.ChangeTracker(path, bytestype=<class 'bytes'>)

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, b’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.differential_revision_repl(match)

Replacement function to linkify Phabricator Differential Revision URLs in commit messages.

mozautomation.commitparser.filter_reviewers(s)

Given a string, extract meaningful reviewer names.

mozautomation.commitparser.htmlescape(s, quote=None)

Replace special characters “&”, “<” and “>” to HTML-safe sequences. If the optional flag quote is true, the quotation mark character (“) is also translated.

This is the same as cgi.escape in Python, but always operates on bytes, whereas cgi.escape in Python 3 only works on unicodes.

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, conservative=False)
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_reverts(commit_desc)

Look for revert annotations in a string.

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

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.releases module

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.

property first_node
property last_node
property 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

mozautomation.treestatus module

Module contents