3045: when updating new diff on existing reviews on reviewboard server in clearcase source file revision is not LATEST
- SetupIssue
- Review Board
akshaya.s*********@gmai***** (Google Code) (Is this you? Claim this profile.) | |
April 28, 2014 |
HI , We have base clearcase enviroment where in users works on branches and run post-review to upload the diff to reviewboard server and after getting reviewer comments ,they change the file again and update the diff "post-review -r old_existing_reviewId" which upload the new diff to reviewboard server . but the problem is when user updates the new diff ,the diff should be between the Integration branch latest with the user branch latest but post-review is uploading the diff between integration branch version during the first upload and dev branch latest version which is wrong .i.e source file revision should be dynamic instead of referring to old revision of Integraion branch of the first review .
Any comments ?...Please suggest any workaround or any fix for this problem .
Hi Akshaya, RBTools does not generate diff between /main/latest and /branch/latest. Diff is generated between /branch/latest and version just before /branch/0 Changes on other branches (e.g. latest) are not reflected in review. What you are looking for is "rebasing" your changes. You may also try to create two separate snapshost views: first for /main/latest and second for /branch/latest then generate diff using your home grown script. Design decision was dictated by way how Clear Case treat branched files.
HI Jan Thanks for your reply .Much appropriated . In our clearcase enviroment we rebase/merge our dev branch from Integration branch very often to avoid merge issue .since post-review diffing devbranch latest with /branch/0 changes ,the uploaded diff has users changes as well as merged changes which is not OK for us .As the diff should be only dev branch changes othewise owners will confused to know what the exact owners change . just wondering if postreview.py can modified to get diff between Integration branch LATEST and dev branch latest ? if its possible please let me know how to proceed .any fix in the same issues is there on latest RBtools scripts ? =================== I am facing another issue while uploading existing diff file using "post-review --diff-filename" from linux host .Our Rb server is LINUX rhel machine with RB version 1.6.3 .The review is getting created but the diff file is not getting uploaded from commandline post-review .I can upload the diff file from GUI to the appropriate review ID . Let me know if any specfic Server side configuration missing ? or where i can see the logs to know the exact problem .Please help . Error: ppreleng@lppc111.lss.emc.com:/vobs/ms-test 114 % post-review --diff-filename=d1.diff --server="https://ppsappdev02.isus.emc.com:443" -d >>> RBTools 0.4.1 >>> Home = /emc/ppreleng >>> HTTP GETting api/ >>> HTTP GETting https://ppsappdev02.isus.emc.com:443/api/info/ >>> Using the new web API >>> HTTP GETting https://ppsappdev02.isus.emc.com:443/api/repositories/ >>> HTTP GETting https://ppsappdev02.isus.emc.com:443/api/repositories/1/ >>> HTTP GETting https://ppsappdev02.isus.emc.com:443/api/repositories/1/info/ >>> HTTP GETting https://ppsappdev02.isus.emc.com:443/api/repositories/2/ >>> HTTP GETting https://ppsappdev02.isus.emc.com:443/api/repositories/2/info/ >>> HTTP GETting https://ppsappdev02.isus.emc.com:443/api/repositories/3/ >>> HTTP GETting https://ppsappdev02.isus.emc.com:443/api/repositories/3/info/ >>> Attempting to create review request on /view/ppreleng_reviewboardAdmin/vobs/ms-test for None >>> HTTP POSTing to https://ppsappdev02.isus.emc.com:443/api/review-requests/: {'repository': u'/view/ppreleng_reviewboardAdmin/vobs/ms-test'} >>> Review request created >>> Uploading diff, size: 27 >>> HTTP POSTing to https://ppsappdev02.isus.emc.com:443/api/review-requests/370/diffs/: {'basedir': u'/view/ppreleng_reviewboardAdmin/vobs/ms-test'} >>> Got API Error 105 (HTTP code 400): One or more fields had errors >>> Error data: {u'fields': {u'path': [u'The diff file is empty']}, u'stat': u'fail', u'err': {u'msg': u'One or more fields had errors', u'code': 105}} Error uploading diff The generated diff file was empty. This usually means no files were modified in this change. Try running with --output-diff and --debug for more information. Your review request still exists, but the diff is not attached.
HI Jan Thanks for your reply .Much appropriated . In our clearcase enviroment we rebase/merge our dev branch from Integration branch very often to avoid merge issue .since post-review diffing devbranch latest with /branch/0 changes ,the uploaded diff has users changes as well as merged changes which is not OK for us .As the diff should be only dev branch changes othewise owners will confused to know what the exact owners change . just wondering if postreview.py can modified to get diff between Integration branch LATEST and dev branch latest ? if its possible please let me know how to proceed .any fix in the same issues is there on latest RBtools scripts ? =================== I am facing another issue while uploading existing diff file using "post-review --diff-filename" from linux host .Our Rb server is LINUX rhel machine with RB version 1.6.3 .The review is getting created but the diff file is not getting uploaded from commandline post-review .I can upload the diff file from GUI to the appropriate review ID . Let me know if any specfic Server side configuration missing ? or where i can see the logs to know the exact problem .Please help . Error: ppreleng@lppc111.lss.emc.com:/vobs/ms-test 114 % post-review --diff-filename=d1.diff --server="https://ppsappdev02.isus.emc.com:443" -d https://ppsappdev02.isus.emc.com:443/api/repositories/1/info/ https://ppsappdev02.isus.emc.com:443/api/repositories/2/info/ https://ppsappdev02.isus.emc.com:443/api/repositories/3/info/ /view/ppreleng_reviewboardAdmin/vobs/ms-test for None https://ppsappdev02.isus.emc.com:443/api/review-requests/: {'repository': u'/view/ppreleng_reviewboardAdmin/vobs/ms-test'} https://ppsappdev02.isus.emc.com:443/api/review-requests/370/diffs/: {'basedir': u'/view/ppreleng_reviewboardAdmin/vobs/ms-test'} u'stat': u'fail', u'err': {u'msg': u'One or more fields had errors', u'code': 105}} Error uploading diff The generated diff file was empty. This usually means no files were modified in this change. Try running with --output-diff and --debug for more information. Your review request still exists, but the diff is not attached.
Hi jan , Please help me ,atleast give some pointer to fix both this issue .
Any comments ?...Please suggest any workaround or any fix for issue while uploading existing diff file using "post-review --diff-filename" from linux host . anybody has ever come across this issue .
Hi everyone, Regarding your first issue. IIf you will have any patch adding such functionality into rbtools I will be happy to review it :) and help add to the code base. Personally I'm not able to do that as far I do not have access to clearcase anymore. However as far I can remember I though about such implementation and there was a reason why it was impossible. I'm not sure right now but there was cornercases or some limitations of accessing necessary data. Regarding your second issue. Diffs generated by rbtools are not regular diffs, but contains some additional information (oid-s to be more specific) which are necessary to work. Diff without them will not work.
Adding this issue rather opening a new one. When trying to update an existing review with ClearCase changes while the file is checkedout I'm getting the following output: =================================================================================== post-review -r "134" --debug >>> RBTools 0.5.2 >>> Python 2.6.6 (r266:84292, Jun 18 2012, 14:18:47) [GCC 4.4.6 20110731 (Red Hat 4.4.6-3)] >>> Running on Linux-2.6.32-279.el6.x86_64-x86_64-with-centos-6.3-Final >>> Home = /users/saarn >>> Current Directory = /vobs/build >>> Checking the repository type. Errors shown below are mostly harmless. DEBUG:root:Checking for a Subversion repository... DEBUG:root:Running: svn info build --non-interactive DEBUG:root:Command exited with rc 1: ['svn', 'info', 'build', '--non-interactive'] svn: '.' is not a working copy --- DEBUG:root:Checking for a Git repository... DEBUG:root:Running: git rev-parse --git-dir DEBUG:root:Command exited with rc 128: ['git', 'rev-parse', '--git-dir'] fatal: Not a git repository (or any of the parent directories): .git --- DEBUG:root:Checking for a Mercurial repository... DEBUG:root:Checking for a CVS repository... DEBUG:root:Checking for a Perforce repository... DEBUG:root:Checking for a Plastic repository... DEBUG:root:Checking for a ClearCase repository... DEBUG:root:Running: cleartool pwv -short DEBUG:root:Running: diff --version DEBUG:root:Running: cleartool lsview -full -properties -cview DEBUG:root:Running: cleartool describe -short vob:. DEBUG:root:Running: cleartool pwv -root DEBUG:root:repository info: Path: /vobs/build, Base path: /vobs/build, Supports changesets: False >>> Finished checking the repository type. >>> HTTP GETting api/info/ DEBUG:root:Running: cleartool lscheckout -all -cview -me -fmt %En\t%PVn\t%Vn\n DEBUG:root:Running: diff -uN /vobs/build/tst/file@@/main/fortis/hamsa/izabo/TestReviewBoard/2 /vobs/build/tst/file DEBUG:root:Command exited with rc 1: ['diff', '-uN', '/vobs/build/tst/file@@/main/fortis/hamsa/izabo/TestReviewBoard/2', '/vobs/build/tst/file'] --- /vobs/build/tst/file@@/main/fortis/hamsa/izabo/TestReviewBoard/2 2014-02-17 16:26:24.154092000 +0200 +++ /vobs/build/tst/file 2014-02-17 16:39:23.611353000 +0200 @@ -31,3 +31,17 @@ fsdfsdsdfsdf + + + +34 +32 +4 +234 +23 +4 +324 +32 +4 +23 +added by saar to test updating existing review --- DEBUG:root:Running: cleartool describe -fmt %On /vobs/build/tst/file@@/main/fortis/hamsa/izabo/TestReviewBoard/2 DEBUG:root:Running: cleartool describe -fmt %On /vobs/build/tst/file >>> HTTP GETting api/ >>> HTTP GETting http://review-board/api/info/ >>> Using the new web API >>> HTTP GETting http://review-board/api/review-requests/134/ DEBUG:root:Running: cleartool lsvob -long /vobs/build DEBUG:root:Repository's /vobs/build uuid is '87701b00.c21e11d5.b323.00:e0:18:1c:4c:3b' >>> HTTP GETting http://review-board/api/repositories/ >>> HTTP GETting http://review-board/api/repositories/4/ >>> HTTP GETting http://review-board/api/repositories/4/info/ DEBUG:root:Matching repository uuid:87701b00.c21e11d5.b323.00:e0:18:1c:4c:3b with path:/view/izabo-ReviewBoard/vobs/build DEBUG:root:repository info: Path: /view/izabo-ReviewBoard/vobs/build, Base path: /view/izabo-ReviewBoard/vobs/build, Supports changesets: False >>> Uploading diff, size: 388 >>> HTTP POSTing to http://review-board/api/review-requests/134/diffs/: {'basedir': u'/view/izabo-ReviewBoard/vobs/build'} Review request #134 posted. http://review-board/r/134/ ==================================================================================== When checking-in the file and running the following command I'm getting the following output: ==================================================================================== post-review -r "134" --revision-range "/view/izabo.TestReviewBoard-saarn/vobs/build/tst/file@@/main/fortis/hamsa/izabo/TestReviewBoard/2;/view/izabo.TestReviewBoard-saarn/vobs/build/tst/file@@/main/fortis/hamsa/izabo/TestReviewBoard/3" --debug >>> RBTools 0.5.2 >>> Python 2.6.6 (r266:84292, Jun 18 2012, 14:18:47) [GCC 4.4.6 20110731 (Red Hat 4.4.6-3)] >>> Running on Linux-2.6.32-279.el6.x86_64-x86_64-with-centos-6.3-Final >>> Home = /users/saarn >>> Current Directory = /vobs/build/tst >>> Checking the repository type. Errors shown below are mostly harmless. DEBUG:root:Checking for a Subversion repository... DEBUG:root:Running: svn info build --non-interactive DEBUG:root:Command exited with rc 1: ['svn', 'info', 'build', '--non-interactive'] svn: '.' is not a working copy --- DEBUG:root:Checking for a Git repository... DEBUG:root:Running: git rev-parse --git-dir DEBUG:root:Command exited with rc 128: ['git', 'rev-parse', '--git-dir'] fatal: Not a git repository (or any of the parent directories): .git --- DEBUG:root:Checking for a Mercurial repository... DEBUG:root:Checking for a CVS repository... DEBUG:root:Checking for a Perforce repository... DEBUG:root:Checking for a Plastic repository... DEBUG:root:Checking for a ClearCase repository... DEBUG:root:Running: cleartool pwv -short DEBUG:root:Running: diff --version DEBUG:root:Running: cleartool lsview -full -properties -cview DEBUG:root:Running: cleartool describe -short vob:. DEBUG:root:Running: cleartool pwv -root DEBUG:root:repository info: Path: /vobs/build, Base path: /vobs/build, Supports changesets: False >>> Finished checking the repository type. >>> HTTP GETting api/info/ DEBUG:root:Running: diff -uN /view/izabo.TestReviewBoard-saarn/vobs/build/tst/file@@/main/fortis/hamsa/izabo/TestReviewBoard/2 /view/izabo.TestReviewBoard-saarn/vobs/build/tst/file@@/main/fortis/hamsa/izabo/TestReviewBoard/3 DEBUG:root:Command exited with rc 1: ['diff', '-uN', '/view/izabo.TestReviewBoard-saarn/vobs/build/tst/file@@/main/fortis/hamsa/izabo/TestReviewBoard/2', '/view/izabo.TestReviewBoard-saarn/vobs/build/tst/file@@/main/fortis/hamsa/izabo/TestReviewBoard/3'] --- /view/izabo.TestReviewBoard-saarn/vobs/build/tst/file@@/main/fortis/hamsa/izabo/TestReviewBoard/2 2014-02-17 16:26:24.154092000 +0200 +++ /view/izabo.TestReviewBoard-saarn/vobs/build/tst/file@@/main/fortis/hamsa/izabo/TestReviewBoard/3 2014-02-17 16:48:20.451286000 +0200 @@ -31,3 +31,17 @@ fsdfsdsdfsdf + + + +34 +32 +4 +234 +23 +4 +324 +32 +4 +23 +added by saar to test updating existing review --- DEBUG:root:Running: cleartool describe -fmt %On /view/izabo.TestReviewBoard-saarn/vobs/build/tst/file@@/main/fortis/hamsa/izabo/TestReviewBoard/2 DEBUG:root:Running: cleartool describe -fmt %On /view/izabo.TestReviewBoard-saarn/vobs/build/tst/file@@/main/fortis/hamsa/izabo/TestReviewBoard/3 >>> HTTP GETting api/ >>> HTTP GETting http://review-board/api/info/ >>> Using the new web API >>> HTTP GETting http://review-board/api/review-requests/134/ DEBUG:root:Running: cleartool lsvob -long /vobs/build DEBUG:root:Repository's /vobs/build uuid is '87701b00.c21e11d5.b323.00:e0:18:1c:4c:3b' >>> HTTP GETting http://review-board/api/repositories/ >>> HTTP GETting http://review-board/api/repositories/4/ >>> HTTP GETting http://review-board/api/repositories/4/info/ DEBUG:root:Matching repository uuid:87701b00.c21e11d5.b323.00:e0:18:1c:4c:3b with path:/view/izabo-ReviewBoard/vobs/build DEBUG:root:repository info: Path: /view/izabo-ReviewBoard/vobs/build, Base path: /view/izabo-ReviewBoard/vobs/build, Supports changesets: False >>> Uploading diff, size: 498 >>> HTTP POSTing to http://review-board/api/review-requests/134/diffs/: {'basedir': u'/view/izabo-ReviewBoard/vobs/build'} Review request #134 posted. http://review-board/r/134/ ==================================================================================== In both cases, the review 134 is not updated with the changes (see attached screen shot) it is looking at Revision /main/fortis/hamsa/izabo/TestReviewBoard/1 against the new changes, while there are already revisions 2 and 3 Is this a bug or am I doing something wrong?
-
+
In re: the latest comment, your screenshot doesn't include the header, so one fairly obvious question I should ask is: are you logged in to the site? Your post-review commands look like they're uploading a diff of the revisions you'd expect, which would create a draft on the review request. Other users (or anonymous/not-logged-in users) will see the old diff until that draft is published.
I am logged in (my user is also admin and member of all the review groups) I can see the uploaded revisions in the files diff administration screen, but they are not attached or shown in the review request itself which showing only the first diff loaded and not being updated with the latest diff.
This is what I have found: The new diff is on the server, however, it doesn't have the "Diff Set History" number and also missing the Commit ID. Once I have manually added them both it appearing in the review. Any pointers why it is not being set during the diff update? Could this be a matter of Configuration or Permissions?
When post-review/rbt post uploads a new diff, it creates a ReviewRequestDraft and associates the diff with that. It won't be associated with the DiffSetHistory until that draft is published. I really think that your post-review is uploading as a different user than you are logged in as. Try removing ~/.post-review-cookies.txt and ~/.rbtools-cookies and running the post command again. It should ask you to log in.
I have tried what you have suggested. I have created a new review and published it. The I have deleted the files ~/.post-review-cookies.txt and ~/.rbtools-cookies When ran the update it is loading the diff but not showing it in the review request. This is the command output: ======================================================================================= post-review -r "140" --revision-range "/view/izabo.TestReviewBoard-saarn/vobs/build/tst/file@@/main/fortis/hamsa/izabo/TestReviewBoard/4;/view/izabo.TestReviewBoard-saarn/vobs/build/tst/file@@/main/fortis/hamsa/izabo/TestReviewBoard/5" --debug >>> RBTools 0.5.2 >>> Python 2.6.6 (r266:84292, Sep 11 2012, 08:34:23) [GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] >>> Running on Linux-2.6.32-220.el6.x86_64-x86_64-with-centos-6.2-Final >>> Home = /users/saarn >>> Current Directory = /vobs/build >>> Checking the repository type. Errors shown below are mostly harmless. DEBUG:root:Checking for a Subversion repository... DEBUG:root:Running: svn info build --non-interactive DEBUG:root:Command exited with rc 1: ['svn', 'info', 'build', '--non-interactive'] svn: '.' is not a working copy --- DEBUG:root:Checking for a Git repository... DEBUG:root:Running: git rev-parse --git-dir DEBUG:root:Command exited with rc 128: ['git', 'rev-parse', '--git-dir'] fatal: Not a git repository (or any of the parent directories): .git --- DEBUG:root:Checking for a Mercurial repository... DEBUG:root:Checking for a CVS repository... DEBUG:root:Checking for a Perforce repository... DEBUG:root:Checking for a Plastic repository... DEBUG:root:Checking for a ClearCase repository... DEBUG:root:Running: cleartool pwv -short DEBUG:root:Running: diff --version DEBUG:root:Running: cleartool lsview -full -properties -cview DEBUG:root:Running: cleartool describe -short vob:. DEBUG:root:Running: cleartool pwv -root DEBUG:root:repository info: Path: /vobs/build, Base path: /vobs/build, Supports changesets: False >>> Finished checking the repository type. >>> HTTP GETting api/info/ ==> HTTP Authentication Required Enter authorization information for "Web API" at review-board Username: builder Password: DEBUG:root:Running: diff -uN /view/izabo.TestReviewBoard-saarn/vobs/build/tst/file@@/main/fortis/hamsa/izabo/TestReviewBoard/4 /view/izabo.TestReviewBoard-saarn/vobs/build/tst/file@@/main/fortis/hamsa/izabo/TestReviewBoard/5 DEBUG:root:Command exited with rc 1: ['diff', '-uN', '/view/izabo.TestReviewBoard-saarn/vobs/build/tst/file@@/main/fortis/hamsa/izabo/TestReviewBoard/4', '/view/izabo.TestReviewBoard-saarn/vobs/build/tst/file@@/main/fortis/hamsa/izabo/TestReviewBoard/5'] --- /view/izabo.TestReviewBoard-saarn/vobs/build/tst/file@@/main/fortis/hamsa/izabo/TestReviewBoard/4 2014-02-20 08:39:28.000000000 +0200 +++ /view/izabo.TestReviewBoard-saarn/vobs/build/tst/file@@/main/fortis/hamsa/izabo/TestReviewBoard/5 2014-02-20 08:42:33.000000000 +0200 @@ -47,3 +47,5 @@ added by saar to test updating existing review another diff first post + +This is the new line to be updated --- DEBUG:root:Running: cleartool describe -fmt %On /view/izabo.TestReviewBoard-saarn/vobs/build/tst/file@@/main/fortis/hamsa/izabo/TestReviewBoard/4 DEBUG:root:Running: cleartool describe -fmt %On /view/izabo.TestReviewBoard-saarn/vobs/build/tst/file@@/main/fortis/hamsa/izabo/TestReviewBoard/5 >>> HTTP GETting api/ >>> HTTP GETting http://review-board/api/info/ >>> Using the new web API >>> HTTP GETting http://review-board/api/review-requests/140/ DEBUG:root:Running: cleartool lsvob -long /vobs/build DEBUG:root:Repository's /vobs/build uuid is '87701b00.c21e11d5.b323.00:e0:18:1c:4c:3b' >>> HTTP GETting http://review-board/api/repositories/ >>> HTTP GETting http://review-board/api/repositories/4/ >>> HTTP GETting http://review-board/api/repositories/4/info/ DEBUG:root:Matching repository uuid:87701b00.c21e11d5.b323.00:e0:18:1c:4c:3b with path:/view/izabo-ReviewBoard/vobs/build DEBUG:root:repository info: Path: /view/izabo-ReviewBoard/vobs/build, Base path: /view/izabo-ReviewBoard/vobs/build, Supports changesets: False >>> Uploading diff, size: 499 >>> HTTP POSTing to http://review-board/api/review-requests/140/diffs/: {'basedir': u'/view/izabo-ReviewBoard/vobs/build'} Review request #140 posted. http://review-board/r/140/ ==================================================================================== Screenshot 1: The status of the review request AFTER the update Screenshot 2+3+4: The file diff in the Admin screen Screenshot 5: The review request after I have added the "Diff Set History" and "Commit ID" manually to the diff set. Also, the Parent Diff HASH was also empty and I had to set it as well
-
+ + + + +
Also, as I mentioned before: After you do the post, the DiffSet will be associated with a ReviewRequestDraft, and not the DiffSetHistory. Once that draft is published, it will associate the DiffSet with the DiffSetHistory. Drafts are *only* visible to the user who created them. If you want to make the new diff immediately visible to other users, you can add the --publish option to the command line. The commit ID and parent diff hash have absolutely nothing to do with any of this, and setting the parent diff can break stuff.
Thanks Allot :-) Adding the --publish did the trick :-)