Code review process

Newly created Patch entities (ie. 'new' draft changesets pushed to the repositories) are entering the review process in state "in-progress". You must explicitely ask for review via the web interface or via the web service.

We provide some tools to be able to ask review from your mercurial repository (by calling the web service) in logilab-devtool 0.23.

Here is how to set things up:

  • ensure you have ndg-httpsclient (https://pypi.python.org/pypi/ndg-httpsclient or apt-get install python-ndg-httpsclient)

  • ensure you have cwclientlib installed (https://www.cubicweb.org/project/cwclientlib or apt-get install python-cwclientlib)

  • ensure you have the hgext/jpl mercurial extension activated in your ~/.hgrc (provided by logilab-devtools)

  • ensure you have created an AuthToken (on each forge), eg. following these links

    https://www.logilabb.org/add/AuthToken https://www.cubicweb.org/add/AuthToken

    and be sure the "enabled" checkbox is activated. The AuthToken "id" is the identifier of the token and can be anything you want (eg. something like "<login> token") It will generate a secret token (named 'token')

  • add a section in the repository's .hg/hgrc:

    [lglb]
    forge-url = https://www.logilab.org/
    auth-mech = signedrequest
    auth-token = <login> token # the AuthToken 'id'
    auth-secret = <secret token> # the generated AuthToken 'token'
    

    or:

    [lglb]
    forge-url = https://www.cubicweb.org/
    auth-mech = signedrequest
    auth-token = <login> token # the AuthToken 'id'
    auth-secret = <secret token> # the generated AuthToken 'token'
    

Then you may be able to do stuff like:

$ hg show-review -r "draft() and ::."
https://www.logilab.org/277378  [pending-review]
[ureports] write unicode not bytes (closes #277372)

https://www.logilab.org/280886  [pending-review]
[pytest] fix TestSuite.run wrapper (closes #280806)

https://www.logilab.org/278874  [pending-review]
[deprecation] fix class_renamed() on old-style classes
$ hg ask-review -r 4c174136fcff
[OK]

or, to list comments and tasks reviewers may have attached to patches:

$ hg tasks -r "draft() and ::."

[date] Fix utcdatetime https://www.logilab.org/280798 (in-progress)

[TODO] no need for explicit inclusion of the pytz code here (https://www.logilab.org/280891)
juste depend on pytz and go

Note: one oddity with this new process is the fact that when you push a new draft changeset to the repository, you cannot ask review for it immediately, since the forge must first import this new changeset and create Patch from it. It's not very long (few 10s of seconds depending on the activity on the application), but...