SlideShare a Scribd company logo
1 of 33
Download to read offline
Code Reviews
vs.
Merge Requests
- Continuous Code Review
Why Phabricator
• Tool is not our focus today, process is
• Gitflow (gitlab, github) is not TBD friendly
• Use PR/MR for (post-commit) pre-push code
review is hard
Why Code Review
It’s not just for catching bugs …
Efficiency
But
How to do it more efficiently …
Large Diffs Hurts (I)
• Large diffs won’t get reviewed
✴ It’s hard to spot bugs in large diffs
src: http://blogs.atlassian.com/2011/07/creating_optimal_reviews/
Large Diffs Hurts (II)
• Large diffs won’t get reviewed
✴ It’s hard to spot bugs in large diffs
• Reverting large diffs is hard
src: https://medium.com/@kurtisnusbaum/large-diffs-are-hurting-your-ability-to-ship-
e0b2b41e8acf#.3l2trqfsr
git commit -m "fixed issue with fan" [Pull Request code review]
Large Diffs Hurts (III)
• Large diffs won’t get reviewed
• It’s hard to spot bugs in large diffs
• Reverting large diffs is hard
• Rebasing/merging large diffs is error-prone
TBD
The Right Direction
Avoid overloading
• concise – don’t let cruft get in the way
• contained – if there are two parts, create two
reviews
• guided – tell people how to review it
The Right Direction
Avoid overcrowding
• selected with care – don’t blindly choose reviewers
• focused – if its a specialist change, choose a
specialist dev
• guided – tell people individually what they should
look out for
Arc Workflow
git co -b <branchname>
<edit edit edit>
git commit
arc diff --rr reviewer1,reviewer2 [--cc person3] --verbatim
<edit based on review feedback>
git commit
arc diff
<maybe run git pull if you want some updates>
<edit + commit + arc diff some more>
arc land
Arc Workflow
<edit edit edit> # No new branch
git commit
arc diff --rr reviewer1,reviewer2 [--cc person3] --verbatim
<edit based on review feedback>
git commit
arc diff
<maybe run git pull if you want some updates>
<edit + commit + arc diff some more>
arc amend
git push
Code Review vs. Push
• Differential: Pre-push code review
• Diffusion/Audit: Post-push audit (non-blocking)
• User Guide: Review vs Audit
Post-push Audit
<edit edit edit>
git commit
# put 'Auditors: foo,bar,baz' in the commit message
git push
Fix the foobaz test now that we no longer frob our foos.
I can't believe I forgot to run this test when I changed the
foo-frobbing code!
Auditors: chris, james
Test plan:
tools/runtests.py foobaz_test.py
Rebase vs Merge
• The major benefit of rebasing is that you get a much cleaner
project history. First, it eliminates the unnecessary merge commits
required by git merge. Second, as you can see in the above
diagram, rebasing also results in a perfectly linear project history
—you can follow the tip of feature all the way to the beginning of
the project without any forks. This makes it easier to navigate your
project with commands like git log, git bisect, and gitk.
• But, there are two trade-offs for this pristine commit history: safety
and traceability. If you don’t follow the Golden Rule of Rebasing,
re-writing project history can be potentially catastrophic for your
collaboration workflow. And, less importantly, rebasing loses the
context provided by a merge commit—you can’t see when
upstream changes were incorporated into the feature.
Merge PR
• Branches
• Merge conflicts
• Guitar Hero
Rebase
• linearized, rebased, fast-forward commits is the
default behavior of Phabricator.
Benefits
code evolution history
vs
commit logs
Import Gitlab Repo
Community Resources
Arcanist-support: additional testing and linting engines
• SBTTestEngine: Runs unit tests for Scala using SBT
• Scalastyle Lint Engine: Runs Scalastyle linter
Phabricator Jenkins Plugin
• Integrates with Phabricator's Differential and
Harbormaster apps
Jenkins Integration
Current Workflow
Diff Build
Diff by Commit vs master
Other Usage Examples
Test plan of a diff:
• https://secure.phabricator.com/D16974
Phab TBD vs wikimedia branches model:
• https://secure.phabricator.com/source/libphutil/repository/master/
• https://phabricator.wikimedia.org/diffusion/ECOE/repository/master/
Diff with feature-toggle example:
• https://secure.phabricator.com/D17200
Use Phab wiki for release note example:
• https://secure.phabricator.com/w/changelog/2016.49/
Phabricator vs. GitHub vs.
Atlassian
• https://rekinyz.wordpress.com/2015/01/18/
phabricator/
Goal
• Test driven
• Code review small and early
• Test before delivery
• Continuous Improvement
Reference
• Writing Reviewable Code (Facebook)!!
• Pull Requests vs Code Reviews
• Branch recommendation in Phabricator
• Using phabricator guide [khanacademy]
• Phabricator Project Mgmt Example

More Related Content

What's hot

Writing clean and maintainable code
Writing clean and maintainable codeWriting clean and maintainable code
Writing clean and maintainable codeMarko Heijnen
 
CI and CD with Jenkins
CI and CD with JenkinsCI and CD with Jenkins
CI and CD with JenkinsMartin Málek
 
Introduction to Git and GitHub Part 1
Introduction to Git and GitHub Part 1Introduction to Git and GitHub Part 1
Introduction to Git and GitHub Part 1Omar Fathy
 
Git branching strategies
Git branching strategiesGit branching strategies
Git branching strategiesjstack
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notesglen_a_smith
 
Using GitLab CI
Using GitLab CIUsing GitLab CI
Using GitLab CIColCh
 
What is agile model?Working of agile model
What is agile model?Working of agile modelWhat is agile model?Working of agile model
What is agile model?Working of agile modelzoomers
 
What's New for GitLab CI/CD February 2020
What's New for GitLab CI/CD February 2020What's New for GitLab CI/CD February 2020
What's New for GitLab CI/CD February 2020Noa Harel
 
Introducing GitLab (September 2018)
Introducing GitLab (September 2018)Introducing GitLab (September 2018)
Introducing GitLab (September 2018)Noa Harel
 
Git and git workflow best practice
Git and git workflow best practiceGit and git workflow best practice
Git and git workflow best practiceMajid Hosseini
 
Git Series. Episode 3. Git Flow and Github-Flow
Git Series. Episode 3. Git Flow and Github-FlowGit Series. Episode 3. Git Flow and Github-Flow
Git Series. Episode 3. Git Flow and Github-FlowMikhail Melnik
 
Azure DevOps Presentation
Azure DevOps PresentationAzure DevOps Presentation
Azure DevOps PresentationInCycleSoftware
 
CICD Pipeline Using Github Actions
CICD Pipeline Using Github ActionsCICD Pipeline Using Github Actions
CICD Pipeline Using Github ActionsKumar Shìvam
 
LeSS (Large Scale Scrum) in 10 Slides
LeSS (Large Scale Scrum) in 10 SlidesLeSS (Large Scale Scrum) in 10 Slides
LeSS (Large Scale Scrum) in 10 SlidesAgileSparks
 
Introduction to github slideshare
Introduction to github slideshareIntroduction to github slideshare
Introduction to github slideshareRakesh Sukumar
 

What's hot (20)

Git & GitLab
Git & GitLabGit & GitLab
Git & GitLab
 
Writing clean and maintainable code
Writing clean and maintainable codeWriting clean and maintainable code
Writing clean and maintainable code
 
CI and CD with Jenkins
CI and CD with JenkinsCI and CD with Jenkins
CI and CD with Jenkins
 
Introduction to Git and GitHub Part 1
Introduction to Git and GitHub Part 1Introduction to Git and GitHub Part 1
Introduction to Git and GitHub Part 1
 
Git basics
Git basicsGit basics
Git basics
 
Git branching strategies
Git branching strategiesGit branching strategies
Git branching strategies
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notes
 
Using GitLab CI
Using GitLab CIUsing GitLab CI
Using GitLab CI
 
What is agile model?Working of agile model
What is agile model?Working of agile modelWhat is agile model?Working of agile model
What is agile model?Working of agile model
 
What's New for GitLab CI/CD February 2020
What's New for GitLab CI/CD February 2020What's New for GitLab CI/CD February 2020
What's New for GitLab CI/CD February 2020
 
Introducing GitLab (September 2018)
Introducing GitLab (September 2018)Introducing GitLab (September 2018)
Introducing GitLab (September 2018)
 
Git and git workflow best practice
Git and git workflow best practiceGit and git workflow best practice
Git and git workflow best practice
 
Git Series. Episode 3. Git Flow and Github-Flow
Git Series. Episode 3. Git Flow and Github-FlowGit Series. Episode 3. Git Flow and Github-Flow
Git Series. Episode 3. Git Flow and Github-Flow
 
Azure DevOps Presentation
Azure DevOps PresentationAzure DevOps Presentation
Azure DevOps Presentation
 
CICD Pipeline Using Github Actions
CICD Pipeline Using Github ActionsCICD Pipeline Using Github Actions
CICD Pipeline Using Github Actions
 
LeSS (Large Scale Scrum) in 10 Slides
LeSS (Large Scale Scrum) in 10 SlidesLeSS (Large Scale Scrum) in 10 Slides
LeSS (Large Scale Scrum) in 10 Slides
 
Azure Pipelines
Azure PipelinesAzure Pipelines
Azure Pipelines
 
CI/CD with Github Actions
CI/CD with Github ActionsCI/CD with Github Actions
CI/CD with Github Actions
 
git and github
git and githubgit and github
git and github
 
Introduction to github slideshare
Introduction to github slideshareIntroduction to github slideshare
Introduction to github slideshare
 

Similar to Code review vs pull request

Git and Github slides.pdf
Git and Github slides.pdfGit and Github slides.pdf
Git and Github slides.pdfTilton2
 
Git and Github workshop ppt slide by slide
Git and Github workshop ppt slide by slideGit and Github workshop ppt slide by slide
Git and Github workshop ppt slide by slideRaghavendraVattikuti1
 
Git interview questions | Edureka
Git interview questions | EdurekaGit interview questions | Edureka
Git interview questions | EdurekaEdureka!
 
Git essential training & sharing self
Git essential training & sharing selfGit essential training & sharing self
Git essential training & sharing selfChen-Tien Tsai
 
Introduction to Git, DrupalCamp LA 2015
Introduction to Git, DrupalCamp LA 2015Introduction to Git, DrupalCamp LA 2015
Introduction to Git, DrupalCamp LA 2015mwrather
 
devops-complete-notes-2.pdf
devops-complete-notes-2.pdfdevops-complete-notes-2.pdf
devops-complete-notes-2.pdfRobinRohit2
 
Beginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitBeginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitRobert Lee-Cann
 
Git from the trenches
Git from the trenchesGit from the trenches
Git from the trenchesNuno Caneco
 
True Git: The Great Migration
True Git: The Great MigrationTrue Git: The Great Migration
True Git: The Great Migrationcolleenfry
 
Git, GitHub and Open Source
Git, GitHub and Open SourceGit, GitHub and Open Source
Git, GitHub and Open SourceLorna Mitchell
 
Version control git day02
Version control   git day02Version control   git day02
Version control git day02Gourav Varma
 
Gitlab for PHP developers (Brisbane PHP meetup, 2019-Jan-29)
Gitlab for PHP developers (Brisbane PHP meetup, 2019-Jan-29)Gitlab for PHP developers (Brisbane PHP meetup, 2019-Jan-29)
Gitlab for PHP developers (Brisbane PHP meetup, 2019-Jan-29)Vladimir Roudakov
 

Similar to Code review vs pull request (20)

3 Git
3 Git3 Git
3 Git
 
Git and Github slides.pdf
Git and Github slides.pdfGit and Github slides.pdf
Git and Github slides.pdf
 
Git and Github workshop ppt slide by slide
Git and Github workshop ppt slide by slideGit and Github workshop ppt slide by slide
Git and Github workshop ppt slide by slide
 
Git interview questions | Edureka
Git interview questions | EdurekaGit interview questions | Edureka
Git interview questions | Edureka
 
Git essential training & sharing self
Git essential training & sharing selfGit essential training & sharing self
Git essential training & sharing self
 
Working with Git
Working with GitWorking with Git
Working with Git
 
Introduction to Git, DrupalCamp LA 2015
Introduction to Git, DrupalCamp LA 2015Introduction to Git, DrupalCamp LA 2015
Introduction to Git, DrupalCamp LA 2015
 
devops-complete-notes-2.pdf
devops-complete-notes-2.pdfdevops-complete-notes-2.pdf
devops-complete-notes-2.pdf
 
Beginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitBeginner's Guide to Version Control with Git
Beginner's Guide to Version Control with Git
 
Git from the trenches
Git from the trenchesGit from the trenches
Git from the trenches
 
Switching to Git
Switching to GitSwitching to Git
Switching to Git
 
True Git: The Great Migration
True Git: The Great MigrationTrue Git: The Great Migration
True Git: The Great Migration
 
Git, GitHub and Open Source
Git, GitHub and Open SourceGit, GitHub and Open Source
Git, GitHub and Open Source
 
Version control git day02
Version control   git day02Version control   git day02
Version control git day02
 
Working with Git
Working with GitWorking with Git
Working with Git
 
Gitlab for PHP developers (Brisbane PHP meetup, 2019-Jan-29)
Gitlab for PHP developers (Brisbane PHP meetup, 2019-Jan-29)Gitlab for PHP developers (Brisbane PHP meetup, 2019-Jan-29)
Gitlab for PHP developers (Brisbane PHP meetup, 2019-Jan-29)
 
GitHub Event.pptx
GitHub Event.pptxGitHub Event.pptx
GitHub Event.pptx
 
Git 1
Git 1Git 1
Git 1
 
git Technologies
git Technologiesgit Technologies
git Technologies
 
Flow
FlowFlow
Flow
 

Recently uploaded

UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfRTS corp
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfkalichargn70th171
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingShane Coughlan
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxRTS corp
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Rob Geurden
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonApplitools
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencessuser9e7c64
 
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop SlidesIntroduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slidesvaideheekore1
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLionel Briand
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingOpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingShane Coughlan
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesKrzysztofKkol1
 

Recently uploaded (20)

UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conference
 
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop SlidesIntroduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slides
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and Repair
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingOpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
 

Code review vs pull request

  • 1. Code Reviews vs. Merge Requests - Continuous Code Review
  • 2. Why Phabricator • Tool is not our focus today, process is • Gitflow (gitlab, github) is not TBD friendly • Use PR/MR for (post-commit) pre-push code review is hard
  • 3. Why Code Review It’s not just for catching bugs …
  • 5. But How to do it more efficiently …
  • 6. Large Diffs Hurts (I) • Large diffs won’t get reviewed ✴ It’s hard to spot bugs in large diffs
  • 7.
  • 9. Large Diffs Hurts (II) • Large diffs won’t get reviewed ✴ It’s hard to spot bugs in large diffs • Reverting large diffs is hard src: https://medium.com/@kurtisnusbaum/large-diffs-are-hurting-your-ability-to-ship- e0b2b41e8acf#.3l2trqfsr
  • 10. git commit -m "fixed issue with fan" [Pull Request code review]
  • 11. Large Diffs Hurts (III) • Large diffs won’t get reviewed • It’s hard to spot bugs in large diffs • Reverting large diffs is hard • Rebasing/merging large diffs is error-prone
  • 12.
  • 13. TBD
  • 14. The Right Direction Avoid overloading • concise – don’t let cruft get in the way • contained – if there are two parts, create two reviews • guided – tell people how to review it
  • 15. The Right Direction Avoid overcrowding • selected with care – don’t blindly choose reviewers • focused – if its a specialist change, choose a specialist dev • guided – tell people individually what they should look out for
  • 16. Arc Workflow git co -b <branchname> <edit edit edit> git commit arc diff --rr reviewer1,reviewer2 [--cc person3] --verbatim <edit based on review feedback> git commit arc diff <maybe run git pull if you want some updates> <edit + commit + arc diff some more> arc land
  • 17. Arc Workflow <edit edit edit> # No new branch git commit arc diff --rr reviewer1,reviewer2 [--cc person3] --verbatim <edit based on review feedback> git commit arc diff <maybe run git pull if you want some updates> <edit + commit + arc diff some more> arc amend git push
  • 18. Code Review vs. Push • Differential: Pre-push code review • Diffusion/Audit: Post-push audit (non-blocking) • User Guide: Review vs Audit
  • 19. Post-push Audit <edit edit edit> git commit # put 'Auditors: foo,bar,baz' in the commit message git push Fix the foobaz test now that we no longer frob our foos. I can't believe I forgot to run this test when I changed the foo-frobbing code! Auditors: chris, james Test plan: tools/runtests.py foobaz_test.py
  • 20. Rebase vs Merge • The major benefit of rebasing is that you get a much cleaner project history. First, it eliminates the unnecessary merge commits required by git merge. Second, as you can see in the above diagram, rebasing also results in a perfectly linear project history —you can follow the tip of feature all the way to the beginning of the project without any forks. This makes it easier to navigate your project with commands like git log, git bisect, and gitk. • But, there are two trade-offs for this pristine commit history: safety and traceability. If you don’t follow the Golden Rule of Rebasing, re-writing project history can be potentially catastrophic for your collaboration workflow. And, less importantly, rebasing loses the context provided by a merge commit—you can’t see when upstream changes were incorporated into the feature.
  • 21. Merge PR • Branches • Merge conflicts • Guitar Hero
  • 22. Rebase • linearized, rebased, fast-forward commits is the default behavior of Phabricator.
  • 25. Community Resources Arcanist-support: additional testing and linting engines • SBTTestEngine: Runs unit tests for Scala using SBT • Scalastyle Lint Engine: Runs Scalastyle linter Phabricator Jenkins Plugin • Integrates with Phabricator's Differential and Harbormaster apps
  • 29. Diff by Commit vs master
  • 30. Other Usage Examples Test plan of a diff: • https://secure.phabricator.com/D16974 Phab TBD vs wikimedia branches model: • https://secure.phabricator.com/source/libphutil/repository/master/ • https://phabricator.wikimedia.org/diffusion/ECOE/repository/master/ Diff with feature-toggle example: • https://secure.phabricator.com/D17200 Use Phab wiki for release note example: • https://secure.phabricator.com/w/changelog/2016.49/
  • 31. Phabricator vs. GitHub vs. Atlassian • https://rekinyz.wordpress.com/2015/01/18/ phabricator/
  • 32. Goal • Test driven • Code review small and early • Test before delivery • Continuous Improvement
  • 33. Reference • Writing Reviewable Code (Facebook)!! • Pull Requests vs Code Reviews • Branch recommendation in Phabricator • Using phabricator guide [khanacademy] • Phabricator Project Mgmt Example