You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

QuakeCoRE Software Team has introduced code review policy as an effort for quality assurance and encourage increased interactions amongst team members.

Step-by-step guide

  1. DeveloperCreate a branch -> Edit -> Add/Commit/Push to the branch

    In the following, let's assume the developer "seb56" is making a small change to  "git_sim_pkg" repository.

    seb56@hypocentre /home/seb56/gm_sim_pkg :git checkout -b fix_hardcoded_python
    Switched to a new branch 'fix_hardcoded_python'

    https://www.atlassian.com/git/tutorials/using-branches


    Suppose the developer edited the file "setup_remote.sh.  The developer does "git add"  followed by "git commit".

    seb56@hypocentre /home/seb56/gm_sim_pkg/wrapper :git add setup_remote.sh
    seb56@hypocentre /home/seb56/gm_sim_pkg/wrapper :git commit -m "Replaced the hard-coded python path with a variable"
    [fix_hardcoded_python c2a7911] Replaced the hard-coded python path with a variable
     1 file changed, 2 insertions(+), 1 deletion(-)

    When the developer feels the code is ready, he/she does "git push" to the new branch.

    seb56@hypocentre /home/seb56/gm_sim_pkg/wrapper :git push origin fix_hardcoded_python
    Counting objects: 4, done.
    Delta compression using up to 32 threads.
    Compressing objects: 100% (4/4), done.
    Writing objects: 100% (4/4), 410 bytes | 0 bytes/s, done.
    Total 4 (delta 3), reused 0 (delta 0)
    remote: Resolving deltas: 100% (3/3), completed with 3 local objects.
    To github.com:ucgmsim/gm_sim_pkg.git
     * [new branch]      fix_hardcoded_python -> fix_hardcoded_python
    
    
  2. Developer : Go to github repository and make a pull request. Specify a reviewer. The reviewer can be an expert or a team member who wishes to learn more about the code base.

    Go to Github, and notice the new branch that you created. Click Compare & pull request.



    Enter the description of the code change and specify the reviewer. In this example, "dlagrava" is selected.



    Before clicking Create pull request, scroll down and have a good look at your code change. If you're happy, make a pull request.





    The developer will be presented a new page from Pull requests tab.





    Reviewer : The reviewer receives an email requesting the review. He/she can view the code changes, and make an comment line by line. If the reviewer is happy with all the changes, he can "approve" the code.

    "dlagrava" visits the pull request page. The reviewer clicks the link to start the review.


    Click Add your review



    The reviewer can click Review changes to comment/approve or request changes.


    If the reviewer wishes to make a specific comment for a certain line of code, click +   in the begging of the line and leave a comment and click Add single comment, this will immediately send an email to the developer.



    Alternatively, if the reviewer wishes to make multiple comments, he/she may click Start a review, which will place the comment in "Pending" state, and after all comments have been made, the reviewer can click Finish your review to send the whole collection of comments in a single email.

     

    The reviewer can finalize the review by clicking Submit review with 3 options - Comment, Approve and Request changes.




  3. Admin (Reviewer) : The repository admin (most of the time, the reviewer will function as the admin) will "Merge the pull request".
  4. Developer : Remove the branch unless the branch needs to be kept.

 

https://help.github.com/articles/about-pull-requests/

https://help.github.com/articles/merging-a-pull-request/

 

 

  • No labels