Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 3933 by viney.ya...@gmail.com: Review post from Clearcase fails if the file versions are same
https://code.google.com/p/reviewboard/issues/detail?id=3933

*** READ THIS BEFORE POSTING!
***
*** You must complete this form in its entirety, or your bug report will be
*** rejected.
***
*** If you have a security issue to report, please send it confidentially
to
*** secur...@reviewboard.org. Posting security-related issues to this bug
*** tracker causes us to have to do an emergency release.
***
*** For customer support, please post to reviewbo...@googlegroups.com
***
*** If you have a patch, please submit it to
http://reviews.reviewboard.org/
***
*** This bug tracker is public. Please check that any logs or other
information
*** that you include has been stripped of confidential information.


What version are you running?
ReviewBoard-2.0.6, RBTool-0.6.2


What's the URL of the page containing the problem?
NA

What steps will reproduce the problem?
1. Post a review with same versions: rbt post file1.c@@/main/2:file1.c@@/main/2
2. rbt post throws error (see snapshot at the end)

What is the expected output? What do you see instead?
Review should be posted with empty diff. I understand that it does not make sense to explicitly post reviews with same versions. But there would be cases when: 1. Posting a diff with labels and both labels are on same version of the file 2. Posting a diff from a branch (brtype option) and the branch has only version 0 so empty diff.

What operating system are you using? What browser?
ReviewBoard server is on RHEL 6.5
RBT is on RHEL 6.5

Please provide any additional information below.
Looks like the server is unable to parse the diff file (which probably would be empty as the versions are same)

Traceback from server logs:

2015-07-29 07:13:39,847 - ERROR - None - user1- /api/review-requests/218/diffs/ - Error uploading new diff: u'origFile'
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/ReviewBoard-2.0.6-py2.6.egg/reviewboard/webapi/resources/diff.py", line 292, in create
    request.FILES.get('parent_diff_path'))
File "/usr/lib/python2.6/site-packages/ReviewBoard-2.0.6-py2.6.egg/reviewboard/reviews/forms.py", line 116, in create
    history)
File "/usr/lib/python2.6/site-packages/ReviewBoard-2.0.6-py2.6.egg/reviewboard/diffviewer/forms.py", line 69, in create
    request=self.request)
File "/usr/lib/python2.6/site-packages/ReviewBoard-2.0.6-py2.6.egg/reviewboard/diffviewer/managers.py", line 156, in create_from_upload
    save=save)
File "/usr/lib/python2.6/site-packages/ReviewBoard-2.0.6-py2.6.egg/reviewboard/diffviewer/managers.py", line 182, in create_from_data
    check_existence=(not parent_diff_file_contents)))
File "/usr/lib/python2.6/site-packages/ReviewBoard-2.0.6-py2.6.egg/reviewboard/diffviewer/managers.py", line 275, in _process_files
    for f in parser.parse():
File "/usr/lib/python2.6/site-packages/ReviewBoard-2.0.6-py2.6.egg/reviewboard/diffviewer/parser.py", line 55, in parse
    next_linenum, new_file = self.parse_change_header(i)
File "/usr/lib/python2.6/site-packages/ReviewBoard-2.0.6-py2.6.egg/reviewboard/diffviewer/parser.py", line 97, in parse_change_header
    linenum = self.parse_diff_header(linenum, info)
File "/usr/lib/python2.6/site-packages/ReviewBoard-2.0.6-py2.6.egg/reviewboard/scmtools/clearcase.py", line 356, in parse_diff_header
    currentFilename = info['origFile']
KeyError: u'origFile'


Traceback from rbt:

[user1@rbserver include]$ rbt post -d file1.c@@/main/2:file1.c@@/main/2
RBTools 0.6.2
Python 2.6.6 (r266:84292, Sep  4 2013, 07:46:00)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)]
Running on Linux-2.6.32-431.el6.x86_64-x86_64-with-redhat-6.5-Santiago
Home = /home/user1
Current directory = /cm_data/myvob/folder1
Checking for a ClearCase repository...
Running: cleartool pwv -short
Running: diff --version
Running: cleartool lsview -full -properties -cview
Running: cleartool describe -short vob:.
Running: cleartool pwv -root
repository info: Path: /cm_data/myvob, Base path: /cm_data/myvob, Supports changesets: False
Making HTTP GET request to http://rbserver/api/
Running: diff -uN file1.c@@/main/2 file1.c@@/main/2
Running: cleartool describe -fmt %On file1.c@@/main/2
Running: cleartool describe -fmt %On file1.c@@/main/2
Making HTTP GET request to http://rbserver/api/review-requests/
Making HTTP POST request to http://rbserver/api/review-requests/
Making HTTP GET request to http://rbserver/api/review-requests/218/diffs/ Making HTTP POST request to http://rbserver/api/review-requests/218/diffs/
Got API Error 105 (HTTP code 400): One or more fields had errors
Error data: {u'fields': {u'path': [u"u'origFile'"]}, u'stat': u'fail', u'err': {u'msg': u'One or more fields had errors', u'code': 105}}
Traceback (most recent call last):
  File "/usr/bin/rbt", line 9, in <module>
    load_entry_point('RBTools==0.6.2', 'console_scripts', 'rbt')()
File "/usr/lib/python2.6/site-packages/RBTools-0.6.2-py2.6.egg/rbtools/commands/main.py", line 134, in main
    command.run_from_argv([RB_MAIN, command_name] + args)
File "/usr/lib/python2.6/site-packages/RBTools-0.6.2-py2.6.egg/rbtools/commands/__init__.py", line 416, in run_from_argv
    exit_code = self.main(*args) or 0
File "/usr/lib/python2.6/site-packages/RBTools-0.6.2-py2.6.egg/rbtools/commands/post.py", line 784, in main
    submit_as=self.options.submit_as)
File "/usr/lib/python2.6/site-packages/RBTools-0.6.2-py2.6.egg/rbtools/commands/post.py", line 551, in post_request
    raise CommandError(u'\n'.join(error_msg))
rbtools.commands.CommandError: Error uploading diff


One or more fields had errors (HTTP 400, API Error 105)

    path: u'origFile'

Your review request still exists, but the diff is not attached.

http://rbserver/r/218/

[user1@rbserver include]$


--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups 
"reviewboard-issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard-issues+unsubscr...@googlegroups.com.
To post to this group, send email to reviewboard-issues@googlegroups.com.
Visit this group at http://groups.google.com/group/reviewboard-issues.
For more options, visit https://groups.google.com/d/optout.

Reply via email to