Author Archives: ddruska

Meeting Minutes Feb 18, 2012

All of the students and mentors attended this meeting.

Minutes:

-Mike emailed the UCOSP steering committee and they have given the mentors an evaluation rubric.
-Midterm evaluations are due this Wednesday. If you think you can’t complete your project this semester then it’s a good time to talk to the mentors.
-Anthony has no roadblocks this week, and is working on addressing a code review.
-Christian has a tip about Django database development. Django has ways to minimize database queries and can group them in other queries. He recommends reading the docs on select_related() and other database docs.
-Review board 1.7 will require Django 1.4. This adds prefetch_related functionality.
-Curtis has had a busy week, no updates aside from his status report.
-Willer is having database issues which will be resolved in non-meeting time.
-Dave has no concerns that weren’t stated in his status report.
-Yazan has no roadblocks, but needs a new project. The “expand all” button is sometimes annoying when you only want to expand a bit. Christian has some half-finished code for that which Yazan can finish up.
-Wilson is having trouble finding out where to place his changes, this is brought up in his review. He’s also having problems with a checkbox being “checked” when it should really render as “unchecked”. His project is almost done – he will need a new project soon.
-For client-side debugging, use Chrome dev tools for Chrome or firebug for Firefox.
-Steve continues the discussion on how Review Bot will get code. The initial idea might be to query RB for the files. Christian points out that what’s needed is the repository configuration (including SSH keys) which can be done by looking directly at RB’s database. Then create an abstraction layer over SCM tools, starting with checkout update on git.
-Steve is also concerned because his webhooks extension has started relying on his extension modifications. These modifications should be reviewed asap!
-Jim will be working throughout reading week, and will try to post a review request soon. Jim also found a bug, which he will be fixing.
-Steve asked Christian about his WIP T-shirt designs again, which would be awesome!

Advertisements

Status Reports – Feb 11/12

Anythony

Status

  • Picked up a new project (Issue Tracker Integration)
  • Got the web-UI aspects working

Next Steps

  • Do more testing and post a code review

Roadblocks

  • I am not sure what the best way is to test the e-mail notifications fetaure.

Curtis

Status

  • Implemented Christian’s and Mike’s changes, moved logic to the view. Could use a quick review (ship its hopefully).http://reviews.reviewboard.org/r/2810/
  • Used Antony’s script to generate my extension stub. Started working on the social extension backend, very basic functionality for the controller>model>view>dashboard_template working.

Next Steps

  • Continue working on the social extension, next week we want to have a functional prototype working.

Roadblocks

  • Could use a quick tutorial on template hooks. ie. How can my extension use a template hook in a Review Board template to add something to the page?

Dave

Status

  • Almost done better moved/renamed files project

Next Steps

  • Finish project, get more info about binary files project

Roadblocks

  • Strange Linux problems

Jim

Status

  • still working on diff rendering with descriptions and tests.
  • also investigating the bug that I discovered (comment gets out of sync between interdiff and summary)

Next Steps

  • continue what I am doing

Roadblocks

  • none for now

Steven

Status

  • Put basic web hooks extension up for review
  • Prototyped webhooks and reviewbot
  • Working on improving webhooks and getting reviewbot ready for review

Next Steps

  • Add support for repo cloning to SCM tools
  • Continue with reviewbot

Roadblocks

  • Would like some feedback on webhooks before I continue with current path

Wei Lu

Status

  • found and solved the problems in the code reused from r/2615
  • made further changes according to the comments in the thread

Next Steps

  • test it properly and debug, then post a review request to replace r/2615

Roadblocks

  • not sure how to test it on the local dev server properly

Wilson

Status

  • Made progress on project, near completion
  • More reading

Next Steps

  • Finish up and submit for review
  • Read more

Roadblocks

  • None

Yazan

Status

  • Working on required fields, almost done
  • Did some work on moving/enhancing summary table

Next Steps

  • Submit work for review

Roadblocks

  • None

preview-email/html/

Dave: Winter Code Sprint 2012

Here’s an update on what I’ve been working on.

Issue 2359:

Subversion 1.7 fails at diff parsing because they changed their diff format. The actual problem occurs on line 126 of reviewboard/scmtools/svn.py where pysvn.cat() tries to grab data from the file in “Index: file” but a directory is passed into “Index: directory” instead. Pysvn.cat() returns an error, which translates to a FileNotFoundError. I tried to think of a workaround, but we may need to wait for a Pysvn update to fix this.

Inline File Attachments Project:

Started cleaning up Jacob’s code for “Inline File Attachments” and making it function. It has basic function right now, but Christian is working on thumbnailing separately which will provide classes that render different attachment types. I should not continue with this project until Christian is done with this part.

Time Zones:

Since Django 1.4 is now required for Djblets master to function, I removed the NameError’s and ImportError’s from my time zone project, which kept backwards functionality. Dates.py was also missing for some reason, so I re-wrote the changes and posted that review.

Blog Posts:

I wrote a blog post on Python Virtual Environments and The Python Debugger (pdb).

Python Virtual Environments

Sometimes, one Python environment may not be enough. For instance, you may find yourself working on multiple Django projects at once – each with different Python package requirements. I personally ran into this problem when writing a feature which required the bleeding-edge version of Django. Repeatedly installing/uninstalling different Django versions is redundant, and virtual environments are the answer.

To get started, install virtualenv and virtualenvwrapper:
pip install virtualenv
pip install virtualenvwrapper

Add the following to ~/.bashrc:
# virtualenvwrapper
export WORKON_HOME=~/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh
export PIP_VIRTUALENV_BASE=$WORKON_HOME
export PIP_RESPECT_VIRTUALENV=true

Lastly, create the virtual environment directory and execute ~/.bashrc:
mkdir ~/.virtualenvs
source ~/.bashrc

Now you can create isolated Python environments using mkvirtualenv envname. I have one called “rb”, and one called “rbalpha” which contain different Python packages. After an environment is activated, you’ll see (envname) next to your username in bash. You can activate an environment by simply using workon envname.

Once you are in your environment, Python packages can be installed in a similar manner as before. The only difference is you don’t use sudo when installing packages with pip or setup.py install. If you do this, the packages will be installed to the system’s Python environment.

Pro tip: To list the current environment’s Python packages, use pip freeze.

The Python Debugger (pdb)

To break into pdb from a running program, insert this right into your code:
import pdb; pdb.set_trace()

You will then be in the debugger prompt, where you can move up/down in your code (u/d), look at variables (p expression), or execute any Python syntax in the current context (eg. changing a variable). A list of debugger commands is here.

To print an object’s complete state, the following can be used:
pp vars(your_object)

December 4th Meeting Minutes

Mentors: Christian, David and Mike

Students: David, Jacob and Yazan

Points:

-This is the last formal Review Board meeting for the term. There will be a post-mortem meeting on Sunday the 11th at the normal time.
-Feedback will be provided by the 12th, so anything completed before the 10th or so will be considered.
-If any of the students have any tips, tricks, or ideas for new students, post them on the blog.
-If your work won’t be completed by term end, create one clean branch and good documentation so another student can pick up your work.
-Review Board is participating in UCOSP next semester.
-The mailing lists and IRC will still be available after the 12th.
-Dave asked if {% localtime on %} tags should be around individual datetimes, or one per template. Mike proposed that it is added one per datetime, and can be changed later if needed.
-Yazan had an issue with callbacks. Mike recommends updating gCommentIssueManager so that it notifies the callbacks for both the new and the old state.
-Jacob will document his project on the blog, under the category “Projects”.

Status Reports November 27

Dave


Status

  • Removed unusable code created before Django tz was announced
  • Implemented Django tz in middleware
  • RB now works with UTC datetime objects (eg. now() is now utcnow() and fromtimestamp() is now utcfromtimestamp())
  • Started converting Djblets (and RB) datetimes into timezone-aware datetimes (with backwards compatability in Djblets)
  • Added datetime localization in some templates

Next steps

  • Continue converting naive datetimes
  • Find all the datetimes that need localization
  • Unit testing

Roadblocks

  • Displaying local times in DataGrids, since they render to the template as a string

Yazan


Status

  • Figuring out current feature
  • Updating older feature based on reviews

Next steps

  • Move forward with feature
  • Update previous feature with changes/upgrades

Roadblocks

  • Not sure where my new feature goes on Review Board

Jacob


Status

  • Adding code to Web API to enable attachment upload from PostReview
  • Revising posted review

Next steps

  • Continue adding code and testing change
  • Post review for the changes

Roadblocks

  • None