Просмотр исходного кода

HUE-9409 [blog] Fix links and bad formatting in the code review blog post

agl29 5 лет назад
Родитель
Сommit
4bf7ed0ac7

+ 62 - 112
docs/gethue/content/en/posts/2014-07-17-rbtools-example-how-do-easily-do-code-reviews-with-review-board.md

@@ -1,5 +1,5 @@
 ---
-title: 'RBTools example: How do easily do code reviews with Review Board and post-review'
+title: 'Hue Development Process - How to do code changes and reviews with Review Board and Git'
 author: admin
 type: post
 date: 2014-07-17T18:57:27+00:00
@@ -40,18 +40,29 @@ categories:
   - Development
 
 ---
-**Note:** This script has been merged into Hue as 'tools/script/hue-review'.
+**Note:**
 
-Here is a tutorial about how to use the code review tool <a href="https://www.reviewboard.org/" target="_blank" rel="noopener noreferrer">Review Board</a> for a better productivity!
+During the development process if you are facing any problem then, it is recommended to check your issues at https://discourse.gethue.com/ and https://github.com/cloudera/hue/issues?q=is%3Aissue+. If the solution is not found then, feel free to create an issue at https://github.com/cloudera/hue/issues.
+
+Here is a tutorial about how to use the code review tool [Review Board](https://www.reviewboard.org/) for a better productivity!
 
 # Setup
 
-First, join the 'hue' group in your account <a href="https://review.cloudera.org/account/preferences/#groups" target="_blank" rel="noopener noreferrer">https://review.cloudera.org/account/preferences/#groups</a>
+Hue project uses Review Board and Pull Requests for code reviews. For more complex patches it's advisable to use RB than a plain pull request on github. The advantage of Pull Request is that the CI (syntax check, tests…) automatically runs for you. Along with the web app, a command line tool named RBTool is used to make things easier.
+
+Create accounts in https://review.cloudera.org, https://issues.cloudera.org/browse/HUE and https://github.com and share the usernames
+
+Then, join the 'hue' group in your account https://review.cloudera.org/account/preferences/#groups
+
+Then [download](https://www.reviewboard.org/downloads/rbtools/) the Review Board tools and install it.
 
-Then <a href="https://www.reviewboard.org/downloads/rbtools/" target="_blank" rel="noopener noreferrer">download</a> the Review Board tools and install it.
+If you've never used git and github before, there are bunch of things you need to [do](https://kbroman.org/github_tutorial/pages/first_time.html) before going further.
 
+Now, clone cloudera/hue:
 
-Point it to your git repository:
+    git clone https://github.com/cloudera/hue
+
+Then, go inside your git repository:
 
     romain@runreal:~/projects/hue$ rbt setup-repo
 
@@ -71,145 +82,84 @@ Point it to your git repository:
 
     Config written to /home/romain/projects/hue/.reviewboardrc
 
-# Post a review
-
-We have wrapped up the typical submission in a dedicated 'tools/scripts/hue-review' script prefilled with all the details of the commits:
-
-    vim tools/scripts/hue-review
-
-If you use a Linux:
-
-    function hue-review {
-
-    #!/usr/bin/env bash
-
-    if [ $# -lt 3 ]; then
-
-    echo "Usage: hue-review rev-list reviewer(s) summary ..." 1>&2
-
-    exit 1
-
-    fi
-
-    RBT=\`which rbt\`
-
-    if [ "$?" -ne "0" ]; then
-
-    echo "Please install rbt from https://www.reviewboard.org/" 1&>2
-
-    exit 1
-
-    fi
-
-    REVLIST=$1;
-
-    REVRANGE=${REVLIST//\.\./:};
-
-    REVIEWER=$2;
-
-    SUMMARY=$3;
-
-    shift 3;
-
-    exec $RBT post -o -description="$(git whatchanged $REVLIST)" -target-groups=hue -target-people="$REVIEWER" -summary="$SUMMARY" $REVLIST $@
-
-    }
-
-
-If you use a Mac:
-
-    #!/usr/bin/env bash
+Create a new branch with the jira id (HUE-XXX) as the branch name:
 
-    if [ $# -lt 3 ]; then
+    git checkout master
+    git pull --rebase origin master
+    git checkout -b HUE-XXX
 
-    echo "Usage: hue-review rev-list reviewer(s) summary ..." 1>&2
+Then make your changes in code:
 
-    exit 1
+    git add <file>
+    git diff --cached
+    git commit -m "HUE-XXX <Ticket summary>"
 
-    fi
-
-    RBT=\`which rbt\`
-
-    if [ "$?" -ne "0" ]; then
-
-    echo "Please install rbt from https://www.reviewboard.org/" 1>&2
-
-    exit 1
-
-    fi
-
-    REVLIST=$1;
-
-    REVRANGE=${REVLIST//\.\./:};
-
-    REVIEWER=$2;
-
-    SUMMARY=$3;
-
-    shift 3;
-
-    exec $RBT post \
-
-    -o \
-
-    -description="$(git whatchanged $REVLIST)" \
-
-    -target-groups=hue \
-
-    -target-people="$REVIEWER" \
-
-    -summary="$SUMMARY" \
-
-    $@ \
-
-    $REVLIST
+# Post a review
 
+We have wrapped up the typical submission in a dedicated [tools/scripts/hue-review](https://github.com/cloudera/hue/blob/master/tools/scripts/hue-review) script prefilled with all the details of the commits:
 
-Then:
+Now we post the review:
 
-    source /home/romain/.bashrc
+    tools/scripts/hue-review HEAD~1..HEAD <reviewers> "HUE-XXX [component] <Ticket summary>" --bugs-closed=HUE-XXX
 
-or put it in your PATH.
+* Above command must return the review link as given in below example.
+* Goto the review link and varify details & press publish. All the reviewers will be informed with an email.
 
-Now we post the review:
+eg:
 
     tools/scripts/hue-review HEAD~1..HEAD romain,enricoberti,erickt "HUE-2123 [beeswax] Handle cancel state properly" -bugs-closed=HUE-2123
 
     Review request #4501 posted.
 
-    https://review.cloudera.org/r/4501/
+    https://review.cloudera.org/r/4501
 
 
-Et voila! Here is our review <a href="https://review.cloudera.org/r/4501" target="_blank" rel="noopener noreferrer">https://review.cloudera.org/r/4501</a>.
+Et voila! Here is our review https://review.cloudera.org/r/4501.
 
 **Note**:
 
 If you have more than one diff, update `HEAD~1..HEAD` accordingly (e.g. `HEAD~2..HEAD`)
 
+Now go to the ticket and add a comment with content
+
+* Ticket summary
+* Review @ review link
+
 # Update a review
 
 Modify the previous commit diff:
 
-    git commit -a -amend
+    git add <file>
+    git commit --amend
 
-    ... Update a file ...
+Update the review:
 
-    [master 9c7c7af] HUE-2123 [beeswax] Handle cancel state properly
+    rbt post -u -r <Review-board-id> HEAD~1..HEAD
 
-    3 files changed, 10 insertions(+), 4 deletions(-)
+* Again, goto the review link and varify details & press publish.
 
+# Ship It
 
-Update the review:
+Once we get ship it from at least one reviewer, we can push the changes to master
 
-    rbt post -u -r 6092 HEAD~1..HEAD
+    git rebase origin/master
+    git push origin HEAD:ci-commit-master-<yourname>
 
-    Review request #6092 posted.
+* The push will auto run the tests and push it to master
+* Must see testing running @https://circleci.com/gh/cloudera/workflows/hue
+  * Two builds would be made - One for Python 2.7 and another for Python 3.6
+  * If successful, the change would be auto merged to master
+  * On failure, we will get a mail
+  * Runs usually take 10-20 min
+* Once merged mark the review as submitted - **Close > Submitted**
+* Add the commit link to the ticket and mark it as resolved
 
-# Sump-up
+**Note**:
+
+For lightweight issues, Github [pull requests](https://github.com/cloudera/hue/pulls) are also welcomed! To learn how pull request works please refer this [link](https://github.com/asmeurer/git-workflow).
 
-We hope that Review Board and these commands will make your life easier and encourage you to <a href="https://github.com/cloudera/hue/wiki/Contribute-to-HUE" target="_blank" rel="noopener noreferrer">contribute to Hue</a> 😉
+# Sump-up
 
-As usual feel free to send feedback on the [hue-user][1] list or [@gethue][2]!
+We hope that Review Board and these commands will make your life easier and encourage you to [contribute to Hue](https://github.com/cloudera/hue/blob/master/CONTRIBUTING.md) 😉
 
- [1]: http://groups.google.com/a/cloudera.org/group/hue-user
- [2]: https://twitter.com/gethue
+As usual feel free to send feedback on the [hue-user](http://groups.google.com/a/cloudera.org/group/hue-user) list or [@gethue](https://twitter.com/gethue)!