Re: How to get review id before publishing a review request

2014-03-12 Thread Howard Lin
Hi Matthew,
Is below command available in 0.5.8 alpha 0 (dev) ?
=
When RBTools 0.5 lands it will be much easier, as there should be an rbt 
command to take a review request ID and publish it. 
=
I'd like to get review request ID  before publishing, later it will be 
updated and published.
Thanks.

Howard


On Friday, February 22, 2013 12:29:43 PM UTC-5, Matthew Woehlke wrote:

 On 2013-02-22 01:20, chuck j wrote: 
  Yes i am using wrapper over post-review script. I am already using 
 stdout 
  of post-review to get the review id. I wanted to know if there is any 
 API 
  which will help me get the review id before publishing the review 
 request? 
  which i can use in my wrapper. 

 I don't think I understand what you want... the review ID doesn't exist 
 until you create the review, e.g. with post-review. Once the draft is 
 created, you can get the ID from post-review by parsing its stdout (not 
 elegant, but I don't know a better way). 

 If you mean that you need your script to create a draft, get the ID, do 
 something else, and then publish the review request... I don't believe 
 this is easily possible right now. When RBTools 0.5 lands it will be 
 much easier, as there should be an rbt command to take a review request 
 ID and publish it. 

 Otherwise, I think your only other option is to modify or copy 
 post-review so that you can add your own logic at the python layer. 

 Probably the best long term solution would be to write your logic in 
 Python and import the RBTools modules (again, will require at least 
 RBTools 0.5). RBTools should eventually have a way for other python code 
 to call to create a request that will get the ID back as a python 
 object, so that you do not need to do output parsing or other such 
 work-arounds. (And you will also be able to call other python code to 
 publish the request, once you have done whatever else you need to do.) 

 -- 
 Matthew 


-- 
Get the Review Board Power Pack at http://www.reviewboard.org/powerpack/
---
Sign up for Review Board hosting at RBCommons: https://rbcommons.com/
---
Happy user? Let us know at http://www.reviewboard.org/users/
--- 
You received this message because you are subscribed to the Google Groups 
reviewboard group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to get review id before publishing a review request

2013-02-22 Thread Matthew Woehlke

On 2013-02-22 01:20, chuck j wrote:

Yes i am using wrapper over post-review script. I am already using stdout
of post-review to get the review id. I wanted to know if there is any API
which will help me get the review id before publishing the review request?
which i can use in my wrapper.


I don't think I understand what you want... the review ID doesn't exist 
until you create the review, e.g. with post-review. Once the draft is 
created, you can get the ID from post-review by parsing its stdout (not 
elegant, but I don't know a better way).


If you mean that you need your script to create a draft, get the ID, do 
something else, and then publish the review request... I don't believe 
this is easily possible right now. When RBTools 0.5 lands it will be 
much easier, as there should be an rbt command to take a review request 
ID and publish it.


Otherwise, I think your only other option is to modify or copy 
post-review so that you can add your own logic at the python layer.


Probably the best long term solution would be to write your logic in 
Python and import the RBTools modules (again, will require at least 
RBTools 0.5). RBTools should eventually have a way for other python code 
to call to create a request that will get the ID back as a python 
object, so that you do not need to do output parsing or other such 
work-arounds. (And you will also be able to call other python code to 
publish the request, once you have done whatever else you need to do.)


--
Matthew

--
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
--- 
You received this message because you are subscribed to the Google Groups reviewboard group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How to get review id before publishing a review request

2013-02-21 Thread chuck j
Thanks,

Yes i am using wrapper over post-review script. I am already using stdout
of post-review to get the review id. I wanted to know if there is any API
which will help me get the review id before publishing the review request?
which i can use in my wrapper.

Regards,
Chuck

On Wed, Feb 20, 2013 at 11:10 PM, Matthew Woehlke
mwoehlke.fl...@gmail.comwrote:

 On 2013-02-20 12:31, chuck j wrote:

 how to get review request id after successful posting of review request
 and
 before publishing the review request.


 Can you be more specific? How are you posting the review request? In what
 form do you need the ID?

 If you are writing a wrapper over post-review and need the request ID
 (e.g. my git-rb script does this), you can redirect the output to a
 temporary file, and find the ID from that like so:

   matchexpr='Review request #[0-9][0-9]* posted'
   request=$(sed -n /^$matchexpr/'{s/^.*#//;s/ .*$//;p}' $log)

 (...where 'log' is a shell variable with the name of the temporary file
 containing the output of post-review.)

 Don't forget to check the exit status of post-review to know if it
 succeeded.

 If you are using the web interface, the ID is part of the URI as soon as
 you create a new request; just look at your address bar.

 If you generically know that there exists a review request draft, the best
 you will be able to do is list all requests, query the status of each, and
 note any that are drafts.

 --
 Matthew


-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
reviewboard group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How to get review id before publishing a review request

2013-02-20 Thread Matthew Woehlke

On 2013-02-20 12:31, chuck j wrote:

how to get review request id after successful posting of review request and
before publishing the review request.


Can you be more specific? How are you posting the review request? In 
what form do you need the ID?


If you are writing a wrapper over post-review and need the request ID 
(e.g. my git-rb script does this), you can redirect the output to a 
temporary file, and find the ID from that like so:


  matchexpr='Review request #[0-9][0-9]* posted'
  request=$(sed -n /^$matchexpr/'{s/^.*#//;s/ .*$//;p}' $log)

(...where 'log' is a shell variable with the name of the temporary file 
containing the output of post-review.)


Don't forget to check the exit status of post-review to know if it 
succeeded.


If you are using the web interface, the ID is part of the URI as soon as 
you create a new request; just look at your address bar.


If you generically know that there exists a review request draft, the 
best you will be able to do is list all requests, query the status of 
each, and note any that are drafts.


--
Matthew

--
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
--- 
You received this message because you are subscribed to the Google Groups reviewboard group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How to get review id before publishing a review request

2013-02-20 Thread Raja
Hi
You would have to know one of the following parameters when making a GET 
call: 
 changenum, time-added-to, time-added-from, 
 last-updated-to, last-updated-from, from-user,  repository,  ship-it, 
 status, to-groups,to-user-groups, to-users, to-users-directly
Something like
http://server/api/review-requests/http://localhost:8080/api/review-requests/draft?time-added-from=2013-02-20
 
  -- to find all reviews that were posted today. You could probably use 
the other flags as Query parameters to narrow down your query results. 
Dates of the format -MM-DD or -MM-DDTHH:MM:SS 

Regards
Raja

On Wednesday, February 20, 2013 11:01:23 PM UTC+5:30, chuck j wrote:

 Hi,

 how to get review request id after successful posting of review request 
 and before publishing the review request.

 I tried to search a lot in reviewbaord forum but couldn't find relevant 
 response, do we have such api which will help our need.

 Thanks,
 Chuck  


-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
reviewboard group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.