Rolling out Review Board

46 views
Skip to first unread message

Raghu Kaippully

unread,
Apr 16, 2009, 9:57:53 AM4/16/09
to revie...@googlegroups.com
Hi,

I have been evaluating review board to see if we can use it within our organization for code reviews. The initial reaction was very good and we are nearing the end of a pilot phase where we'll roll this out to a large number of users. I had a couple of questions:

1. Our development/build environment is perl based and nobody has python installed in their machines. This is going to make it hard for installing post-review. Has somebody thought about creating an installer that  bundles python, setuptools, all required modules, and post-review into one package? I tried creating a Windows installer using NSIS and found it quite simple. Can I conribute that to review board?

2. Is there a way to bulk-load all users and groups into the database? If we do not do that a requester will not be able to add a reviewer in the review request till the reviewer has logged in at least once.

Thanks in advance for the help,
Raghu

David Ball

unread,
Apr 16, 2009, 10:24:55 AM4/16/09
to revie...@googlegroups.com
Raghu,

I can't help with bulk user loading, but on item 1....

Once you have a working installation of post-review, you can use the
py2exe to create a windows executable which can be distributed to
staff (I'm assuming your users are working under windows).

I couldn't find a detailed explanation in the ReviewBoard archive, so
here's a step-by-step of how I did it (Windows XP Pro SP3, Python
2.5.4, Review Board 1.0 alpha 2)

1) Take as your starting point a working post-review.py script on a
Windows machine.

2) Download the py2exe package "py2exe-0.6.9.win32-py2.5.exe" from
http://sourceforge.net/project/showfiles.php?group_id=15583 and
install. (I assume you can use easy_install instead, but I can't make
it work with our web proxy)

3) Make sure there are no ".egg" files in the Python site-packages
folder (C:\Python25\Lib\site-packages). These are zipped and py2exe
can't handle them. They must be unzipped into folders of the same
name. If there are do the following:
3a) Rename by adding a ".zip" extension after the ".egg" extension.
3b) Unzip the extension to a folder with the same name as the
original ".egg" file.

4) In the same folder as post-review.py create a setup.py script
containing exactly the lines below. This will use py2exe to generate
the executable:

from distutils.core import setup
import py2exe

setup(
options = {'py2exe': {'bundle_files': 1}},
console = ['post-review.py'],
zipfile = None,
)

5) Run the setup.py script:
prompt> python setup.py py2exe

6) The distributable package (comprising two exes and a DLL) can be
found in the new dist/ subdirectory.
The dist folder contents can be copied to client PCs. The
post-review.exe program works in exactly the same way as the original
python script it was generated from.

7) post-review requires GNU diff (at least it does when you're using
Perforce as I am). Download the GnuWin32 package
"diffutils-2.8.7-1.exe" from
http://gnuwin32.sourceforge.net/packages/diffutils.htm

8) Run the diffutils installer. Accept the default options except
where prompted for documentation, which should be deselected as not
required.

9) Copy the following files from C:\Program Files\GnuWin32\bin to the
post-review dist/ subdirectory:
diff.exe
libiconv2.dll
libintl3.dll

10) Rename the dist/ folder to something descriptive, then ZIP it up
and distribute to users - alternatively, I was able to build a simple
Windows installer at no cost using NSIS and HM NIS Edit.

David

Raghu

unread,
Apr 16, 2009, 10:44:27 AM4/16/09
to reviewboard
David,

Thank you so much for taking time to write this down. I had initially
tried py2exe and then abandoned it because of problems with .egg
files. I definitely will try this out, but given the extensive use of
perl in our organization, we may end up porting this to perl.

I believe this information should definitely be included in the
documentation/wiki. It'll help a lot of early adopters.

Thanks again,
Raghu
> "diffutils-2.8.7-1.exe" fromhttp://gnuwin32.sourceforge.net/packages/diffutils.htm
>
> 8) Run the diffutils installer. Accept the default options except
> where prompted for documentation, which should be deselected as not
> required.
>
> 9) Copy the following files from C:\Program Files\GnuWin32\bin to the
> post-review dist/ subdirectory:
>         diff.exe
>         libiconv2.dll
>         libintl3.dll
>
> 10) Rename the dist/ folder to something descriptive, then ZIP it up
> and distribute to users - alternatively, I was able to build a simple
> Windows installer at no cost using NSIS and HM NIS Edit.
>
> David
>

David B

unread,
Apr 16, 2009, 11:20:20 AM4/16/09
to reviewboard
I should add, for my distribution I also copied the GNU licence text
from the diffutils installer into a text file and included it in my
dist/ folder - although I was only testing this build process and not
actually distributing my package I wanted to make sure I followed the
rules in case it should ever be passed around within or outside our
company.
> "diffutils-2.8.7-1.exe" fromhttp://gnuwin32.sourceforge.net/packages/diffutils.htm
>
> 8) Run the diffutils installer. Accept the default options except
> where prompted for documentation, which should be deselected as not
> required.
>
> 9) Copy the following files from C:\Program Files\GnuWin32\bin to the
> post-review dist/ subdirectory:
>         diff.exe
>         libiconv2.dll
>         libintl3.dll
>
> 10) Rename the dist/ folder to something descriptive, then ZIP it up
> and distribute to users - alternatively, I was able to build a simple
> Windows installer at no cost using NSIS and HM NIS Edit.
>
> David
>

Anverc

unread,
Apr 16, 2009, 8:28:54 PM4/16/09
to reviewboard
If you happen to be using subversion, I have created a csharp post
review app that integrates into explorer nicely. I'll open source it
soon as I get a chance to clean the code up and stub out future vc
functionality. You can try the binary out by downloading from
blog.bennyland.com. (I'd give you the exact link but I'm on my phone
right now.. It's one of the last 3 posts though)

Noam

unread,
Apr 22, 2009, 4:13:30 PM4/22/09
to reviewboard
Thanks Anverc,
I downloaded and installed the C-Sharp Post-Review App, its absolutely
wonderful. However, I am getting an error "Adding Diff to Review
Board Failed". Any ideas?
- Noam

Anverc

unread,
Apr 23, 2009, 9:22:55 AM4/23/09
to reviewboard
Hopefully we can solve that today.

I'm thinking the error message just isn't getting parsed right on my
end hopefully...

rrivard

unread,
Apr 27, 2009, 11:13:48 AM4/27/09
to reviewboard
I followed these instructions, and it appears to do what is intended.
It will create a post-review exe that will run on this machine (the
machine I used py2exe on), and will even work on other machines to
some extent. You can view the help, and post reviews as long as you
don't supply any information to the review. If you attempt to use --
summary, --description --branch, etc, it will fail when trying to save
the review.


WITHOUT --SUMMARY:

C:\Documents and Settings\user\Desktop\post-review dist>post-
review.exe --server="http://site.com:80" --username="review_poster" --
password="password" --submit-as="rrivard" --repository-url="http://svn-
server.com/repos/MMSDevelopment" --revision-range="HEAD:HEAD" -d
>>> svn info http://svn-server.com/repos/MMSDevelopment
>>> repository info: Path: http://svn-server.com/repos/MMSDevelopment,
Base path: /, Supports changesets: False
>>> svn diff --diff-cmd=diff http://svn-server.com/repos/MMSDevelopment
/@HEAD http://svn-server.com/repos/MMSDevelopment/@HEAD
>>> Looking for 'site.com /' cookie in C:\Documents and Settin
gs\seagleMA\Local Settings\Application Data\.post-review-cookies.txt
>>> Loaded valid cookie -- no login required
>>> Attempting to create review request for None
>>> HTTP GETting /api/json/repositories/
>>> HTTP GETting /api/json/repositories/1/info/
>>> repository info: Path: http://svn-server.com/repos/MMSDevelopment,
Base path: /, Supports changesets: False
>>> Submitting the review request as rrivard
>>> HTTP POSTing to http://site.com:80/api/json/reviewrequests
/new/: {'repository_path': u'http://svn-server.com/repos/
MMSDevelopment
', 'submit_as': 'rrivard'}
>>> Review request created
>>> Uploading diff, size: 0
>>> HTTP POSTing to http://site.com:80/api/json/reviewrequests
/52/diff/new/: {'basedir': '/'}
Error uploading diff: You don't have permission for this (101)
>>> {u'stat': u'fail', u'err': {u'msg': u"You don't have permission for this", u
'code': 101}}
Your review request still exists, but the diff is not attached.


WITH --SUMMARY:

C:\Documents and Settings\user\Desktop\post-review dist>post-
review.exe --se
rver="http://site.com:80" --username="review_poster" --passwor
d="reviewboard" --submit-as="rrivard" --repository-url="http://
ssourcepn01.paych
ex.com/repos/MMSDevelopment" --revision-range="HEAD:HEAD" --
summary="test" -d
>>> svn info http://svn-server.com/repos/MMSDevelopment
>>> repository info: Path: http://svn-server.com/repos/MMSDevelopment,
Base path: /, Supports changesets: False
>>> svn diff --diff-cmd=diff http://svn-server.com/repos/MMSDevelopment
/@HEAD http://svn-server.com/repos/MMSDevelopment/@HEAD
>>> Looking for 'site.com /' cookie in C:\Documents and Settin
gs\seagleMA\Local Settings\Application Data\.post-review-cookies.txt
>>> Loaded valid cookie -- no login required
>>> Attempting to create review request for None
>>> HTTP GETting /api/json/repositories/
>>> HTTP GETting /api/json/repositories/1/info/
>>> repository info: Path: http://svn-server.com/repos/MMSDevelopment,
Base path: /, Supports changesets: False
>>> Submitting the review request as rrivard
>>> HTTP POSTing to http://site.com:80/api/json/reviewrequests
/new/: {'repository_path': u'http://svn-server.com/repos/
MMSDevelopment
', 'submit_as': 'rrivard'}
>>> Review request created
>>> Attempting to set field 'summary' to 'test' for review request '54'
>>> HTTP POSTing to http://site.com:80/api/json/reviewrequests
/54/draft/set/: {'summary': 'test'}
>>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>500 - Internal Server Error | Review Board</title>
</head>
<body>
<h1>Something broke! (Error 500)</h1>
<p>
It appears something broke when you tried to go to here. This is
either
a bug in Review Board or a server configuration error. Please
report
this to your administrator.
</p>
</body>
</title>

Unable to access http://site.com:80/api/json/reviewrequests/54
/draft/set/. The host path may be invalid
HTTP Error 500: Internal Server Error


Along with this, I get an email printing out a stack trace:


Traceback (most recent call last):

File "/usr/lib/python2.5/site-packages/Django-1.0.2_final-py2.5.egg/
django/core/handlers/base.py", line 86, in get_response
response = callback(request, *callback_args, **callback_kwargs)

File "/usr/lib/python2.5/site-packages/Django-1.0.2_final-py2.5.egg/
django/views/decorators/cache.py", line 44, in _wrapped_view_func
response = view_func(request, *args, **kwargs)

File "/usr/lib/python2.5/site-packages/Djblets-0.5beta1-py2.5.egg/
djblets/webapi/decorators.py", line 32, in _checklogin
response = view_func(request, *args, **kwargs)

File "/usr/lib/python2.5/site-packages/Django-1.0.2_final-py2.5.egg/
django/views/decorators/http.py", line 31, in inner
return func(request, *args, **kwargs)

File "/usr/lib/python2.5/site-packages/ReviewBoard-1.0beta2-
py2.5.egg/reviewboard/webapi/json.py", line 848, in
review_request_draft_set
draft.save()

AttributeError: 'WebAPIResponseError' object has no attribute 'save'


<ModPythonRequest
path:/api/json/reviewrequests/54/draft/set/,
GET:<QueryDict: {}>,
POST:<QueryDict: {u'summary': [u'test']}>,
COOKIES:{'rbsessionid': 'c0c7b9fcdd0dd3d090f8dcb83c04bbf6'},
META:{'AUTH_TYPE': None,
'CONTENT_LENGTH': 0L,
'CONTENT_TYPE': None,
'GATEWAY_INTERFACE': 'CGI/1.1',
'HTTP_ACCEPT_ENCODING': 'identity',
'HTTP_CONNECTION': 'close',
'HTTP_CONTENT_LENGTH': '140',
'HTTP_CONTENT_TYPE': 'multipart/form-data;
boundary=10.2.181.182.1.2184.1240844648.174.2',
'HTTP_COOKIE': 'rbsessionid=c0c7b9fcdd0dd3d090f8dcb83c04bbf6',
'HTTP_HOST': 'site.com:80',
'HTTP_USER_AGENT': 'post-review/0.8',
'PATH_INFO': u'/api/json/reviewrequests/54/draft/set/',
'PATH_TRANSLATED': None,
'QUERY_STRING': None,
'REMOTE_ADDR': '5.5.5.5.5',
'REMOTE_HOST': None,
'REMOTE_IDENT': None,
'REMOTE_USER': None,
'REQUEST_METHOD': 'POST',
'SCRIPT_NAME': '',
'SERVER_NAME': 'site.com',
'SERVER_PORT': 0,
'SERVER_PROTOCOL': 'HTTP/1.1',
'SERVER_SOFTWARE': 'mod_python'}>


Any suggestions?
> "diffutils-2.8.7-1.exe" fromhttp://gnuwin32.sourceforge.net/packages/diffutils.htm
>
> 8) Run the diffutils installer. Accept the default options except
> where prompted for documentation, which should be deselected as not
> required.
>
> 9) Copy the following files from C:\Program Files\GnuWin32\bin to the
> post-review dist/ subdirectory:
>         diff.exe
>         libiconv2.dll
>         libintl3.dll
>
> 10) Rename the dist/ folder to something descriptive, then ZIP it up
> and distribute to users - alternatively, I was able to build a simple
> Windows installer at no cost using NSIS and HM NIS Edit.
>
> David
>
Reply all
Reply to author
Forward
0 new messages