-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
Linux Ubuntu 20.04
Jenkins 2.303.1
Review Board plugin 1.2
Review Board 4.0.4
RBTools 2.0.1, installed system wide.
Python 3.8.10
A build is triggered from Review Board when a review request is posted. Jenkins then starts the build and retrives the diff from Review Board with RBTools and api token.
If I check "Download patch without applying" this works fine, but if unchecked it fails. Both commands work when run from cli on server. Writing patch to file works and patch.diff contains correct information:
[Playground_rrtb] $ rbt patch --api-token ******** --server https://tools.server.com/rb/ --diff-revision 1 --write patch.diff 33
But if I try to ley RBTools also apply the patch, the whole command fails:
[Playground_rrtb] $ rbt patch --api-token ******** --server https://tools.server.com/rb/ --diff-revision 1 33 usage: rbt patch [options] <review-request-id> rbt: error: Invalid number of arguments provided Build step 'Apply patch from Review Board' changed build result to FAILURE
Also, independent of the previous step, the plugin always fails to notify Review Board. When examening Review Board log files nothing is sent to Review Board after RBTools fetched the diff.
ERROR: Unable to notify Review Board of the build: Unhandled response code sent from Review Board: 405 ERROR: Unable to notify Review Board of the result of the build: Unhandled response code sent from Review Board: 405
The first problem comes from how the plugin splits the arguments to rbt on " ". When "–write patch.diff" is not present an extra space is inserted and this creates an extra empty argument to rbt.
The second problem comes from how the URL to review board is constructed. If getReviewBoardURL() contains a path (tools.server.com/rb/) then that last bit (/rb/) is striped before the relative path is added.
Both problems are resolved in the attached patch. I have also created a pull-request in the rb-plugin git repository.