Re: RB 1.6 - what is the new URI for logging in via the new API?

2012-10-08 Thread David Trowbridge
There's no specific login URL. The new API uses HTTP Basic
authentication for all requests.

-David


On Mon, Oct 8, 2012 at 4:47 PM, Steve  wrote:
> We have an old Perl script we use to create reviews. It was written against
> the old 1.5 API and I'm looking at porting it to the new 1.6 API.
> Unfortunately, I can't get past the login step. In the old script we used
> this uri:
>
> api/json/account/login/
>
> I've tried various alternative paths for the new API and looked in the code
> for postreview.py,  but have not made any progress and decided it was time
> to ask:
>
> What is the login uri under the new API?
>
> Thanks
>
> --Steve
>
> --
> 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

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


RB 1.6 - what is the new URI for logging in via the new API?

2012-10-08 Thread Steve
We have an old Perl script we use to create reviews. It was written against 
the old 1.5 API and I'm looking at porting it to the new 1.6 API. 
Unfortunately, I can't get past the login step. In the old script we used 
this uri:

api/json/account/login/

I've tried various alternative paths for the new API and looked in the code 
for postreview.py,  but have not made any progress and decided it was time 
to ask:

What is the login uri under the new API?

Thanks

--Steve

-- 
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: reviewboard 1.6.11 and reviewing problems with FireFox 3.6 and IE 9

2012-10-08 Thread Christian Hammond
Been sick and behind on some emails. Catching up.


On Oct 4, 2012, at 14:33, Chris Clark  wrote:

> The FF user who had problems has Firebug installed ready for the next time, 
> nothing has happened so far.
> 
> In a similar vein, I've Windows XP user with IE8 (the latest IE for that 
> platform) that had a single occurrence of writing a massive comment on a 
> review (along with diff/code comments) and the review being lost. He (luckily 
> copy/pasted the comment text into an email) hit publish, went away for an 
> hour for lunch and came back it was "still publishing" and so he ended up 
> closing the session down and lost his review (he did NOT any point use the 
> "save" option). I've just got Chrome installed on their machine but I wanted 
> to share this experience in case anyone else experiences this.

I don't know what the problem was, but we block in writing to the database and 
sending mail. It could have been one of these, or a browser-side problem.


> 
> The other weird behavior (and I've seen this in FF too) is occasionally 
> hitting Publish will show the "do you want to navigate away from this page" 
> dialog shows up. I'm a pretty compulsive "ctrl-s" saver so I know this is 
> benign (and I'm hitting publish too) but again sharing in case anyone else is 
> seeing this.

It's possible there's a problem somewhere here, but I haven't seen this except 
when a field was still in edit mode. Even if you hit Ctrl-S, it'll warn you, I 
believe.

> 
> 
> We're planning an upgrade to 1.6.12 soon, so maybe these will go away?

The latter wont. The former sounds more like a server-side problem and not a 
bug we're shipping with, unless its a JavaScript error.

Christian


> 
> Chris
> 
> 
> On Thursday, September 27, 2012 2:38:14 PM UTC-7, Chris Clark wrote:
>> 
>> On Thursday, September 27, 2012 2:12:08 PM UTC-7, Christian Hammond wrote:
>>> 
>>> The IE thing is weird, because I don't think anything should have changed 
>>> as far as text entry goes in a while... Which IE?
>> 
>> 
>> The IE behavior may not be new, for the version see the title (9) but recall 
>> it was seen with 8 too. I can get access to someones machine where this 
>> seems to occur on a regular basis.
>>  
>>> For Firefox, is there anything in the JavaScript console? Installing 
>>> Firebug (you may need an older one for FF3.6) would give you a lot more 
>>> useful information.
>> 
>> That might be tricky, I'm personally not seeing the problem but I'll mail 
>> out to the upgrade hold outs :-) and make sure they have it installed. I'll 
>> keep you posted on what we find.
> -- 
> 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

-- 
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: Can't post reviews w/ git after upgrade 1.63 -> 1.6.12

2012-10-08 Thread Christian Hammond
Hi Joe,

Yeah, you'd have to set the content type. That's one of the reason we ended
up moving to the new model, so that we can more easily send the headers we
need and process the resulting data.

Glad it's working now!

Christian

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


On Mon, Oct 8, 2012 at 11:14 AM, Joe  wrote:

> Christian,
>
> Thanks for clearing up the mystery.
>
> We went back to the v2 api whose raw URLs look like:
> /api/v2/yaml/blob/show/cm/ultrasound/?login=...&token=...
> As near as I can tell, the equivalent v3 url would be
> /api/v3/repos/cm/ultrasound/git/blobs/?access_token=...
> but the default content type returns a json wrapper around the file
> content base64-encoding. The only way I could see to change the content
> type was by setting the accepted content type header. Since you've done the
> real GitHub integration perhaps you know of another way?
>
> In any event, we're good for the time being -- no need to get this working
> for us.
>
> And thanks, for ReviewBoard -- it's great.
>
> Joe
>
>  --
> 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
>

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

Java PUT not working for web api 1.6.3

2012-10-08 Thread apaladinocitrix
Hi. I am trying to update a review request to add a target group and I got 
it to work using curl, but if I try the same command using Java using 
Spring RestTemplate or Apache Commons HttpClient, it doesn't work. I get a 
200 response code but there is no update being done. Can someone tell me 
what I am doing wrong? Thanks.

-- Java Code
public void testPut_rest() throws Exception{
String reviewId= "4969";
String authToken = "Basic YXBhbGFkaW5vOkNpdHJpeDExMTc=";
String url = 
"https://reviewboard-ouraddress-it.net/api/review-requests/"+reviewId+"/draft/";;

/*This works.

curl -k -H "Authorization: Basic YXBhbGFkaW5vOkNpdHJpeDExMTc=" -X PUT 
"https://reviewboard-ouraddress-it.net/api/review-requests/4968/draft/"; 
-d"api_format=json&expand=target_groups&target_groups=dev-adminservice%2C%20"
*/

try {

SimpleClientHttpRequestFactory requestFactory = new 
SimpleClientHttpRequestFactory() {
@Override
protected void prepareConnection(HttpURLConnection 
connection, String httpMethod) throws IOException {
super.prepareConnection(connection, httpMethod);
connection.setInstanceFollowRedirects(true);
}

};
RestTemplate restTemplate = new RestTemplate();
restTemplate.getMessageConverters().add(new 
FormHttpMessageConverter());
restTemplate.getMessageConverters().add(new 
MappingJacksonHttpMessageConverter());
restTemplate.getMessageConverters().add(new 
StringHttpMessageConverter());
restTemplate.getMessageConverters().add(new 
ByteArrayHttpMessageConverter());
restTemplate.setRequestFactory(requestFactory);
HttpHeaders requestHeaders = new HttpHeaders();
requestHeaders.set("Authorization", authToken);
requestHeaders.set("Content-Type", 
"application/x-www-form-urlencoded");

HttpEntity requestEntity = new HttpEntity(requestHeaders);

Map args = new HashMap();
args.put("api_format", "json");
args.put("expand", "target_groups");
args.put("target_groups", "dev-adminservice%2C%20");


HttpEntity response =
restTemplate.exchange(url, HttpMethod.PUT, 
requestEntity, Map.class, args);

System.out.println(response.getBody());



} catch (Exception e) {
e.printStackTrace();
}

}


-- 200 response code with following output
{"stat": "ok", "draft": {"last_updated": "2012-10-08 08:46:07", 
"description": "", "target_people": [], "changedescription": "", 
"target_groups": [], "links": {"self": {"href": 
"https://reviewboard-ouraddress-it.net/api/review-requests/4969/draft/";, 
"method": "GET"}, "update": {"href": 
"https://reviewboard-ouraddress-it.net/api/review-requests/4969/draft/";, 
"method": "PUT"}, "draft_screenshots": {"href": 
"https://reviewboard-ouraddress-it.net/api/review-requests/4969/draft/screenshots/";,
 
"method": "GET"}, "draft_file_attachments": {"href": 
"https://reviewboard-ouraddress-it.net/api/review-requests/4969/draft/file-attachments/";,
 
"method": "GET"}, "review_request": {"href": 
"https://reviewboard-ouraddress-it.net/api/review-requests/4969/";, 
"method": "GET", "title": "(no summary)"}, "delete": {"href": 
"https://reviewboard-ouraddress-it.net/api/review-requests/4969/draft/";, 
"method": "DELETE"}}, "bugs_closed": [], "public": false, "testing_done": 
"", "branch": "", "summary": "", "id": 4720}}

-- 
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: Can't post reviews w/ git after upgrade 1.63 -> 1.6.12

2012-10-08 Thread Joe
Christian,

Thanks for clearing up the mystery. 

We went back to the v2 api whose raw URLs look like:
/api/v2/yaml/blob/show/cm/ultrasound/?login=...&token=...
As near as I can tell, the equivalent v3 url would be
/api/v3/repos/cm/ultrasound/git/blobs/?access_token=...
but the default content type returns a json wrapper around the file content 
base64-encoding. The only way I could see to change the content type was by 
setting the accepted content type header. Since you've done the real GitHub 
integration perhaps you know of another way?

In any event, we're good for the time being -- no need to get this working 
for us.

And thanks, for ReviewBoard -- it's great.

Joe

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