Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Pull Request, Make & Review

Pull Request, Make & Review

Discussion about Pull Request, Making and Reviewing them

Hyperjump Tech

April 18, 2024
Tweet

More Decks by Hyperjump Tech

Other Decks in Programming

Transcript

  1. Make great PR Review PR greatly - Reduce or prevent

    bug from being shipped - Ship faster
  2. Time is the cost Coding time Make PR Time Review

    PR Time Coding time Make PR Time Review PR Time
  3. 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.
  4. 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.
  5. 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).
  6. 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.
  7. 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.
  8. PR Review Make sure bug fix has tests! So that

    it won’t happen again in the future.
  9. 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
  10. 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?
  11. PR Review: Be polite and helpful - “This code sucks”

    - Explain how you think it could be better. - Add links to references if needed.