How to get reviewer for a merge proposal using lauchpadlib API?

Asked by markpitchless on 2012-04-11

I'm using to launchpadlib to grab active reviews for our team. This gets me all sorts of useful info but I can't work out how to find the person who is doing the review, the reviewer. I can find who submitted the review. When I look at the LP web site for the merge I can see the reviewer listed in a table. Have looked through all the data returned and the rest interface docs but can't seem to see it.

How can I get the reviewer via the API?

In case it helps this is how I'm getting the merge proposals:

 lp = Launchpad.login_with( ... )
 team = lp.people( 'teamname' )
 props = team.getMergeProposals(status='Needs review')
 for mp in props:
     # how do i get reveiwer out of mp?

Question information

English Edit question
Launchpad itself Edit question
No assignee Edit question
Solved by:
Francis J. Lacoste
Last query:
Last reply:
markpitchless (markpitchless) said : #1

Ok, to answer my own question I think I found it. The reviewers are found via votes for them, at most one per reviewer.

Expanding the example code:

 lp = Launchpad.login_with( ... )
 team = lp.people( 'teamname' )
 props = team.getMergeProposals(status='Needs review')
 for mp in props:
     for vote in mp.votes
         print vote.reviewer

Best Francis J. Lacoste (flacoste) said : #2

You can find the reference documentation for the API at the following link:

(You might want to read to see how to translate from that documentation to launchpadlib conventions.)

The branch_merge_proposal object has a reviewer_link attribute (will be .reviewer in launchpadlib) which contains the person who accepted the review. If the review wasn't accepted (they hit claim review in the UI, or made a comment on the review), it will be None. (

The tables you are seeing on the web page is made of code_review_vote_reference objects and can be accessed through the votes_collection_link (.votes in lplib). ( These objects also has a reviewer_link.

Hope that helps.

markpitchless (markpitchless) said : #3

Thanks for the complete answer Francis. I had basically got there, took a while to realise that reviewers get voted in!

markpitchless (markpitchless) said : #4

Thanks Francis J. Lacoste, that solved my question.