BM: Baca dalam Bahasa Melayu
World 5: Teamwork
Kind, useful code review
You will learn: how to comment, suggest, approve or ask for changes, kindly.
The problem
Mei asks you to review her code. You spot a problem. How do you say it without hurting her? Kind and useful, or needs work?
Swipe right for good, left for needs work. Or use the buttons.
This is wrong. Redo it.
Watch
A code review: Reading a teammate's changes before they join main, then commenting, approving or asking for changes. ends with one of three choices: comment, approve or request changes. Sort each review.
Drag a card into a box. Or tap the card, then tap the box.
Try it
Mei typed “Wellcome”. A suggested change: A review comment that shows the exact new line. The author can apply it with one click. shows the exact fix. Mei can apply it with one click. Suggest the fix on that line.
Hint
Tap the “Wellcome” line. Press “Suggest a change”. Fix the word inside the box, then add the comment.Predict
You request changes. The branch rule needs one approval. Can Mei merge now?
Pick one answer.
Try it
Mei applied your suggestion. Check Files changed. Happy? Then approve it.
- Mmei
Adds a big welcome line to the home page.
- You asked for changes
Small typo in the title. See my suggestion.
- mei
Fixed with your suggestion. Thanks!
- Passed test
- A reviewer asked for changes. Fix those first.
Hint
In “Your review”, pick Approve, then press Submit review.Check
Put a good review in order. First step at the top.
First step at the top. Put these in order. Use the arrows, or drag.
- Leave comments on lines
- Read the PR description
- Submit: comment, approve or request changes
- Look through Files changed
You did it!
You can now give code reviews that are kind and useful.
Go deeper (optional)
On the real site, you can start a review and add many line comments. They all go out together when you submit. After fixing things, the author can ask you to review again. Some repos drop old approvals when new commits arrive. Golden rule: review the code, never the coder.
Bahasa Melayu
Mei minta anda review kodnya. Anda nampak satu masalah. Macam mana nak cakap tanpa sakitkan hati dia? Baik dan berguna, atau perlu baiki?
Code review (semakan kod) ada tiga pengakhiran: komen, luluskan atau minta perubahan. Susun setiap review.
Mei tertaip “Wellcome”. Cadangan perubahan (suggested change) tunjuk pembaikan yang tepat. Mei boleh terima dengan satu klik. Cadangkan pembaikan pada baris itu.
Anda minta perubahan. Peraturan branch (cabang) perlukan satu kelulusan. Bolehkah Mei merge (cantum) sekarang?
Mei dah guna cadangan anda. Semak Fail yang berubah. Puas hati? Kemudian luluskan (approve).
Susun langkah review yang baik. Langkah pertama di atas.
Kini anda boleh beri code review yang baik dan berguna.
You finished this before. Practice is always welcome!
Official docs: About pull request reviews · Commenting on a pull request · Incorporating feedback in your pull request
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?