Re: Walkthrough for New development on ReviewBoard

2011-01-27 Thread anshul ranjan
Thanks Christian !!

This gave me a good overview of the  Reviewboard SCM integration (coupled
with some study of other scmtools.py)

I hope to get my integration done soon :)


Anshul Ranjan
---
Dual Degree (B.Tech+M.Tech) ,
Electronics and Electrical Communication Engineering,
Indian Institute of Technology , Kharagpur.


On Thu, Jan 27, 2011 at 12:02 PM, Christian Hammond chip...@chipx86.comwrote:

 Hi Anshul,

 These are two guides I would love to have time to write -- an introduction
 to the codebase, and a How To on writing SCMTools.

 I'll give you a bit of a summary here, though. If you search through the
 archives, you may find other tidbits of information too.

 Let's start with the codebase.

 We follow many of the Django conventions on the structure of a project.
 Each directory in the main reviewboard directory is an app directory.
 Basically, a segmented part of the codebase, each with its own
 responsibility. They're as follows:

 * accounts - Account handling (user profile, registration, logging in,
 etc.)
 * admin - Administration UI and general sanity checks for the site
 (dependencies and such)
 * changedescs - Code for processing and storing change descriptions on
 review requests.
 * cmdline - The actual code for rb-site and some other things.
 * difffviewer - Diff viewer code. Diff parsing, syntax highlighting, types
 of change analysis (move detection, function/class headers), Upload Diff
 form..
 * notifications - E-mail notifications for changes
 * reports - Very simple reporting functionality. You won't need this, and
 it'll go away/move at some point.
 * reviews - Review request, review, commenting, dashboard, and other
 things.
 * scmtools - Code for talking to a repository and configuring repository
 entries. This is what you'll be most interested in.
 * site - Code for segmenting an installation into multiple virtual sites.
 It's only in 1.6, and is more of a special-case feature.
 * templates - The actual HTML templates that make up the site
 * webapi - All the public REST API stuff

 In the directories, you'll commonly find:

 * admin.py - Representations of models in the admin UI
 * forms.py - Representations of HTML forms. Includes validation and
 processing of the data.
 * models.py - Classes that model database tables, along with utility
 functions. These are the main things that other code interacts with, in
 order to query or modify the database.
 * urls.py - URL mappings, pointing URLs to views
 * views.py - Code that renders a page, given some data and a template.

 There are others as well, but those are the common ones.


 Now, let's get to the core of what you want. SCMTools.

 An SCMTool is the interface between Review Board and a repository. It's
 actually not inherently complicated, but it does depend on what you can
 easily do with the repository and how.

 SCMTools have the following responsibilities:

 * Accessing a file, given a file path and a revision
 * Checking the validity of a repository configuration.
 * Grabbing file and revision information from a diff.

 The first two are generally no big deal. Where people get tripped up
 sometimes is the third. Review Board expects that all uploaded diffs contain
 enough information for grabbing exactly the source file from a repository.
 That means the diff must contain a file path and a revision.

 If this is your own source control system, and you are generating your own
 diffs, I'm sure you can control this to some degree. When this is beyond
 people's control, though, the solution is to update the 'post-review' tool
 and have it generate a custom diff with this information inserted.

 It's typical to put the revision in the date fields in a diff. Like:

 --- /path/to/file.py revision
 +++ /path/to/file.py whatever

 Some, like Git, provide this as a custom line before the --- and +++
 lines. So it's up to whatever you guys end up using.

 Now, the best thing you can do is to go over the other SCMTools classes and
 look at how they work. Try to figure out what your internal SCM is closest
 to in terms of functionality, and mostly duplicate that.

 Key functions to implement:

 * get_file - Must return file content, given a file path and revision. The
 revision may be HEAD, UNKNOWN, or PRE_CREATION (new file).
 * file_exists - If you have a way to check the existence of a file without
 having to grab the full file content, use this. Otherwise, it will call
 get_file and check the result.
 * parse_diff_revision - Takes a file path and revision string and returns a
 revision. This can return the revision number/string, HEAD, or PRE_CREATION.
 * get_changeset - If your SCM supports server-side changesets (defined as
 the server having knowledge of the opened files on all clients, with
 descriptions of the change -- usually this isn't needed).
 * get_fields - This will return a list of field names to display in the New
 Review Request or Upload Diff forms. This is at least

Walkthrough for New development on ReviewBoard

2011-01-26 Thread Anshul
Hi ,

I am trying to integrate VSS and an internal SCM of my company with
ReviewBoard. I am kind of short on time and unable to find any good
walk through on integrating a new SCM with ReviewBoard.

Specifically, what all files would i need to modify/add in order to
add a new repository from scratch.
 (one place i did figure out was that I need to add a new file in
scmtools/)

Another thing of great help would be a structural overview of
Reviewboard (as in files/directory mapping with the functionalities)
for new developers to quickly add new features  or modify existing
ones.

It would be a great help to me , if in case such pointers are already
available in some blog / mailing list / wiki, !


Thanks,
Anshul

-- 
Want to help the Review Board project? Donate today at 
http://www.reviewboard.org/donate/
Happy user? Let us know at http://www.reviewboard.org/users/
-~--~~~~--~~--~--~---
To unsubscribe from this group, send email to 
reviewboard+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/reviewboard?hl=en


Re: Help with sqlite

2011-01-21 Thread anshul ranjan
Hi Arvind,

How did you compile your python ? ( Did you the sqlite3 dev headers
installed before installing python ?. If not probably you would not find
_sqlite3.so file)

Can you check if you have _sqlite3.so file in
your /usr/lib/python2.6/lib-dynload.

I suspect this could be the cause of error  DatabaseError: unable to open
database file

I have encountered this situation a couple of weeks earlier with the problem
described.

Also, I assume Christian is asking for
 1. Web-server conf file : This lies in ,if using httpd ,
Path_to_http_installation/conf/httpd.conf
 or if installed as root
(without any ./configure --prefix) you should find it at
 /etc/*httpd*/*conf*/*
httpd*.*conf*
 2. After doing DEBUG = True in settings_local.py, re-start
the server (please note the time and date. that helps), attach the
httpd_error log (found at /var/log/*httpd*/error_log if normal installation)
or if a custom --prefix installation was done then at
Path_to_http_installation/logs/error_log.
 3. When you get a error page, don't do a Select all, copy
and paste it here. Rather in your browser go to (File - Save as - Webpage
(html) ) and send that along.

These would give proper information for a debug.

Anshul Ranjan
---
Dual Degree (B.Tech+M.Tech) ,
Electronics and Electrical Communication Engineering,
Indian Institute of Technology , Kharagpur

On Fri, Jan 21, 2011 at 5:54 PM, Aravind Ayyagari aayyag...@gmail.comwrote:

 I am attaching the settings_local.py file and HTML of the error page.


 On Fri, Jan 21, 2011 at 1:52 AM, Christian Hammond chip...@chipx86.comwrote:

 I still need the settings_local.py file to be able to tell you more, and
 the actual HTML of the error page when DEBUG = True.

 I suspect the ownership of the directory containing the database is wrong,
 though. It should, like the database itself, be writeable by the web server.


 Christian

 --
 Christian Hammond - chip...@chipx86.com
 Review Board - http://www.reviewboard.org
 VMware, Inc. - http://www.vmware.com


 On Thu, Jan 20, 2011 at 8:09 PM, Aravind Ayyagari aayyag...@gmail.comwrote:

 Sorry it's my mistake, that one was the HTML output after changing the
 DEBUG option to True. What are the changes that i should  make regarding the
 error messages in error log file ?


 On Thu, Jan 20, 2011 at 8:28 PM, Christian Hammond 
 chip...@chipx86.comwrote:

 I think you sent the wrong thing for the settings file. It looks like
 the HTML debug output, but copy/pasted. Make sure it's File - Save'd, as 
 it
 needs to be complete with all the contained javascript for grabbing stack
 traces.


 Christian

 --
 Christian Hammond - chip...@chipx86.com
 Review Board - http://www.reviewboard.org
 VMware, Inc. - http://www.vmware.com


 On Thu, Jan 20, 2011 at 6:02 PM, Aravind Ayyagari 
 aayyag...@gmail.comwrote:


 I am attaching both error log as well as conf/settings_local.py file,
 can you please point me what i should do next. Thanks a lot for your help.


 On Wed, Jan 19, 2011 at 11:16 PM, Christian Hammond 
 chip...@chipx86.com wrote:

 Check your web server's error log and see if there are any errors
 there.

 If not, edit your site's conf/settings_local.py file and set DEBUG to
 True (capital T). Then restart the web server and try again. You should 
 have
 something more useful to help diagnose the problem. If it's not obvious
 there, you can e-mail the file (as an attachment, please) and we'll take 
 a
 look.

 Christian

 --
 Christian Hammond - chip...@chipx86.com

 Review Board - http://www.reviewboard.org
 VMware, Inc. - http://www.vmware.com


 On Wed, Jan 19, 2011 at 10:45 PM, Aravind aayyag...@gmail.comwrote:

 @ christian - Thank you for ur help. Actually i asked that question
 because i was having a problem opening the site in browser. I was
 getting an error : Review Board is taking a nap. I thought changing
 the ownership might be the problem, but even after changing the
 ownership it is not working. Can you please help me out on advising
 me
 some solution ?


 On Jan 20, 12:26 am, Christian Hammond chip...@chipx86.com wrote:
  Hi Aravind,
 
  Actually, let me first advise you not to use SQLite for anything
 other than
  a very simple test installation. If you do, don't expect to migrate
 the data
  to another database. SQLite doesn't really scale for any more than
 a couple
  users. I recommend MySQL or PostgreSQL.
 
  What that documentation is saying is that you need to change
 ownership to
  be, probably, www-data. That's done like:
 
  sudo chown www-data:www-data db
 
  chown is used for changing ownership to a user/group. The parameter
 is in
  user:group format.
 
  The username and group will depend on the distro and the username
 for the
  service, so you'd have to look it up. You can probably figure out
 which one
  by looking at /etc

Send reminder mails to reviewers who have not responded after fixed time.

2011-01-12 Thread Anshul

Hi,

I would like to know if it is possible to Send Reminder Mails to
reviewers who haven't responded to a review posted within a specified
amount of time ?

This will be helpful in case some reviewer has forgotten to review for
some reason and overlooked the Dashboard.

If it is not already available, where can I start (source files etc)
to develop this feature on my own ?


Thanks,

Anshul

-- 
Want to help the Review Board project? Donate today at 
http://www.reviewboard.org/donate/
Happy user? Let us know at http://www.reviewboard.org/users/
-~--~~~~--~~--~--~---
To unsubscribe from this group, send email to 
reviewboard+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/reviewboard?hl=en


Re: Manual Update told Unable to read settings_local.py

2010-12-29 Thread Anshul
Hi Christian,

I finally debugged the problem and also Solved it,
I am able to load ReviewBoard as it was expected.

Problem Debugged
In ReviewBoard, admin/checks.py (Line 83) it tries to load
ChangeDescription module
and the following 'except:' I think was to only test if the module
is loaded or not (as inferred from the comment)
I changed this to 'except ImportError:'
and surprisingly it wasn't an ImportError after all.
I had turned DEBUG true (in  settings_local.py)
After this change I got

 ValueError at /account/login/
 database parameter must be string or APSW Connection
object

and Entire list of tracebacks with local variable values (due to
DEBUG on)

Interestingly in PYTHONDIR/lib/site-packages/Django-1.2.4-
py2.6.egg/django/db/models/query.py, I found
 ▼ Local vars
   Variable Value
   self Error in formatting: database parameter must be string
or APSW Connection object

And this error propagated down. I Googled and this error seems to
be from pysqlite2.

Finally I tested my Python installation. Though there was
pysqlite2 I was unable to import sqlite3 (sqlite3 was installed on my
system) but there was no _sqlite3.so file


Solution

 I had to recompile sqlite3 and python locally (with header files
of sqlite3 passed on and --enable-share).
 And everything else for ReviewBoard from scratch.

  This finally Worked

Conclusion

 I would suggest in ReviewBoard/admin/checks.py : Change 'except:'
to 'except ImportError:' (or whatever exact error its supposed to look
for)
 This atleast helps in debugging the problem

Anshul

On Dec 28, 9:20 am, Anshul anshul14ran...@gmail.com wrote:
 Hi Christian,

 Here is the SITE/conf/settings_local.py

 I was checking the Absolute path to database name here and even this
 seems to be ok.
 I even tried changing the format of DATABASE_ENGINE, DATABASE_NAME as
 per Django 1.2 Settings (http://docs.djangoproject.com/en/1.2/ref/
 settings/#databases).
 Even that didn't help and I get Database Changes / Manual Server
 Update required.

 So I restarted all work from scratch  with Django 1.1.3 instead of
 1.2.4.
 Even that didn't work

 --

 DATABASE_ENGINE = 'sqlite3'
 DATABASE_NAME = 'ABSOLUTE_PATH_TO_SITE/data/reviewboard.db'

 # Unique secret key. Don't share this with anybody.
 SECRET_KEY = '*'

 # Cache backend settings.
 CACHE_BACKEND = 'file:///tmp/reviewboard_cache'

 # Extra site information.
 SITE_ID = 1
 SITE_ROOT = '/'
 FORCE_SCRIPT_NAME = ''
 DEBUG = True
 ---

 Thanks,
 Anshul

 On Dec 27, 4:59 am, Christian Hammond chip...@chipx86.com wrote:



  Hi Anshul,

  Can I see your Apache config for Review Board? I haven't used
  mod_python with virtual-python, so I don't know off-hand how that all
  works.

  This error happens when the Python path that the Python interpreter
  ends up using isn't properly including the site's conf/ directory.

  Christian

  --
  Christian Hammond - chip...@chipx86.com
  Review Board -http://www.reviewboard.org
  VMware, Inc. -http://www.vmware.com

  On Sun, Dec 26, 2010 at 6:36 AM, Anshul anshul14ran...@gmail.com wrote:
   Hi Christian ,

   I am facing the similar problem as Dan.

   I am using a virtual-python installation with Python2.6 (the virtual-
   python bin is set in $PATH so the default 'python' is now my virtual
   python)

   Everything seemed to be working (from installation of Apache,
   mod_python , virtual-python to the config) until I get hit by Manual
   Server Update Required page on loading ReviewBoard

   I am using mod_python.
   I googled and found that rb-site update should be used but rb-site
   upgrade /path/to/site/ says

   Rebuilding directory structure
   Updating database. This may take a while.
   No fixtures found.
   PATH_TO_VIRTUALPYTHON/lib/python2.6/site-packages/pycrypto-2.3-py2.6-
   linux-x86_64.egg/Crypto/Util/randpool.py:40:
   RandomPool_DeprecationWarning: This application uses RandomPool, which
   is BROKEN in older releases.  Seehttp://www.pycrypto.org/randpool-broken
   No evolution required.
   Upgrade complete.

   ReviewBoard 1.5.2 was installed using easy_install. (appropriately in
   the virtual-python area)

   I would greatly appreciate your help on this issue.

   Anshul
   On Dec 16, 2:27 am, Christian Hammond chip...@chipx86.com wrote:
   The Manual Server Updates message is really intended to be seen by
   those working on development setups. You shouldn't run manage.py on a
   production install. Instead, you should be going through rb-site.
   Perhaps we should update those instructions to say that.

   When you created the site, did you use mod_wsgi, or something else? If
   mod_wsgi, check the other threads. It seems rather busted on Windows.

   Christian

   --
   Christian Hammond - chip...@chipx86.com
   Review Board -http

Re: Manual Update told Unable to read settings_local.py

2010-12-27 Thread Anshul
Hi Christian ,

FYI (to the earlier mail): I am using Suse Linux

On Dec 16, 2:27 am, Christian Hammond chip...@chipx86.com wrote:
 The Manual Server Updates message is really intended to be seen by
 those working on development setups. You shouldn't run manage.py on a
 production install. Instead, you should be going through rb-site.
 Perhaps we should update those instructions to say that.

 When you created the site, did you use mod_wsgi, or something else? If
 mod_wsgi, check the other threads. It seems rather busted on Windows.

 Christian

 --
 Christian Hammond - chip...@chipx86.com
 Review Board -http://www.reviewboard.org
 VMware, Inc. -http://www.vmware.com

 On Wed, Dec 15, 2010 at 8:11 AM, Dan birb...@gmail.com wrote:
  Hi All,

  Following the guide 
  ofhttp://www.reviewboard.org/docs/manual/1.5/admin/installation/windows/,
  I installed the reviewboard and created a site.

  But when I access the site, it said Manual server updates required,
  and ask me 
  visithttp://code.google.com/p/reviewboard/wiki/RequiredServerUpdates.
  It ask me run the command manage.py syncdb, I did it, however, got a
  message Unable to read settings_local.py.

  The manage.py is in the reviewboard directory, and the
  settings_local.py is in the conf directory of site. Then I am lost...

  Could anyone tell me how to make it work, any help will be highly
  appreciated!

  --
  Want to help the Review Board project? Donate today 
  athttp://www.reviewboard.org/donate/
  Happy user? Let us know athttp://www.reviewboard.org/users/
  -~--~~~~--~~--~--~---
  To unsubscribe from this group, send email to 
  reviewboard+unsubscr...@googlegroups.com
  For more options, visit this group 
  athttp://groups.google.com/group/reviewboard?hl=en

-- 
Want to help the Review Board project? Donate today at 
http://www.reviewboard.org/donate/
Happy user? Let us know at http://www.reviewboard.org/users/
-~--~~~~--~~--~--~---
To unsubscribe from this group, send email to 
reviewboard+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/reviewboard?hl=en


Re: Manual Update told Unable to read settings_local.py

2010-12-27 Thread Anshul
Hi Christian,

Here is the SITE/conf/settings_local.py

I was checking the Absolute path to database name here and even this
seems to be ok.
I even tried changing the format of DATABASE_ENGINE, DATABASE_NAME as
per Django 1.2 Settings (http://docs.djangoproject.com/en/1.2/ref/
settings/#databases).
Even that didn't help and I get Database Changes / Manual Server
Update required.

So I restarted all work from scratch  with Django 1.1.3 instead of
1.2.4.
Even that didn't work

--

DATABASE_ENGINE = 'sqlite3'
DATABASE_NAME = 'ABSOLUTE_PATH_TO_SITE/data/reviewboard.db'

# Unique secret key. Don't share this with anybody.
SECRET_KEY = '*'

# Cache backend settings.
CACHE_BACKEND = 'file:///tmp/reviewboard_cache'

# Extra site information.
SITE_ID = 1
SITE_ROOT = '/'
FORCE_SCRIPT_NAME = ''
DEBUG = True
---

Thanks,
Anshul


On Dec 27, 4:59 am, Christian Hammond chip...@chipx86.com wrote:
 Hi Anshul,

 Can I see your Apache config for Review Board? I haven't used
 mod_python with virtual-python, so I don't know off-hand how that all
 works.

 This error happens when the Python path that the Python interpreter
 ends up using isn't properly including the site's conf/ directory.

 Christian

 --
 Christian Hammond - chip...@chipx86.com
 Review Board -http://www.reviewboard.org
 VMware, Inc. -http://www.vmware.com



 On Sun, Dec 26, 2010 at 6:36 AM, Anshul anshul14ran...@gmail.com wrote:
  Hi Christian ,

  I am facing the similar problem as Dan.

  I am using a virtual-python installation with Python2.6 (the virtual-
  python bin is set in $PATH so the default 'python' is now my virtual
  python)

  Everything seemed to be working (from installation of Apache,
  mod_python , virtual-python to the config) until I get hit by Manual
  Server Update Required page on loading ReviewBoard

  I am using mod_python.
  I googled and found that rb-site update should be used but rb-site
  upgrade /path/to/site/ says

  Rebuilding directory structure
  Updating database. This may take a while.
  No fixtures found.
  PATH_TO_VIRTUALPYTHON/lib/python2.6/site-packages/pycrypto-2.3-py2.6-
  linux-x86_64.egg/Crypto/Util/randpool.py:40:
  RandomPool_DeprecationWarning: This application uses RandomPool, which
  is BROKEN in older releases.  Seehttp://www.pycrypto.org/randpool-broken
  No evolution required.
  Upgrade complete.

  ReviewBoard 1.5.2 was installed using easy_install. (appropriately in
  the virtual-python area)

  I would greatly appreciate your help on this issue.

  Anshul
  On Dec 16, 2:27 am, Christian Hammond chip...@chipx86.com wrote:
  The Manual Server Updates message is really intended to be seen by
  those working on development setups. You shouldn't run manage.py on a
  production install. Instead, you should be going through rb-site.
  Perhaps we should update those instructions to say that.

  When you created the site, did you use mod_wsgi, or something else? If
  mod_wsgi, check the other threads. It seems rather busted on Windows.

  Christian

  --
  Christian Hammond - chip...@chipx86.com
  Review Board -http://www.reviewboard.org
  VMware, Inc. -http://www.vmware.com

  On Wed, Dec 15, 2010 at 8:11 AM, Dan birb...@gmail.com wrote:
   Hi All,

   Following the guide 
   ofhttp://www.reviewboard.org/docs/manual/1.5/admin/installation/windows/,
   I installed the reviewboard and created a site.

   But when I access the site, it said Manual server updates required,
   and ask me 
   visithttp://code.google.com/p/reviewboard/wiki/RequiredServerUpdates.
   It ask me run the command manage.py syncdb, I did it, however, got a
   message Unable to read settings_local.py.

   The manage.py is in the reviewboard directory, and the
   settings_local.py is in the conf directory of site. Then I am lost...

   Could anyone tell me how to make it work, any help will be highly
   appreciated!

   --
   Want to help the Review Board project? Donate today 
   athttp://www.reviewboard.org/donate/
   Happy user? Let us know athttp://www.reviewboard.org/users/
   -~--~~~~--~~--~--~---
   To unsubscribe from this group, send email to 
   reviewboard+unsubscr...@googlegroups.com
   For more options, visit this group 
   athttp://groups.google.com/group/reviewboard?hl=en

  --
  Want to help the Review Board project? Donate today 
  athttp://www.reviewboard.org/donate/
  Happy user? Let us know athttp://www.reviewboard.org/users/
  -~--~~~~--~~--~--~---
  To unsubscribe from this group, send email to 
  reviewboard+unsubscr...@googlegroups.com
  For more options, visit this group 
  athttp://groups.google.com/group/reviewboard?hl=en

-- 
Want to help the Review Board project? Donate today at 
http://www.reviewboard.org/donate/
Happy user? Let us know at http://www.reviewboard.org/users