The extension allows the developers to easily create code reviews (aka pull requests), send them to others and get a feedback.
The extension was developed in the framework of winter13-14 "Industrial Project" course of Computer Science faculty in Technion. The goal of the project was to develop an integrated offline code review system for HP web-based IDE that allows any developer to easily create and send a code review request to his colleagues and get a feedback.
Fast and easy way:
$ cd <IDE source>
$ curl -Ls http://tiny.cc/cawcodereview | sh
Otherwise, use the steps below.
The extension depends on 2 others, so first please install them:
So, first please install these extensions.
Now you're ready to install the extension itself. Clone it to your source tree:
$ cd <IDE source>
$ git submodule add \
https://github.com/korya/hp-ide-code-review-extension.git \
app/extensions/hpsw/code-review/1.00
Install the dependencies:
$ json -I -f package.json -E 'this.dependencies["socket.io"]="0.9.16"'
$ npm install [email protected]
$ json -I -f bower.json -E 'this.dependencies["socket.io-client"]="0.9.16"'
$ bower install
Tell the server to load the extension:
- register server side code:
$ json -I -f server/file-system/config-files/config.json \
-E 'this.modules["code-review"]="../app/extensions/hpsw/code-review/1.00/server"'
- register client side code:
$ json -I -f server/file-system/extensions/manifest.json \
-E 'this.defaultExtension.push({"id":"code-review","version":1,"author":"hpsw"})'
In addition, you have to apply the following patches, providing a functionality that is still missing in a mainstream:
00-support-socket.io.diff
: server supportssocket.io
01-integrate-orion-compare.diff
: integrateOrion's Compare
into IDE02-fix-persistence-mock.diff
: fixes for persistence mock service03-fix-id-persistence-mongodb.diff
: fixes for persistence mongodb service04-fix-orion-compare-i18n-issue.diff
: workaround for i18n issue inOrion's Compare
05-users-round-robin.diff
: add more users assigned in round robin mannerx1-fix-for-ide-layout.diff
: minor fix for IDE layout [not required]
$ cat app/extensions/hpsw/code-review/1.00/patch.d/[0-9][0-9]-*.diff | patch -p1
For more details, see:
A new code review request can be created in IDE page:
- user can select a reviewer
- user can select a change (commit)
Code Review extensions adds 2 new pages (open MegaMenu to see this), Review Dashboard
and Code Review
:
Review Dashboard
page lists all code reviews the user is involved in (author or reviewer):
Code Review
page is dedicated for working on a selected code review request
Left column of Code Review
page displays the review details:
- top half displays the review state and a file tree of changed files
- bottom half displays other review details
Right column of Code Review
page displays:
- list of current comment threads
- list of comments for a selected thread; available threads are:
- 'Show all review comments' -- all review comments
- 'Show review-wide comment thread' -- comments for a review as a whole, not related to any specific file
- 'Show all file comments' -- all comments related to a specific file
- 'Show file-wide comment thread' -- comments for a file as a whole, not related to any specific line
- 'Show file-line comment thread' -- comments for a specific line in a specific file
Center column of Code Review
page displays the diff
s of changed files:
- open files are listed at top
- at most one selected file diff is displayed
- Orion's Compare widget is user to show the diff
- commented lines have a bold font and a dialog icon on the left ruler