Web Testing/Automation/CodeReviewProcess: Difference between revisions

m
no edit summary
(→‎How to do a merge?: Improved documentation, explaining a few things)
mNo edit summary
Line 17: Line 17:
You can't review your own code!
You can't review your own code!


== How to do a merge? ==
== How to do a merge? ==


Once a pull request ready to be pulled the following steps should be followed.  
Once a pull request ready to be pulled the following steps should be followed.  


*Make sure that you have a clone of the Mozilla repository on your local machine  
*Make sure that you have a clone of the Mozilla repository on your local machine  
*'''git branch ''pullrequest'''''<br>
*'''git branch ''pullrequest'''''<br>  
*'''This will create another branch (a working copy), called ''pullrequest'', with the code of the current branch)  
*This will create another branch (a working copy), called ''pullrequest'', with the code of the current branch)  
*'''git checkout '''''<b>pullrequest</b>'' ... for the impatient, '''git''' '''checkout -b ''pullrequest'''''<br>
*'''git checkout '''''<b>pullrequest</b>'' ... for the impatient, '''git''' '''checkout -b ''pullrequest'''''<br>
Switches to your new branch ''pullrequest''. The reason for doing it in a branch is if there are conflicts it won't break you local master. If you should indeed mess up your branch, you can always create a new branch off your ''master'' branch!<br>
 
Switches to your new branch ''pullrequest''. The reason for doing it in a branch is if there are conflicts it won't break you local master. If you should indeed mess up your branch, you can always create a new branch off your ''master'' branch!<br>  
 
*'''git remote add '''''<b>requestee requestee_git_fork_url</b>''  
*'''git remote add '''''<b>requestee requestee_git_fork_url</b>''  
*''This command will introduce your clone of the repository with the repository you want to merge with (most of the time, this is the mozilla repository). '''''Example:'''''<b>git </b>'''remote add'''''<b>mozilla</b>'' '''''https://github.com/mozilla/Addon-Tests.git''''' will save the Addon-Test repository under the short, and easy-to-remember name ''mozilla''.<br>
*''This command will introduce your clone of the repository with the repository you want to merge with (most of the time, this is the mozilla repository). '''''Example:'''''<b>git </b>'''remote add'''''<b>mozilla</b>'''https://github.com/mozilla/Addon-Tests.git'''''will save the Addon-Test repository under the short, and easy-to-remember name ''mozilla''.<br>''
*'''git fetch''' '''''requestee''''' '''&amp;&amp; git merge''' '''''requestee/pull_request_branch_on_their_fork'''''
*'''git fetch''' '''''requestee''''' '''&amp;&amp; git merge''' '''''requestee/pull_request_branch_on_their_fork'''''  
*Get the latest data from the remote repository 'mozilla' and integrate it with your current working branch. '''''Example:''''' '''git fetch ''mozilla'' &amp;&amp; git merge '''''<b>mozilla/master</b>'' will get all the stuff from the mozilla repository (1st step) and then merge the '''''master''''' branch of '''''mozilla''''' with the data of your branch, thus keeping it up-to-date!
*Get the latest data from the remote repository 'mozilla' and integrate it with your current working branch. '''''Example:''''' '''git fetch ''mozilla'' &amp;&amp; git merge '''''<b>mozilla/master</b>'' will get all the stuff from the mozilla repository (1st step) and then merge the '''''master''''' branch of '''''mozilla''''' with the data of your branch, thus keeping it up-to-date!  
*Run the tests  
*Run the tests  
**Sometimes good looking code doesn't actually work so lets prove it works!  
**Sometimes good looking code doesn't actually work so lets prove it works!  
**If, and only if, it passes do the next steps  
**If, and only if, it passes do the next steps  
*'''git checkout '''''<b>master (</b>''Switch to your ''master'' branch)''
*'''git checkout '''''<b>master (</b>''Switch to your ''master'' branch)  
*'''git merge '''''<b>pullrequest master</b>'' (Merge your branch (working copy)''pullrequest ''with the current master branch)<br>
*'''git merge '''''<b>pullrequest master</b>'' (Merge your branch (working copy)''pullrequest ''with the current master branch)<br>  
*'''git push ''origin master'''''(Push the changed stuff in your master branch back to your origin repository at github)
*'''git push ''origin master'''''(Push the changed stuff in your master branch back to your origin repository at github)  
*'''git branch -d '''''<b>pullrequest</b>''(Delete the working branch you created, as everything is now merged with your master branch)
*'''git branch -d '''''<b>pullrequest</b>'' (Delete the working branch you created, as everything is now merged with your master branch)


This will have it all stored in the remote master and you will have a clean version locally. Please **don't** use the merge button on GitHub. You **need** to verify that the merge works and that button can't do that for you!
This will have it all stored in the remote master and you will have a clean version locally. Please **don't** use the merge button on GitHub. You **need** to verify that the merge works and that button can't do that for you!
Confirmed users
182

edits