Welcome to the Code Review Exercise! This hands-on exercise will help you learn the code review process by experiencing it firsthand through a guided GitHub workflow.
Refer to this while performing your review
https://github.com/mgreiler/code-review-checklist
Below we are just getting things set up.
- In the top right click Fork (not forks in the About section)
- Click Create Fork
- Review the code in
src/CodeReviewTraining/OrderProcessor.cs - Using the online code editor, remove the commend at the top of the file. ONLY this comment, nothing else yet.
- Click Commit changes...
In this scenario, you just wrote
OrderProcessor.csand your team is about to perform a code review on it.
You think your code is ready so you create a PR (Pull Request)
Without making any changes yet, create a pull request from your branch to the main repository
- Click Pull requests from the top
- Click New Pull Request
- Click Create pull request
Now this is where you give your PR a good name and strong description.
- This screen shows you the diff of all the code in this PR.
- Click the green button Create pull request
- RIGHT HERE: Leave this page open, where it says "from..." open that in a new tab.
- Go back to the first tab and click Checks
- The GitHub Action will run and leave feedback about the failing tests
- Review the test failure details
After you made your PR, you noticed your code isn't passing all the tests. Before bugging your team to review the code, lets get the tests passing.
- Go back to the second tab (step 6 in previous)
- Navigate to
src/CodeReviewTraining/OrderProcessor.cs - Remove the commented out code that is causing the tests to fail. **ONLY REMOVE STEP 1, DON'T TOUCH STEP 2 YET"
- Don't just comment these out and move on, look at the reasoning why
- Once fixed, click Commit changes...
- Navigate back to the PR tab. You should see this new commit on there and the tests start to run again.
- If you don't see the new commit, make sure you are on the Conversation tab
Your tests are now passing but you need to address your code quality comments from your team. To view their comments look at the Files changed tab
- Go back to the second tab
- Navigate to
src/CodeReviewTraining/OrderProcessor.cs - Remove ALL the commented out code
- Don't just comment these out and move on, look at the reasoning why
- Once fixed, click Commit changes...
- Navigate back to the PR tab. You should see this new commit on there and the tests start to run again.
- If you don't see the new commit, make sure you are on the Conversation tab
Now your code is ready for a PR! All your tests are passing and your team thinks the code is maintainable.