API question: list of files in requests, filtered by path and request date

2012-12-05 Thread dado
What would be the best way of getting a list of all reviewed files matching 
a determined perforce path?
I also know I'm after the reviews created after 04/01/12.
Should I simply get all the reviews after that date and do any additional 
filtering client-side?
If so, what would be the best way to get all reviews after April *and* the 
list of files in the reviews?
I've used the WEB API before, but I'm clearly not very comfortable with it 
yet.

Thanks,
Dado

-- 
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




Re: REST examples?

2012-04-18 Thread Dado Feigenblatt

Actually, I'm writing this application in Python.
Unfortunately we can't wait for the new Python API.
I wish. I'm not very proficient on REST design patterns.

I guess I might have made two wrong assumptions.
One that rbtools didn't use REST, and the other that I couldn't import 
it.
Now I now it does use REST, but can I import it into my own 
application?

What about other modules within rbtools?

Otherwise it seems I'll be using 'requests' to handle REST
http://docs.python-requests.org/en/latest
Slumber (http://slumber.in/) looks like an interesting OOP layer on top 
of that, but RB's hyphenated resource names (i.e. review-requests) don't 
lend themselves to it as they can't be converted into object attributes.

In slumber one would do
   api.review-requests.get()
but that's not valid Python.

What I'm trying to do is to add RB to our software management and 
deployment application.

It already talks to Perforce.
We want it to also talk to Review Board so we can tie all together.
At this point the functionality requirements are pretty basic.
Initially we only need to be able to create the review request from our 
tool and save its id in our own DB.
Then we'll want to condition releases to approval statuses, locate all 
reviews for a particular file, that sort of thing.


Thanks,
Dado


On Wed, 18 Apr 2012 16:58:27 -0700, Christian Hammond 
chip...@chipx86.com wrote:

Hi Dado,

Given your goal of creating review requests, I'd suggest looking at
post-review (part of our RBTools package), as that's basically its
primary purpose.

We are working on a set of actual Python bindings to interface with
Review Board, which should make life easier (if you can use Python 
for

your work), but it's unfortunately not anywhere near ready yet.

Can you say what you're building and what capabilities you're looking
to use?

Christian

--
Christian Hammond - chip...@chipx86.com [1]
Review Board - http://www.reviewboard.org [2]
 VMware, Inc. - http://www.vmware.com [3]

On Wed, Apr 18, 2012 at 3:45 PM, Dado Feigenblatt  wrote:
 Hi,

 I'm kind of new to REST.
 I get the gist of the API.
 Since I'm starting an application from scratch, I was wondering if
there are any examples I could use for design reference.
 Bonus points if it deals with creating requests.
 Is there any such thing?

 Thanks,
 Dado

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

 --
 Want to help the Review Board project? Donate today at
http://www.reviewboard.org/donate/ [9]
 Happy user? Let us know at http://www.reviewboard.org/users/ [10]
 -~--~~~~--~~--~--~---
 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 [11]

Links:
--
[1] mailto:chip...@chipx86.com
[2] http://www.reviewboard.org
[3] http://www.vmware.com
[4] mailto:d...@dado.org
[5] http://www.reviewboard.org/donate/
[6] http://www.reviewboard.org/users/
[7] mailto:reviewboard%2bunsubscr...@googlegroups.com
[8] http://groups.google.com/group/reviewboard?hl=en
[9] http://www.reviewboard.org/donate/
[10] http://www.reviewboard.org/users/
[11] 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


problem with session cookies

2012-05-23 Thread Dado Feigenblatt

Hi,

When I authenticate and receive a rbsessionid cookie back, the host 
name is empty '', and discard=True.

I'm using the requests package.
I'm not sure if there are other parameters I should send with my 
request to have the cookie properly set.

Any idea?

Thanks,
Dado

--
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


Re: problem with session cookies

2012-05-23 Thread Dado Feigenblatt

False alarm.
Problem solved after upgrading to the latest version of requests, 
0.12.1
Lesson learned: make sure the docs and the package are the same 
version.


Thanks,
Dado


On Wed, 23 May 2012 14:36:07 -0700, Dado Feigenblatt d...@dado.org 
wrote:

Hi,

When I authenticate and receive a rbsessionid cookie back, the host
name is empty '', and discard=True.
I'm using the requests package.
I'm not sure if there are other parameters I should send with my
request to have the cookie properly set.
Any idea?

Thanks,
Dado


--
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


overriding p4-client in post-review

2012-05-24 Thread Dado Feigenblatt

Hi,

I have a .p4rc file in my home account with my default perforce settings.
I need to remove that file in order to post a review for a changelist 
created in another p4 client spec.
Setting $P4CLIENT or using --p4-client=client makes no difference, 
although that works for p4 tools.
Is this a known problem and if so is there a means of working around it, 
preferably via $P4CLIENT  ?


Thanks,
Dado

--
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


Re: overriding p4-client in post-review

2012-05-25 Thread Dado Feigenblatt

My assessment wasn't entirely correct.
Even with the command-line p4 tool values set in a config file 
$P4CONFIG take precedence over other $P4* variables.


So that is a problem for post-review too.
If we run post-review with --p4-client it merely set 
os.environ['P4CLIENT'] and it will have no effect if $P4CONFIG points to 
a config file that sets a different client.


I'd say post-review needs to call p4 commands with -c p4_client, and 
other options too.


For the time being, since my environment already has all the values I 
need, I'm just calling os.environ.pop('P4CONFIG') in my wrapper before 
calling 'post-review'.
That doesn't work too well if I just want to override one value but use 
the rest from my .p4rc.



Thanks,
Dado





On Thu, 24 May 2012 22:53:17 -0700, Dado Feigenblatt d...@dado.org 
wrote:

Hi,

I have a .p4rc file in my home account with my default perforce 
settings.

I need to remove that file in order to post a review for a changelist
created in another p4 client spec.
Setting $P4CLIENT or using --p4-client=client makes no difference,
although that works for p4 tools.
Is this a known problem and if so is there a means of working around
it, preferably via $P4CLIENT  ?

Thanks,
Dado


--
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


how does post-review know if files changed?

2012-06-07 Thread Dado Feigenblatt
When updating a review, post-review will tell you if the file changed 
since it was last submitted for review.

How does it know that? Does RB save diffs for each request update?
If so, how can I retrieve them via the web api?

Thanks,
Dado

--
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


updating changelist # in request

2012-06-07 Thread Dado Feigenblatt

Hi,

I have some users that sometimes change their changelists for an open 
review request.
When they post-review their updates using a new changelist the diffs 
are done properly, files are added or removed from the review request as 
expected.

However, the changelist number in the request doesn't get updated.
It still shows the original changelist number which might have been 
deleted in perforce.


Is there a way to have the changelist number update?

Thanks,
Dado

--
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


Re: how does post-review know if files changed?

2012-06-08 Thread Dado Feigenblatt

Hi Ryan, thanks for the reply.

Unfortunately my server doesn't understand that request.
I'm running ReviewBoard 1.6.3.
I see you don't have '/api/' in your URL.
Are you intentionally not using the api, or is this the older method of 
interfacing with the server?


I tried the api method
  /api/review-requests/{review_request_id}/diffs/{diff_revision}/
but it doesn't contain the actual text of diff.

Eventually I got your example to work after I removed '/reviews/' from 
the url

  http://example.review.com/r/9/diff/raw/
But that returns a plain unicode string of the diff instead of json or 
xml.
Definitely better than nothing and I might end up using that, but I 
just want to make sure there's no blessed api method for getting the 
actual text of the diffs.


Thanks,
Dado


On Fri, 8 Jun 2012 00:47:43 -0700 (PDT), Ryan Raasch 
ryan.raa...@gmail.com wrote:

On Friday, June 8, 2012 1:41:32 AM UTC+2, dado wrote: When updating a
review, post-review will tell you if the file changed
 since it was last submitted for review.
 How does it know that? Does RB save diffs for each request update?

As far as I can tell, it doesn't. Post-review generates a diff based
on the local
changes. It then posts this diff to the server. Which maintains
versions of the diff.
There are not diffs of diffs, only versions.
  If so, how can I retrieve them via the web api?

Just use curl or wget with
http://example.review.com/reviews/r/9/diff/raw/

 Thanks,
 Dado

 --
 Want to help the Review Board project? Donate today at
http://www.reviewboard.org/donate/ [1]
 Happy user? Let us know at http://www.reviewboard.org/users/ [2]
 -~--~~~~--~~--~--~---
 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 [3]

Links:
--
[1] http://www.reviewboard.org/donate/
[2] http://www.reviewboard.org/users/
[3] 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


requests from user A owned by user B

2012-07-16 Thread Dado Feigenblatt


Hi,

I have a user A who all of his review requests end up being owned by 
another user B.

I tried it myself in a clean environment.
I became user A and posted a review with no extra arguments and it also 
ended up being owned by user B.


I stepped through post-review up to when it calls
rsp = self.api_post(review_request_href, data)
and successfully creates a new request.
At that point I checked the admin interface and the request was already 
owned by user B.


For completeness sake, the arguments to the api post are

  review_request_href = http://rboard02v/api/review-requests/
  data = {'changenum': '714435', 'repository': 'perforce04:1666'}

I have no idea where user B is coming from.
The users say at one point user A was having problems posting a review, 
then user B logged in and posted the review as himself.
They can't remember exactly what they did, but apparently this is when 
the problems begun.
Whatever they did, I don't understand how that could break things for 
user A permanently.


Using RBTools 0.4.1

Any help would be greatly appreciated.

Thanks,
Dado

--
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


Re: requests from user A owned by user B

2012-07-16 Thread Dado Feigenblatt

Oh, could user A's ~/.post-review-cookies.txt have user B session ID?
User A is gone for the day.
I'll post back tomorrow after I have user A authenticating again.

Thanks,
Dado


On Mon, 16 Jul 2012 18:07:19 -0700, Dado Feigenblatt d...@dado.org 
wrote:

Hi,

I have a user A who all of his review requests end up being owned by
another user B.
I tried it myself in a clean environment.
I became user A and posted a review with no extra arguments and it
also ended up being owned by user B.

I stepped through post-review up to when it calls
rsp = self.api_post(review_request_href, data)
and successfully creates a new request.
At that point I checked the admin interface and the request was
already owned by user B.

For completeness sake, the arguments to the api post are

  review_request_href = http://rboard02v/api/review-requests/
  data = {'changenum': '714435', 'repository': 'perforce04:1666'}

I have no idea where user B is coming from.
The users say at one point user A was having problems posting a
review, then user B logged in and posted the review as himself.
They can't remember exactly what they did, but apparently this is
when the problems begun.
Whatever they did, I don't understand how that could break things
for user A permanently.

Using RBTools 0.4.1

Any help would be greatly appreciated.

Thanks,
Dado


--
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


Re: API question: list of files in requests, filtered by path and request date

2012-12-06 Thread Dado Feigenblatt

Hi Christian,

We're using ReviewBoard version 1.6.3
We also using Perforce version P4D/LINUX26X86_64/2012.2/551823 
(2012/11/09)


We have a few different groups of developers.
One of these groups writes mostly one-offs or do local customizations 
at break neck speeds.

These is all in-house code, for their own use.
So for that group we never required the highest level of programming 
best-practices, but we want to start steering them in that direction.
Use of reviewboard has been optional but we might make that a 
requirement.
Right now we'd like to get some general stats in terms of how much of 
their code is being submitted for review, how much feedback people are 
getting, and that sort of stuff. We want to gauge current level of 
adoption and what effect it might have if/when we make that a 
requirement.


If we make code review a requirement for them, then I'll have to query 
reviewboard for each source file being released.
I'll have to make sure there's an approved review for that revision of 
the source file.
Or maybe if the file being released is in an approved review just by 
looking at diffs.
I haven't put much thought yet into what kind of checks make sense 
here.

Any advice on that would be greatly appreciated.
I thing I saw an email thread about that. I'll look that up.

How do you feel about users querying the database directly?
Is there any documentation on the schema?

Thanks,
Dado



On Thu, 6 Dec 2012 01:37:52 -0800, Christian Hammond 
chip...@chipx86.com wrote:

Hi Dado,

The web API isn't really built to provide this sort of query,
unfortunately. What would be needed is a new resource for all 
modified

diffs that let you query such information. I'd be happy to include
such a resource, but someone would have to write it.

I'm curious what you're working on. Maybe there are other solutions
for now. Also, what version of RB?

Christian

--
 Christian Hammond - chip...@chipx86.com [1]
Review Board - http://www.reviewboard.org [2]
VMware, Inc. - http://www.vmware.com [3]

On Wed, Dec 5, 2012 at 6:11 PM, dado  wrote:
 What would be the best way of getting a list of all reviewed files
matching a determined perforce path?
I also know I'm after the reviews created after 04/01/12.
Should I simply get all the reviews after that date and do any
additional filtering client-side?
 If so, what would be the best way to get all reviews after April
*and* the list of files in the reviews?
I've used the WEB API before, but I'm clearly not very comfortable
with it yet.

Thanks,
Dado

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

 --
 Want to help the Review Board project? Donate today at
http://www.reviewboard.org/donate/ [9]
 Happy user? Let us know at http://www.reviewboard.org/users/ [10]
 -~--~~~~--~~--~--~---
 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 [11]



Links:
--
[1] mailto:chip...@chipx86.com
[2] http://www.reviewboard.org
[3] http://www.vmware.com
[4] mailto:d...@dado.org
[5] http://www.reviewboard.org/donate/
[6] http://www.reviewboard.org/users/
[7] mailto:reviewboard%2bunsubscr...@googlegroups.com
[8] http://groups.google.com/group/reviewboard?hl=en
[9] http://www.reviewboard.org/donate/
[10] http://www.reviewboard.org/users/
[11] 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




Re: Info per source file

2012-12-06 Thread Dado Feigenblatt


I have the exact same problem.
I've never used Django.
Would it be possible to leverage the Django ORM client side?

Thanks,
Dado



On Thu, 6 Dec 2012 05:40:07 -0800 (PST), Laimonas Mockus 
laimonas.moc...@gmail.com wrote:

Hi,

I'm writing a command line python script (to check if the given
sourcefile was reviewed). My idea is to fetch enough information from 
Mysql tables.

E.g.:
1. select diffset_id from reviewboard.diffviewer_filediff (where 
source_file==_needed_filename_)
2. select history_id from reviewboard.diffviewer_diffset (where 
id=_=selected_diffset_id_)
3. select ship_it from reviewboard.reviews_review (where 
id=_=selected_diffset_id_)

ship_it==1 would tell that at least one file was reviewed in a
diffset. The information would be incomplete but better than nothing.
I even can't check this way if a whole diffset was reviewed.

I didn't try web API, but It may be useful if You post an example.

Thanks,
Laimonas


--
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