Project Documentation for Per-Diff Attachments

Hello UCOSP students!

Previously, ReviewBoard only allows per-review attachments. We need a mechanism for per-diff file attachments for binary files, since the diff for binary files cannot be textually displayed. The project aims to enable this feature. The project is split into the following parts:

  1. Modify the current database structure to allowing storage of per-diff attachments
  2. Enable display of per-diff attachments on the diff-viewer page
  3. Modify the server-side JSON API to enable uploading of per-diff attachments
  4. Modify the client-side post-review tool to enable automatic uploading of per-diff attachments

Due to time constraints, only part 1 and 2 of the project have been completed, and the code is in for review (have received many reviews, now only minor code formatting to be fixed). Please see the following URL for the review:

Some explanation about the code changes for part 1 and 2:

In attachments/, two database fields are added:

diff_source_file : the original(source) file name of the particular diff

diff_source_revision : the revision number of the source file

In the attachments/, a new test case has been added to test the model change.

NOTE: The attachments/evolutions/ is added to added to apply the database model change. It is based on the Django Evolution and it must be applied to the database. Please see the documentation for Django Evolution on how to apply the change.

In the diffviewer/, code has been added to query the database for attachments that have matching source file name and revision number for each binary file diff in the review. The found attachments are added to the “context” and sent to the diff viewer page.

On the diff viewer page, templates/diffviewer/diff_file_fragment.html, code snippet has been added to display the per-diff attachments in the context, if any.

For the details of code changes, please see the review at the URL given above. If you have any questions, please feel free to contact the UCOSP mailing lists. Thanks and have a good term!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s