Apologies for awakening a zombie thread. I ended up implementing this 
support if anyone is interested. It is posted at:


It adds both comments and closing as submitted support (there is code for 
discard but this is unused and so kinda' dirty).

I'm not sure it is ready for merging into master but I thought I'd share it 
in case there is interest.


On Friday, February 5, 2010 3:20:34 PM UTC-8, Chris Clark wrote:

    One of the many things on my todo-but-never-get-to-it list is to add
    close/submit support to postreview.

    Roshan, if I was in your shoes I'd extend postreview to do what you 

    postreview already has the plumbing in place for auth and talking to the
    RB server, admittedly postreview is really for posting code so this is
    changing the behavior slightly. I think it does fit into what postreview
    is used for, tying in working copies to reviews.

    If you do this, I'd love to get a copy :-)


    Christian Hammond wrote:
    > Are you storing and sending the cookie? We handle authentication
    > persistence by cookies, so you'd have to do this. If you're writing
    > this in Python, take a look at the CookieJar stuff in post-review.
    > Christian
    > --
    > Christian Hammond - 
    > Review Board - http://www.reviewboard.org
    > VMware, Inc. - http://www.vmware.com
    > On Thu, Feb 4, 2010 at 11:21 PM, roshan pius
    > <roshanpiusthomas wrote:
    >     Hi Christian,
    >     I'm not able to close the review through HTTP POST, it kept
    >     returning error to login, even though i had logged in just before
    >     that.
    >     I'm using a python script with simplejson to do this. I've tried
    >     logging in as the user who submitted the review as well as the
    >     admin. But i'm not able to close the review. Do i need to send any
    >     parameters for this  HTTP post ?
    >     Request to server: http://<IPADDRESS>/api/json/accounts/login/
    >     Response from server: {'stat': 'ok'}
    >     Closing the review for Reviewrequest 604...
    >     Close review URL: reviewrequests/604/close/submitted
    >     Request to server:
    >     http://<IPADDRESS>/api/json/reviewrequests/604/close/submitted/
    >     Response from server: {'stat': 'fail', 'err': {'msg': 'You are not
    >     logged in', 'code': 103}}
    >     Roshan Pius
    >     On Thu, Feb 4, 2010 at 7:37 AM, roshan pius
    >     <roshanpiusthomas>
    >     wrote:
    >         Hi Kunjal,
    >         Perforce has the "p4
    >         mechanism which can be used to run a script post-submission.
    >         So if you want to close the review automatically you could run
    >         a script, which would do the HTTP POST to
    >         /api/json/reviewrequests/<id>/close/submitted/ as suggested by
    >         Christian.
    >         Also if you use "change-commit" or "change-submit" triggers
    >         you would get the original changelist numbers itself, before
    >         they are changed by Perforce during submission.
    >         We currently use the "change-submit" trigger to check the
    >         whether the changelist was "shipped" before it can be
    >         submitted into Perforce.
    >         Roshan Pius
    >         On Thu, Feb 4, 2010 at 2:40 AM, Christian Hammond
    >         <chipx86> wrote:
    >             It is available today. You can do an HTTP POST to
    >             /api/json/reviewrequests/<id>/close/submitted/
    >             So Kunjal, basically you can write a post-commit hook that
    >             automatically closes the review request. It will require
    >             that there's some indication as to which review request
    >             the change is associated with. In Perforce, the change
    >             numbers will themselves change upon submit, but if you
    >             knew the previous change number that was posted to Review
    >             Board, you could use the
    >             call to get the info for the review request, pull the ID
    >             out of there, and then use that to call the
    >             /close/submitted/ call above.
    >             Christian
    >             --
    >             Christian Hammond - chipx86
    >             Review Board - http://www.reviewboard.org
    >             VMware, Inc. - http://www.vmware.com
    >             On Wed, Feb 3, 2010 at 11:00 AM, Chris Clark
    >             <Chris.Clark>
    >             wrote:
    >                 Kunjal wrote:
    >                     Once the Review is done, user has to make Review
    >                     as Close->Submitted
    >                     eles reviewers dashboard will still have the 
    >                     We enforce this process on developers and
    >                     developers are saying that
    >                     this is one extra step.
    >                     I was thinking whether it is possible to close the
    >                     review
    >                     automatically?
    >                     For example, for given Review, if the shipit_count
    >                     is more then zero
    >                     then review is approved and we can close it.
    >                     Is there any way to do it programatically?
    >                 IMHO having shiptit mark as submitted would not be
    >                 useful. Where we have RB reployed "Submitted" means
    >                 the code was submitted into source code control (which
    >                 is a semi-manual process). What we'd find useful would
    >                 be a json call (possibly called from postreview) to
    >                 mark the review as submitted (if this is already
    >                 present please let me know).
    >                 Chris

Want to help the Review Board project? Donate today at 
Happy user? Let us know at http://www.reviewboard.org/users/
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to