Re: Use new python API to get latest changes
On 2013-03-20 20:12, A.M. wrote: Is it possible to use the rb API in 1.7.5 to get the changes to reviewboard in the past X minutes (any review request changes)? I am creating a review board poller which will then update a ticket system with links to reviewboard. I had previously made a reviewboard plugin for this task, but our ticket system is sluggish at times, so users are annoyed that the "Publish" step is blocking/slow. To address this, I would like to poll and update the ticket out-of-band. Have you considered moving your ticket updates to a separate thread? So, I see you already found a solution, but because it is a good use case, I'll mention it anyway... I have a feature request to add an asynchronous event monitoring system a la gerrit. The idea is you have a plugin that takes internal (synchronous) RB events and publishes them over some asynchronous channel (I used dbus since it is generally available on modern Linux systems, but you could use something else). You can then log into the system and run a listener program that will dump events to stdout (for dbus, a small Python script can do the job). If you run this in a separate process and connect a pipe to its output, buffering should take care of whatever lag your own process introduces, providing that the event queue doesn't fill the buffer. (You could trivially filter by relevant events to make that less likely.) The advantage of this versus polling is (potentially) less latency, and less load on the server and network because it is event driven (the server and network only need to do work when an event actually happens; you aren't making them work every poll-interval just to tell you that nothing has changed). -- 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: Use new python API to get latest changes
On Thu, 21 Mar 2013 00:12:30 +, "A.M." wrote: > Hello, > > Is it possible to use the rb API in 1.7.5 to get the changes to reviewboard > in the past X minutes (any review request changes)? I am creating a review > board poller which will then update a ticket system with links to > reviewboard. > > I had previously made a reviewboard plugin for this task, but our ticket > system is sluggish at times, so users are annoyed that the "Publish" step > is blocking/slow. To address this, I would like to poll and update the > ticket out-of-band. I figured this out myself. rbclient.get_root().get_review_requests(last_updated_from=X) Cheers, M -- 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: Use new python API to get latest changes
Hi You could use the /api/review-requests/?last-updated-from= to poll review requests that got updated after the "last update time". You could also use last-update-to, if you want to limit requests that happened to a particular time or use them both together to find requests updated in a particular time interval. The times have to be in the format of -MM-DD or -MM-DDThh:mm:ss or -MM-DDThh:mm:ss+TZ The other option is to write an extension that listens for the review_request_published signal and acts accordingly, but since you mentioned that the other system is sluggish, the users might have the same experience as the signals get processed in the same thread. Regards Raja On Thu, Mar 21, 2013 at 5:42 AM, A.M. wrote: > Hello, > > Is it possible to use the rb API in 1.7.5 to get the changes to reviewboard > in the past X minutes (any review request changes)? I am creating a review > board poller which will then update a ticket system with links to > reviewboard. > > I had previously made a reviewboard plugin for this task, but our ticket > system is sluggish at times, so users are annoyed that the "Publish" step > is blocking/slow. To address this, I would like to poll and update the > ticket out-of-band. > > Thanks. > > Best regards, > M > > -- > 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. > > > -- 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.