qisrc.review – Using code review (gerrit)

Handling pushing changes to gerrit

qisrc.review.fetch_gerrit_hook_ssh(path, username, server, port=None)

Fetch the commit-msg hook from gerrit

qisrc.review.check_gerrit_connection(username, server, ssh_port=29418)

Check that the user can connect to gerrit with ssh

qisrc.review.ask_gerrit_username(server, ssh_port=29418)

Run a wizard to try to configure gerrit access

If that fails, ask the user for its username If that fails, give up and suggest upload the public key

qisrc.review.get_gerrit_username(server, ssh_port)

Get the username to use when using code review.

Read it from the config file, or ask it and check it works

qisrc.review.setup_project(project)

Setup a project for code review:

If there is Remote configured for code review, using the ssh protocol, use it to fetch the gerrit commit-msg hook

qisrc.review.guess_emails(git, reviewers)

Fix the reviewer list.

Complete the email addresses with the committer email’s domain name when just the reviewer username is given, using the domain name of the ‘user.email’ setting from the given git.

Returns:the list of reviewers’ email
qisrc.review.push(project, branch, bypass_review=False, dry_run=False, reviewers=None, topic=None)

Push the changes for review.

Unless review is False, in this case, simply update the remote gerrit branch

Parameters:reviewers – A list of reviewers to invite to review