Upload a review on rietveld

90 views
Skip to first unread message

Sergi Almacellas Abellana

unread,
Nov 11, 2015, 3:52:46 AM11/11/15
to tryto...@googlegroups.com
Hi,

I was tryting to upload a code review using hgreview as usual but each
time i try to login i get a 404 error. I've seen that hgreview now
suports Oauth2 [1], so I tried using Oauth 2.0, but when login in the
webbrowser i get the following error:

Error: redirect_uri_mismatch

Application: Tryton

You can email the developer of this application at: (Cédric email here)

The redirect URI in the request:
https://tryton-rietveld.appspot.com/oauth2callback did not match a
registered redirect URI.

Has anyone managed to make hgreview work with Oauth2.0? If now, how you
manage to login from hgreview on rietveld?

Thanks in advance for your help.

[1]
https://bitbucket.org/nicoe/hgreview/commits/01b75e693c912709fc9fcc26c3822dcf78adce32
--
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk

Raimon Esteve

unread,
Nov 12, 2015, 4:44:45 AM11/12/15
to tryto...@googlegroups.com
2015-11-11 9:52 GMT+01:00 Sergi Almacellas Abellana <se...@koolpi.com>:
> I was tryting to upload a code review using hgreview as usual but each time
> i try to login i get a 404 error.

There are other people get same error 404:

https://bugs.tryton.org/msg23107

I think is a good moment to talk in TUBA an easy tool to upload
reviews. I know other people have problems to publish reviews at
https://tryton-rietveld.appspot.com and hgreview.

--
Raimon

Cédric Krier

unread,
Nov 12, 2015, 5:45:07 AM11/12/15
to tryto...@googlegroups.com
On 2015-11-11 09:52, Sergi Almacellas Abellana wrote:
> Hi,
>
> I was tryting to upload a code review using hgreview as usual but each time
> i try to login i get a 404 error. I've seen that hgreview now suports Oauth2
> [1], so I tried using Oauth 2.0, but when login in the webbrowser i get the
> following error:
>
> Error: redirect_uri_mismatch
>
> Application: Tryton
>
> You can email the developer of this application at: (Cédric email here)
>
> The redirect URI in the request:
> https://tryton-rietveld.appspot.com/oauth2callback did not match a
> registered redirect URI.
>
> Has anyone managed to make hgreview work with Oauth2.0? If now, how you
> manage to login from hgreview on rietveld?

Yes :-)
It is required to use oauth2 with our rietveld instance because Google
dropped the support of plain login.

So your hgrc should have at least this options:

[review]
oauth2 = true


Also the process for oauth2 with hgreview/upload.py is a little bit
complex because the command opens a browser window to get the oauth2
token with your browser session and after that is redirected to a
localhost server run by the hgreview/upload.py to receive the token.
So this local server should be allowed to run and your browser should
follow the redirect.
Otherwise you can just copy the url the command line print and paste
back the token you receive.

--
Cédric Krier - B2CK SPRL
Email/Jabber: cedric...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

Sergi Almacellas Abellana

unread,
Nov 12, 2015, 6:00:58 AM11/12/15
to tryto...@googlegroups.com
El 12/11/15 a les 11:44, Cédric Krier ha escrit:
Yes, I have tryied this option and with nowebbroswer, but after loggin
in I've se a web page with the following error:

Application: Tryton

You can email the developer of this application at: cedric...@b2ck.com

The redirect URI in the request:
https://tryton-rietveld.appspot.com/oauth2callback did not match a
registered redirect URI.

What am I missing?



Learn more

Cédric Krier

unread,
Nov 12, 2015, 6:55:04 AM11/12/15
to tryto...@googlegroups.com
I think this is related:
https://stackoverflow.com/questions/20732266/authenticate-with-google-oauth-2-0-did-not-match-a-registered-redirect-uri

You should register the local redirect on your Google account

Sergi Almacellas Abellana

unread,
Nov 12, 2015, 7:22:44 AM11/12/15
to tryto...@googlegroups.com
El 12/11/15 a les 12:51, Cédric Krier ha escrit:
>> The redirect URI in the request:
>> >https://tryton-rietveld.appspot.com/oauth2callback did not match a
>> >registered redirect URI.
>> >
>> >What am I missing?
> I think this is related:
> https://stackoverflow.com/questions/20732266/authenticate-with-google-oauth-2-0-did-not-match-a-registered-redirect-uri
>
> You should register the local redirect on your Google account
After going to https://cloud.google.com/console as the link suggested i
can not edit anything because I got a message that says: "Only project
editors can create credentials"


BTW, this is due that we are still ussing the google codereview, using a
rietvield installation will allow us to not use oauth2? (and so ease the
codereview process)

Cédric Krier

unread,
Nov 12, 2015, 10:32:49 AM11/12/15
to tryto...@googlegroups.com
On 2015-11-12 13:22, Sergi Almacellas Abellana wrote:
> El 12/11/15 a les 12:51, Cédric Krier ha escrit:
> >>The redirect URI in the request:
> >>>https://tryton-rietveld.appspot.com/oauth2callback did not match a
> >>>registered redirect URI.
> >>>
> >>>What am I missing?
> >I think this is related:
> >https://stackoverflow.com/questions/20732266/authenticate-with-google-oauth-2-0-did-not-match-a-registered-redirect-uri
> >
> >You should register the local redirect on your Google account
> After going to https://cloud.google.com/console as the link suggested i can
> not edit anything because I got a message that says: "Only project editors
> can create credentials"

OK, I checked and added:
https://tryton-rietveld.appspot.com/oauth2callback

Could you test if it works for you now.

> BTW, this is due that we are still ussing the google codereview, using a
> rietvield installation will allow us to not use oauth2? (and so ease the
> codereview process)

Yes, we depend on Google policy.

Sergi Almacellas Abellana

unread,
Nov 12, 2015, 10:41:45 AM11/12/15
to tryto...@googlegroups.com
El 12/11/15 a les 16:32, Cédric Krier ha escrit:
> On 2015-11-12 13:22, Sergi Almacellas Abellana wrote:
>> >El 12/11/15 a les 12:51, Cédric Krier ha escrit:
>>>> > >>The redirect URI in the request:
>>>>> > >>>https://tryton-rietveld.appspot.com/oauth2callback did not match a
>>>>> > >>>registered redirect URI.
>>>>> > >>>
>>>>> > >>>What am I missing?
>>> > >I think this is related:
>>> > >https://stackoverflow.com/questions/20732266/authenticate-with-google-oauth-2-0-did-not-match-a-registered-redirect-uri
>>> > >
>>> > >You should register the local redirect on your Google account
>> >After going tohttps://cloud.google.com/console as the link suggested i can
>> >not edit anything because I got a message that says: "Only project editors
>> >can create credentials"
> OK, I checked and added:
> https://tryton-rietveld.appspot.com/oauth2callback
>
> Could you test if it works for you now.
>
That solved the problem for me, so i can login using oauth2

Thanks.


>> >BTW, this is due that we are still ussing the google codereview, using a
>> >rietvield installation will allow us to not use oauth2? (and so ease the
>> >codereview process)
> Yes, we depend on Google policy.
:(

Raimon Esteve

unread,
Dec 4, 2015, 9:29:15 AM12/4/15
to tryto...@googlegroups.com
2015-11-12 16:32 GMT+01:00 Cédric Krier <cedric...@b2ck.com>:
> [review]
> oauth2 = true

Added
Sorry, an error occurred...
Unhandled exception.
Details: No code was supplied in the query parameters. [FlowExchangeError]

Maybe I forget a step to try upload reviews? Is there how to
configuration guide for dummies? (I know other people can't upload
codereviews)

IMHO codereview tool is difficut to configure/use more people like to
contribute at Tryton project. It's not easy tool unless Google policy
change it.

Raimon

Cédric Krier

unread,
Dec 4, 2015, 9:40:03 AM12/4/15
to tryto...@googlegroups.com
On 2015-12-04 15:29, Raimon Esteve wrote:
> 2015-11-12 16:32 GMT+01:00 Cédric Krier <cedric...@b2ck.com>:
> > [review]
> > oauth2 = true
>
> Added
>
> > OK, I checked and added:
> > https://tryton-rietveld.appspot.com/oauth2callback
>
> Sorry, an error occurred...
> Unhandled exception.
> Details: No code was supplied in the query parameters. [FlowExchangeError]

Probably your browser is not logged.

Raimon Esteve

unread,
Dec 8, 2015, 6:58:20 PM12/8/15
to tryto...@googlegroups.com
2015-12-04 15:35 GMT+01:00 Cédric Krier <cedric...@b2ck.com>:
> On 2015-12-04 15:29, Raimon Esteve wrote:
>> 2015-11-12 16:32 GMT+01:00 Cédric Krier <cedric...@b2ck.com>:
>> > [review]
>> > oauth2 = true
>>
>> Added
>>
>> > OK, I checked and added:
>> > https://tryton-rietveld.appspot.com/oauth2callback
>>
>> Sorry, an error occurred...
>> Unhandled exception.
>> Details: No code was supplied in the query parameters. [FlowExchangeError]
>
> Probably your browser is not logged.

.... and how to do it? (in command?)

Thanks

Rai

Karla Stenger

unread,
Dec 8, 2015, 7:09:44 PM12/8/15
to tryto...@googlegroups.com


Login in your browser with the Google account you're using in rietveld, leave the browser open and retry the command.

Hope it helps

--

--
Karla M. Stenger Sábat

Raimon Esteve

unread,
Dec 9, 2015, 1:10:59 PM12/9/15
to tryto...@googlegroups.com
Doesn't work

1- My ~/.hgrc file:

[review]
oauth2 = true
username = res...@zikzakmedia.com
server = https://tryton-rietveld.appspot.com
send_email = True

2. Open Firrfox and Chrome (both!) and login in:

https://tryton-rietveld.appspot.com/

3- Run command to publish a codereview

resteve@canigo:~/virtualenv/codereview/sale$ hg review -m "sale:
browse product when party lang is different than user lang"
Server used https://tryton-rietveld.appspot.com
Password for res...@zikzakmedia.com:
abort: HTTP Error 404: Not Found

Thanks

Sergi Almacellas Abellana

unread,
Dec 9, 2015, 2:19:23 PM12/9/15
to tryto...@googlegroups.com, Raimon Esteve
It seeems you're not using the latest version from source code. As oauth suport is not yet realeased in any version.

When using the correct version, the browser should open (and ask login if needed) we running the upload command.

Hope it helps!
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.

Raimon Esteve

unread,
Dec 9, 2015, 2:33:08 PM12/9/15
to Sergi Almacellas Abellana, tryto...@googlegroups.com
Eureka!!! It is! Upgraded hgreview to version 0.4.

After hg review command, open a new window browser to loggin.

Thanks

Rai

Cédric Krier

unread,
Dec 9, 2015, 9:05:15 PM12/9/15
to tryto...@googlegroups.com
On 2015-12-09 19:10, Raimon Esteve wrote:
Update your hgreview!
Reply all
Reply to author
Forward
0 new messages