Slide 1

Slide 1 text

Pull Request

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

Why Pull Request We want someone else to confirm that our code is acceptable.

Slide 5

Slide 5 text

Make great PR Review PR greatly - Reduce or prevent bug from being shipped - Ship faster

Slide 6

Slide 6 text

Time is the cost Coding time Make PR Time Review PR Time Coding time Make PR Time Review PR Time

Slide 7

Slide 7 text

Before Making & Reviewing PR Automate everything that can be automated to prevent wasteful argument within the team: - Use code formatter like Prettier. - Use linter. - Use generator. For example, prisma automatically generates the TypeScript types. - Use code analyser like Codescene or Sonarcloud.

Slide 8

Slide 8 text

Make PR: Link the ticket So that everyone can know what bug the PR will solve or what feature the PR will add. In the ticket, we can put the detailed information.

Slide 9

Slide 9 text

Make PR: Brief explanation what the PR is about To save reviewer’s time, briefly explain what the PR is about after or before mentioning the ticket. This PR resolves fixing the bug where user tries to login with wrong email or password (issue #123).

Slide 10

Slide 10 text

Make PR: Screenshots and/or videos! For the reviewer: Help to see the end result of the PR which can make it easier to make sense of the code. For the PR Author: Help to confirm that the changes actually does what it’s supposed to do.

Slide 11

Slide 11 text

Make PR: Step by step to test Describe the steps to correctly test/confirm the changes. So that the reviewer can reproduce and confirm the PR.

Slide 12

Slide 12 text

Make PR: Keep it small Keep the changes limited to the scope of the ticket.

Slide 13

Slide 13 text

PR Review See screenshots & videos to confirm that the PR actually does what it says.

Slide 14

Slide 14 text

PR Review Make sure bug fix has tests! So that it won’t happen again in the future.

Slide 15

Slide 15 text

PR Review Check if documentation exists! E.g., when adding new feature, is it documented.

Slide 16

Slide 16 text

PR Review Check function/method’s logic. Does it have tests? Function that has no dependencies to external source and not UI related must have tests. const isEven = (n: number) => n % 2 === 1

Slide 17

Slide 17 text

PR Review Check error handling. - Is there code that is executed when error happens?

Slide 18

Slide 18 text

PR Review Check edge cases. - E.g., a function repeats a piece of code as many times as the number entered by user. What happen if number is too large?

Slide 19

Slide 19 text

PR Review Check common mistakes - E.g., using useEffect when not needed.

Slide 20

Slide 20 text

PR Review: Be polite and helpful - “This code sucks” - Explain how you think it could be better. - Add links to references if needed.