SlideShare une entreprise Scribd logo
1  sur  31
Télécharger pour lire hors ligne
How to review a Pull Request
LGTM @rouanw
Why have PRs at
all?
- An opportunity to have a
conversation alongside the
code
- Supports our flexible,
asynchronous culture
How to review a Pull Request
LGTM
How to get a
useful review But first...
How to get a useful review
● Story kickoffs
● Talk to each other about what you’re working on
● Encourage pairing where feasible
● Codify your team’s standards where possible e.g. ESLint, .editorconfig
● Find opportunities to discuss your team’s design outlook / rules of thumb
/ accepted approaches
● Review your own PRs
● Read other people’s PR reviews
● Open a PR that’s easy to review
Meaningful name
Meaningful branch name
Say why we’re making the change
Link to a ticket, other relevant resources or
PRs
List what PR does / changes
Screenshots of UI changes
Call out tradeoffs you’re aware of, ask questions and call
out points for discussion
Small, specific PRs
Describe approach
How to review a Pull Request
LGTM
What does LGTM mean?
Can’t see anything wrong with this?
Not sure what this is about, but it doesn’t get in my way?
This is the right thing?
Form an opinion
😀😰😕🙀🥳🤯
● Be clear on your expectations
● Do I like this feature?
● What approaches would I have considered? Which would I prefer?
● Am I worried about anything?
● What is the impact of this change on our team (e.g. support), product (e.g.
usage), business (e.g. money) and user (e.g. ease of use)?
These opinions don’t have to be the same when
you’re done reviewing the PR
Read through the PR to understand:
● Intent of the person
● The approach being used
● Overall shape of the changes. More server or more UI? Are there new
libraries in package.json? Config changes? New database queries?
● Add comments as you go - use the GitHub review feature so comments
aren’t final. You can even use comments to ask yourself questions or
remind yourself to think about something.
Go through the PR again and add comments
Take
your
time.
Reviewing PRs is important.
READ the title and description
How much code has changed?
Match the changes to the PR description :)
The basics
Is the code:
1. Correct (look out for bugs)
2. Complete (think of cases it doesn’t handle)
3. Easy to understand (the harder a PR is to review, the more your review can help!)
4. Focused (does the code do too much?)
5. Well-tested
6. Well-enough documented (usually not a lot required, but may need something in the readme or team wiki)
Question things
If something strikes you as odd or stands out, give it some more thought:
● Why is it done in X way?
● How else could it be done?
● Does it need to be done at all?
Play with the code
Open an editor or the node interpreter
No file is an island
Think of the overall shape of the changes, not just the lines in front of you:
● Could a different design/approach make the code simpler to work with in
future?
● Remember that the answer to making the function you’re looking at
simpler is often in another file altogether!
Where are you?
Think of the design paradigm you’re in and its associated best practices, e.g.
● What is the conventional way to do X in React?
● What is the best way to do Y when using Postgres?
If things get sticky...
● Pull the code
● Run it locally
● Get on a call
Cross-cutting concerns
● Performance (e.g. is the new Mongo query covered by an existing index?
Are we making unnecessary calls to the database? Are we iterating over a
collection too many times?)
● Security (do we have the right permission checks?)
● Error handling, metrics & logging, auditing
● Devices and browsers: Internet explorer quirks, mobile UX
● Integration points: e.g. mobile app, data warehousing. Are you breaking
any contracts?
Think about the big picture
Is this the right approach/design?
Is this the right code base?
Is this the right feature?
Is this the right time?
Is this right for the product?
Does this support the business objectives?
Before you submit
● Take a step back and ask yourself again: does the PR make sense? Does
the feature make sense? Do the product goals make sense? (You know
more about this change set now than you ever will again.)
● Look at your PR review from the perspective of the person getting it. Have
you explained yourself clearly? Have you been kind and helpful?
● If you’re at all excited about hitting the green button, go make a cup of tea
Good PR comments
PRs are conversations with real people
Be kind Someone worked hard to put the
changes together.
Be honest.
● Leaving something important
unsaid will not help the
person in the long term.
● If you’re worried about how it
will make someone feel,
rather work on the way in
which you deliver the
feedback (e.g. maybe a public
GitHub review isn’t the right
thing).
Be restrained.
Think carefully about your
comments before making them. Is
this PR the right place to rant
about redux? Would using
currying or ES6 classes really
improve the code (even though
you think they’re awesome right
now)?
Be helpful.
● Offer people concrete steps
they can take to improve their
code - PR reviews should be
learning opportunities.
● Don’t just mention Mongo’s
index selectivity - add a link to
the relevant documentation
or a StackOverflow question.
Be positive. Remember to call out awesome
code and approaches too!
How to review a Pull Request
LGTM @rouanw

Contenu connexe

Tendances

2013 09-11 java zone - extreme programming live
2013 09-11 java zone - extreme programming live2013 09-11 java zone - extreme programming live
2013 09-11 java zone - extreme programming live
Johannes Brodwall
 

Tendances (8)

Code reviews
Code reviewsCode reviews
Code reviews
 
Programming the Programmer
Programming the ProgrammerProgramming the Programmer
Programming the Programmer
 
2013 09-11 java zone - extreme programming live
2013 09-11 java zone - extreme programming live2013 09-11 java zone - extreme programming live
2013 09-11 java zone - extreme programming live
 
Engineering career is not a single ladder! - Alternative pathway to develope...
Engineering career is not a single ladder!  - Alternative pathway to develope...Engineering career is not a single ladder!  - Alternative pathway to develope...
Engineering career is not a single ladder! - Alternative pathway to develope...
 
How to Quickly Improve the Writing in Your Proposals
How to Quickly Improve the Writing in Your ProposalsHow to Quickly Improve the Writing in Your Proposals
How to Quickly Improve the Writing in Your Proposals
 
[#DevRelAsia Keynote 2020] Developer Centric Design for Better Experience
[#DevRelAsia Keynote 2020] Developer Centric Design for Better Experience[#DevRelAsia Keynote 2020] Developer Centric Design for Better Experience
[#DevRelAsia Keynote 2020] Developer Centric Design for Better Experience
 
Things I wished I knew while doing my tech bachelor / undergraduate
Things I wished I knew while doing my tech bachelor / undergraduateThings I wished I knew while doing my tech bachelor / undergraduate
Things I wished I knew while doing my tech bachelor / undergraduate
 
Master Class: Secrets To A Cohesive PPC Campaign
Master Class: Secrets To A Cohesive PPC CampaignMaster Class: Secrets To A Cohesive PPC Campaign
Master Class: Secrets To A Cohesive PPC Campaign
 

Similaire à How to review a pull request

UX class presentation
UX class presentationUX class presentation
UX class presentation
Theo V
 

Similaire à How to review a pull request (20)

Copywriting for UX
Copywriting for UXCopywriting for UX
Copywriting for UX
 
Hidden sides of Code Review (Do-iOS)
Hidden sides of Code Review (Do-iOS)Hidden sides of Code Review (Do-iOS)
Hidden sides of Code Review (Do-iOS)
 
What Are the Basics of Product Manager Interviews by Google PM
What Are the Basics of Product Manager Interviews by Google PMWhat Are the Basics of Product Manager Interviews by Google PM
What Are the Basics of Product Manager Interviews by Google PM
 
Software Engineering Primer
Software Engineering PrimerSoftware Engineering Primer
Software Engineering Primer
 
Content In The Age of AI
Content In The Age of AIContent In The Age of AI
Content In The Age of AI
 
Why And How to Transition into Product Management by Google PM
Why And How to Transition into Product Management by Google PMWhy And How to Transition into Product Management by Google PM
Why And How to Transition into Product Management by Google PM
 
Implementing a Design System in a Small Team by SnapTravel
Implementing a Design System in a Small Team by SnapTravelImplementing a Design System in a Small Team by SnapTravel
Implementing a Design System in a Small Team by SnapTravel
 
UX class presentation
UX class presentationUX class presentation
UX class presentation
 
How to Manage Open Source Product by Github Sr. PM
How to Manage Open Source Product by Github Sr. PMHow to Manage Open Source Product by Github Sr. PM
How to Manage Open Source Product by Github Sr. PM
 
Best Practices in Software Development
Best Practices in Software DevelopmentBest Practices in Software Development
Best Practices in Software Development
 
DevOps, Performance Optimization and the Green Life with Magento
DevOps, Performance Optimization and the Green Life with MagentoDevOps, Performance Optimization and the Green Life with Magento
DevOps, Performance Optimization and the Green Life with Magento
 
SEO optimization techniques for digital marketing professionals
SEO optimization techniques for digital marketing professionalsSEO optimization techniques for digital marketing professionals
SEO optimization techniques for digital marketing professionals
 
Biz Product Learnings
Biz Product LearningsBiz Product Learnings
Biz Product Learnings
 
Machine Learning Product Managers Meetup Event
Machine Learning Product Managers Meetup EventMachine Learning Product Managers Meetup Event
Machine Learning Product Managers Meetup Event
 
The Agile PMO (fall 2014 version)
The Agile PMO (fall 2014 version)The Agile PMO (fall 2014 version)
The Agile PMO (fall 2014 version)
 
The Road to DITA
The Road to DITAThe Road to DITA
The Road to DITA
 
Agile Prototyping Best Practices
Agile Prototyping Best PracticesAgile Prototyping Best Practices
Agile Prototyping Best Practices
 
The Role of IT Architect in Startup Company
The Role of IT Architect in Startup CompanyThe Role of IT Architect in Startup Company
The Role of IT Architect in Startup Company
 
The role of an IT architect in startups
The role of an IT architect in startupsThe role of an IT architect in startups
The role of an IT architect in startups
 
How i got interviews at google, facebook, and bridgewater (tech version)
How i got interviews at google, facebook, and bridgewater (tech version)How i got interviews at google, facebook, and bridgewater (tech version)
How i got interviews at google, facebook, and bridgewater (tech version)
 

Plus de rouanw

Plus de rouanw (20)

NDC Security 2023
NDC Security 2023NDC Security 2023
NDC Security 2023
 
Is this okay!? DevSecCon ⚡ 2022
Is this okay!? DevSecCon ⚡ 2022Is this okay!? DevSecCon ⚡ 2022
Is this okay!? DevSecCon ⚡ 2022
 
Fail better with QA in Production
Fail better with QA in ProductionFail better with QA in Production
Fail better with QA in Production
 
Qa in production singular 2019
Qa in production   singular 2019Qa in production   singular 2019
Qa in production singular 2019
 
Rouan's design principles
Rouan's design principlesRouan's design principles
Rouan's design principles
 
The curious case of the production incident
The curious case of the production incidentThe curious case of the production incident
The curious case of the production incident
 
QA in Production: The tests we never wrote and the production monitoring we u...
QA in Production: The tests we never wrote and the production monitoring we u...QA in Production: The tests we never wrote and the production monitoring we u...
QA in Production: The tests we never wrote and the production monitoring we u...
 
Organised chaos: real-world JavaScript microservices
Organised chaos: real-world JavaScript microservicesOrganised chaos: real-world JavaScript microservices
Organised chaos: real-world JavaScript microservices
 
Contributing to open source is easier than you think
Contributing to open source is easier than you thinkContributing to open source is easier than you think
Contributing to open source is easier than you think
 
How to write a blog post
How to write a blog postHow to write a blog post
How to write a blog post
 
QA in Production
QA in ProductionQA in Production
QA in Production
 
Dashboards: Using data to find out what's really going on
Dashboards: Using data to find out what's really going onDashboards: Using data to find out what's really going on
Dashboards: Using data to find out what's really going on
 
Tech lead tips
Tech lead tipsTech lead tips
Tech lead tips
 
DevOps Culture
DevOps CultureDevOps Culture
DevOps Culture
 
Techniques for stress free software releases
Techniques for stress free software releasesTechniques for stress free software releases
Techniques for stress free software releases
 
Be a polyglot programmer
Be a polyglot programmerBe a polyglot programmer
Be a polyglot programmer
 
Emergent design - PHP Jo'burg 2015
Emergent design - PHP Jo'burg 2015Emergent design - PHP Jo'burg 2015
Emergent design - PHP Jo'burg 2015
 
Infrastructure as code
Infrastructure as codeInfrastructure as code
Infrastructure as code
 
ThoughtWorks Tech radar Jan 2014
ThoughtWorks Tech radar Jan 2014ThoughtWorks Tech radar Jan 2014
ThoughtWorks Tech radar Jan 2014
 
Continuous Integration
Continuous IntegrationContinuous Integration
Continuous Integration
 

Dernier

+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 

Dernier (20)

WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaS
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 

How to review a pull request

  • 1. How to review a Pull Request LGTM @rouanw
  • 2. Why have PRs at all? - An opportunity to have a conversation alongside the code - Supports our flexible, asynchronous culture
  • 3. How to review a Pull Request LGTM
  • 4. How to get a useful review But first...
  • 5. How to get a useful review ● Story kickoffs ● Talk to each other about what you’re working on ● Encourage pairing where feasible ● Codify your team’s standards where possible e.g. ESLint, .editorconfig ● Find opportunities to discuss your team’s design outlook / rules of thumb / accepted approaches ● Review your own PRs ● Read other people’s PR reviews ● Open a PR that’s easy to review
  • 6. Meaningful name Meaningful branch name Say why we’re making the change Link to a ticket, other relevant resources or PRs List what PR does / changes Screenshots of UI changes
  • 7. Call out tradeoffs you’re aware of, ask questions and call out points for discussion Small, specific PRs Describe approach
  • 8. How to review a Pull Request LGTM
  • 9. What does LGTM mean? Can’t see anything wrong with this? Not sure what this is about, but it doesn’t get in my way? This is the right thing?
  • 10. Form an opinion 😀😰😕🙀🥳🤯 ● Be clear on your expectations ● Do I like this feature? ● What approaches would I have considered? Which would I prefer? ● Am I worried about anything? ● What is the impact of this change on our team (e.g. support), product (e.g. usage), business (e.g. money) and user (e.g. ease of use)?
  • 11. These opinions don’t have to be the same when you’re done reviewing the PR
  • 12. Read through the PR to understand: ● Intent of the person ● The approach being used ● Overall shape of the changes. More server or more UI? Are there new libraries in package.json? Config changes? New database queries? ● Add comments as you go - use the GitHub review feature so comments aren’t final. You can even use comments to ask yourself questions or remind yourself to think about something.
  • 13. Go through the PR again and add comments Take your time. Reviewing PRs is important.
  • 14. READ the title and description
  • 15. How much code has changed? Match the changes to the PR description :)
  • 16. The basics Is the code: 1. Correct (look out for bugs) 2. Complete (think of cases it doesn’t handle) 3. Easy to understand (the harder a PR is to review, the more your review can help!) 4. Focused (does the code do too much?) 5. Well-tested 6. Well-enough documented (usually not a lot required, but may need something in the readme or team wiki)
  • 17. Question things If something strikes you as odd or stands out, give it some more thought: ● Why is it done in X way? ● How else could it be done? ● Does it need to be done at all?
  • 18. Play with the code Open an editor or the node interpreter
  • 19. No file is an island Think of the overall shape of the changes, not just the lines in front of you: ● Could a different design/approach make the code simpler to work with in future? ● Remember that the answer to making the function you’re looking at simpler is often in another file altogether!
  • 20. Where are you? Think of the design paradigm you’re in and its associated best practices, e.g. ● What is the conventional way to do X in React? ● What is the best way to do Y when using Postgres?
  • 21. If things get sticky... ● Pull the code ● Run it locally ● Get on a call
  • 22. Cross-cutting concerns ● Performance (e.g. is the new Mongo query covered by an existing index? Are we making unnecessary calls to the database? Are we iterating over a collection too many times?) ● Security (do we have the right permission checks?) ● Error handling, metrics & logging, auditing ● Devices and browsers: Internet explorer quirks, mobile UX ● Integration points: e.g. mobile app, data warehousing. Are you breaking any contracts?
  • 23. Think about the big picture Is this the right approach/design? Is this the right code base? Is this the right feature? Is this the right time? Is this right for the product? Does this support the business objectives?
  • 24. Before you submit ● Take a step back and ask yourself again: does the PR make sense? Does the feature make sense? Do the product goals make sense? (You know more about this change set now than you ever will again.) ● Look at your PR review from the perspective of the person getting it. Have you explained yourself clearly? Have you been kind and helpful? ● If you’re at all excited about hitting the green button, go make a cup of tea
  • 25. Good PR comments PRs are conversations with real people
  • 26. Be kind Someone worked hard to put the changes together.
  • 27. Be honest. ● Leaving something important unsaid will not help the person in the long term. ● If you’re worried about how it will make someone feel, rather work on the way in which you deliver the feedback (e.g. maybe a public GitHub review isn’t the right thing).
  • 28. Be restrained. Think carefully about your comments before making them. Is this PR the right place to rant about redux? Would using currying or ES6 classes really improve the code (even though you think they’re awesome right now)?
  • 29. Be helpful. ● Offer people concrete steps they can take to improve their code - PR reviews should be learning opportunities. ● Don’t just mention Mongo’s index selectivity - add a link to the relevant documentation or a StackOverflow question.
  • 30. Be positive. Remember to call out awesome code and approaches too!
  • 31. How to review a Pull Request LGTM @rouanw