Difference between revisions of "HOWTO control Rietveld patch generation"

From Nsnam
Jump to: navigation, search
(more hints for Rietveld)
(oath2 hint)
Line 1: Line 1:
 
{{TOC}}
 
{{TOC}}
 +
 +
== Password authentication errors ==
 +
 +
If you get this kind of error message when using upload.py:
 +
 +
  Traceback (most recent call last):
 +
  File "upload.py", line 2719, in <module>
 +
    main()
 +
  File "upload.py", line 2711, in main
 +
    RealMain(sys.argv)
 +
  File "upload.py", line 2667, in RealMain
 +
    response_body = rpc_server.Send("/upload", body, content_type=ctype)
 +
  File "upload.py", line 474, in Send
 +
    self._Authenticate()
 +
  File "upload.py", line 501, in _Authenticate
 +
    super(HttpRpcServer, self)._Authenticate()
 +
  File "upload.py", line 381, in _Authenticate
 +
    auth_token = self._GetAuthToken(credentials[0], credentials[1])
 +
  File "upload.py", line 335, in _GetAuthToken
 +
    e.headers, response_dict)
 +
  __main__.ClientLoginError: HTTP Error 403: Forbidden
 +
 +
You may need to pass the '--oauth2'' flag to upload.py and use browser-based authentication (due to Google authentication changes around mid-2015).
  
 
== Updating an existing code issue with an additional patch ==
 
== Updating an existing code issue with an additional patch ==

Revision as of 01:30, 12 June 2015

Main Page - Current Development - Developer FAQ - Tools - Related Projects - Project Ideas - Summer Projects

Installation - Troubleshooting - User FAQ - HOWTOs - Samples - Models - Education - Contributed Code - Papers

Password authentication errors

If you get this kind of error message when using upload.py:

 Traceback (most recent call last):
 File "upload.py", line 2719, in <module>
   main()
 File "upload.py", line 2711, in main
   RealMain(sys.argv)
 File "upload.py", line 2667, in RealMain
   response_body = rpc_server.Send("/upload", body, content_type=ctype)
 File "upload.py", line 474, in Send
   self._Authenticate()
 File "upload.py", line 501, in _Authenticate
   super(HttpRpcServer, self)._Authenticate()
 File "upload.py", line 381, in _Authenticate
   auth_token = self._GetAuthToken(credentials[0], credentials[1])
 File "upload.py", line 335, in _GetAuthToken
   e.headers, response_dict)
 __main__.ClientLoginError: HTTP Error 403: Forbidden

You may need to pass the '--oauth2 flag to upload.py and use browser-based authentication (due to Google authentication changes around mid-2015).

Updating an existing code issue with an additional patch

Assume that you initiated a code review and you would like to address comments from reviewers and update your code. You would like your new codereview patchset to be the union of the first and the second.

The first one was most likely uploaded by specifying the initial base changeset; e.g., if the base code is in revision 8954, and your patch for review in 8955, it would be like:

 $ python upload.py --rev=8954 --cc=ns-3-reviews@googlegroups.com
 Upload server: codereview.appspot.com (change with -s/--server)
 Loaded authentication cookies from /home/tomh/.codereview_upload_cookies
 New issue subject: replace src/mobility usage of RandomVariable with RandomVariableStream"
 Issue created. URL: http://codereview.appspot.com/6443113
 Uploading base file for src/mobility/model/gauss-markov-mobility-model.h
 Uploading base file for src/mobility/model/random-direction-2d-mobility-model.h
 Uploading base file for src/wimax/examples/wimax-multicast.cc

Let's assume that you fixed some things in revision 8956. The second upload needs to reference the original issue (6443113 in this example) and also to specify the original revision number (8954 in this example):

 $ python upload.py --rev=8954 --issue=6443113

Display different changesets as different patchsets

Assume that you have a repository with two changesets that you want reviewed as separate patchsets (i.e. you want Rietveld to preserve the changesets and not merge them into a single patch). See this code issue as an example: http://codereview.appspot.com/6443113

Assume that 8954 is the base, 8954:8955 is the first changeset, and 8955:8956 is the second changeset.

 changeset:   8956:208d6b79fa5d
 tag:         tip
 user:        Tom Henderson <tomh@tomh.org>
 date:        Fri Aug 10 14:37:46 2012 -0700
 summary:     Add AssignStreams support to mobility code
 
 changeset:   8955:38db106173a9
 user:        Tom Henderson <tomh@tomh.org>
 date:        Thu Aug 09 10:53:04 2012 -0700
 summary:     port mobility-related code to RandomVariableStream
 
 changeset:   8954:505e3a5b7c80
 user:        Tom Henderson <tomh@tomh.org>
 date:        Wed Aug 01 13:19:33 2012 -0700
 summary:     bug 1386:  assert if PositionAllocator not provided to RandomWaypointMobilityModel

The first one is uploaded by specifying the revisions explicitly:

 $ python upload.py --rev=8954:8955
 Upload server: codereview.appspot.com (change with -s/--server)
 Loaded authentication cookies from /home/tomh/.codereview_upload_cookies
 New issue subject: replace src/mobility usage of RandomVariable with RandomVariableStream"
 Issue created. URL: http://codereview.appspot.com/6443113
 Uploading base file for src/mobility/model/gauss-markov-mobility-model.h
 Uploading base file for src/mobility/model/random-direction-2d-mobility-model.h
 Uploading base file for src/wimax/examples/wimax-multicast.cc
 ...

For your second upload, specify the second revision, and identify the previous issue:

 $ python upload.py --rev=8955:8956 --issue=6443113
 Upload server: codereview.appspot.com (change with -s/--server)
 Loaded authentication cookies from /home/tomh/.codereview_upload_cookies
 Title describing this patch set: add AssignStreams
 Issue updated. URL: http://codereview.appspot.com/6443113
 Uploading base file for examples/routing/manet-routing-compare.cc
 Uploading base file for src/buildings/helper/building-position-allocator.cc
 Uploading base file for src/buildings/helper/building-position-allocator.h
 ...

Note that this is unlike the previous example in this HOWTO where we wanted 8954:8956 to be included.