diff --git a/hol/04_Review-code.md b/hol/04_Review-code.md new file mode 100644 index 0000000..8523b32 --- /dev/null +++ b/hol/04_Review-code.md @@ -0,0 +1,87 @@ +# 🔨 Hands-on: Review code + +## Open pull the request and add a single comment + +> **Note:** +> This part is done in the repo of your execise partner! +> + +1. Open the PR of your partner - you should have received a notification. +2. Go to the `Filles changed` tab and click line 78. Drag the mous to line 79 - this will select two lines. +3. Add a `suggestion` and increase the decrement to 0.006: + +image + +## Incorporate the changes and set PR to autocomplete + +> **Note:** +> This part is done in YOUR repo! +> + +1. Go back to your repo and wait for your partner to complete the comment with the suggestion. +2. Open `Commit suggestion` and verify the commit message title and body. Click `Commit changes`: + +image + +3. Note that the commit shows up under `commit` tab and contains your partner as a co-commiter: + +image + +4. Now set `Enable auto-merge` to `Squash and merge` and enable it: + +image + +5. Verify the commit message with all changes and the co-author information and confirm the auto-merge: + +image + +6. Check that **auto-merge** is enabled and head over to the repo of your partner: + +image + +## Review + +> **Note:** +> This part is done in the repo of your execise partner! +> + +1. Open the PR again and note that the changes you had suggested are now visible. Add a new comment and this time start a review: + +image + +2. You could add multiple comments and the indicator on the top of the PR will increase. If ready, finish the review and approve it: + +image + +3. Note that the PR gets automatically merged after you have approved the PR. Also the branch was deleted automatically. + +image + + +## Clean up + +Verify that your own pull request is also merged. Go back to your command line and clean up your local repo: + +Switch to the main branch: `git switch main` +Pull the changes with `--prune` or `-p` to delete branches do not longer exist: + +```console +$ git switch main +> Switched to branch 'main' +> Your branch is behind 'origin/main' by 2 commits, and can be fast-forwarded. + (use "git pull" to update your local branch) + +$ pull --prune +> From https://github.com/wulfland/GitHubBootcamp +> - [deleted] (none) -> origin/users/wulfland/1_fix-game +> remote: Enumerating objects: 20, done. +> remote: Counting objects: 100% (20/20), done. +> remote: Compressing objects: 100% (14/14), done. +> remote: Total 14 (delta 10), reused 0 (delta 0), pack-reused 0 +> Unpacking objects: 100% (14/14), 3.15 KiB | 247.00 KiB/s, done. +> bbc4b93..57023b8 main -> origin/main +> Updating d7076e3..57023b8 +> Fast-forward + docs/index.html | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) +```