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 - chip...@chipx86.com
Review Board - http://www.reviewboard.org
VMware, Inc. - http://www.vmware.com


On Thu, Feb 4, 2010 at 11:21 PM, roshan pius <roshanpiustho...@gmail.com>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 <roshanpiustho...@gmail.com>wrote:
>
>> Hi Kunjal,
>>
>> Perforce has the "p4 trigger"(
>> http://www.perforce.com/perforce/doc.current/manuals/cmdref/triggers.html)
>> 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 <chip...@chipx86.com>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
>>> /api/json/reviewrequests/repository/<repositoryid>/changenum/<changenum>/
>>> 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 - chip...@chipx86.com
>>> Review Board - http://www.reviewboard.org
>>> VMware, Inc. - http://www.vmware.com
>>>
>>>
>>> On Wed, Feb 3, 2010 at 11:00 AM, Chris Clark <chris.cl...@ingres.com>wrote:
>>>
>>>> Kunjal wrote:
>>>>
>>>>> Once the Review is done, user has to make Review as Close->Submitted
>>>>> eles reviewers dashboard will still have the review.
>>>>>
>>>>> 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
>>>> http://www.reviewboard.org/donate/
>>>> Happy user? Let us know at http://www.reviewboard.org/users/
>>>> -~----------~----~----~----~------~----~------~--~---
>>>> To unsubscribe from this group, send email to
>>>> reviewboard+unsubscr...@googlegroups.com<reviewboard%2bunsubscr...@googlegroups.com>
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/reviewboard?hl=en
>>>>
>>>
>>>  --
>>> Want to help the Review Board project? Donate today at
>>> http://www.reviewboard.org/donate/
>>> Happy user? Let us know at http://www.reviewboard.org/users/
>>> -~----------~----~----~----~------~----~------~--~---
>>> To unsubscribe from this group, send email to
>>> reviewboard+unsubscr...@googlegroups.com<reviewboard%2bunsubscr...@googlegroups.com>
>>> For more options, visit this group at
>>> http://groups.google.com/group/reviewboard?hl=en
>>>
>>
>>
>  --
> Want to help the Review Board project? Donate today at
> http://www.reviewboard.org/donate/
> Happy user? Let us know at http://www.reviewboard.org/users/
> -~----------~----~----~----~------~----~------~--~---
> To unsubscribe from this group, send email to
> reviewboard+unsubscr...@googlegroups.com<reviewboard%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/reviewboard?hl=en
>

-- 
Want to help the Review Board project? Donate today at 
http://www.reviewboard.org/donate/
Happy user? Let us know at http://www.reviewboard.org/users/
-~----------~----~----~----~------~----~------~--~---
To unsubscribe from this group, send email to 
reviewboard+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/reviewboard?hl=en

Reply via email to