SlideShare une entreprise Scribd logo
1  sur  17
Télécharger pour lire hors ligne
Mondrian:
Code Review on the Web
Nov 30, 2006
Open Source Speakers Series
Guido van Rossum
guido@google.com
11/30/06 2
What is Code Review?
• When one developer writes code, another
developer is asked to review that code
• A careful line-by-line critique
• Happens in a non-threatening context
• Goal is cooperation, not fault-finding
• Often an integral part of coding process
• Involuntary code review happens when
debugging someone else's broken code
– Not so good; emotions may flare
11/30/06 3
Benefits of Code Review
• Two pairs of eyes catch more bugs (duh)
– Catch 'em early to save hours of debugging
• Enforce coding standards, style guides
– Keep overall readability & code quality high
• Mentoring of new developers
– Learn from mistakes without breaking stuff
• Establish trust relationships
– Prepare for more delegation
• A good alternative to pair programming
11/30/06 4
Code Review in Open Source
• Author & reviewer on separate computers
• Author invokes "diff -u" to create patch file
• Author mails patch file to reviewer
– or uploads to e.g. SourceForge patch manager
• Reviewer uses "patch" to recreate the files
• They email back-and-forth a few times
• Finally, reviewer submits into svn/cvs/etc
– patch author often has no privileges (yet)
• process helps "vetting" new developers
11/30/06 5
Google's Development Process
• (In theory :-)
• Single company-wide Perforce (p4) depot
– No developer branches
• Company-wide NFS
– Developers workspaces accessibly by others
• All code reviewed before submission
– All code-review email logged for auditors
• Wrapper "g4" implements superset of "p4"
– Originally a shell script; now a Python program
11/30/06 6
Google's Code Review Process
• All command-line and email based:
1. Author edits changes in workspace, tests etc.
2. Author send email to reviewer (a tool helps)
3. Reviewer views the diff (another tool helps)
4. Reviewer sends mail back (regular mail reply)
5. Rinse and repeat (using regular mail replies)
6. When reviewer replies "lgtm", author submits
• lgtm = looks good to me
11/30/06 7
Original, Minimal Tools
• "g4 change" invoked by author defines set
of files involved, adding comments
• "g4 mail" sends form email to reviewer
– (also integrated with g4 change call)
• "g4 diff" invoked by reviewer diffs files
straight out of author's workspace
– "tkdiff" X11-based side-by-side differ
• "g4 reply" synthesizes reply mail
– optional; not used very much
11/30/06 8
Problems With Old Process
• VPN usage (reviewers working from home)
– can’t use tkdiff, or it is too slow
• Line numbers change as code evolves
– line-oriented comments get out of sync
• Can't diff between pre-submit revisions
– reviewer must keep manual track of evolution
• Email can get lost in inbox; no work flow
– reviewer: what do I still need to review?
– author: is my code reviewed?
11/30/06 9
Enter Mondrian
• Web-server based
– Addresses VPN issues
– Snapshots all previously reviewed versions
• Shows side-by-side diff (like tkdiff)
• Lets you add in-line comments
– Collect comments into a single message
• Also receives and organizes email
– Not all parties need to use Mondrian
11/30/06 10
Live Demo
• Show dashboard
– explain categories; hover over CL, flags, users, description
• Show someone else’s dashboard
• Show a group’s TO DO list (build-grouplet)
• Show a CL view
– browse some comments (expand/collapse)
– follow links to Sourcerer, p4web
– show Request code review form; Upload snapshot form; Approve form
• Show a file view
– use n/p to navigate diff chunks
– navigate between files
– show intra-region diffs
– add, edit, discard, reply to in-line comments
• Show Review and publish form
11/30/06 11
How It Started
• As a Noogler, I needed a starter project
• Someone proposed a code review web app
• Decided to freshen up my web knowledge
• Learned some Django on the way
• Adopted WSGI (PEP 333) while I was at it
• Learned about Google's Bigtable and p4lib
• Early prototype was immediately hot!
11/30/06 12
How It Works (Overview)
• Bigtable (a Googly db) used to store:
– Change metadata (description, list of files, …)
– Comments (entered on web or received email)
– File snapshots taken from user workspaces
– Per-user data (active changes, last view dates)
• Web server talks to user, Bigtable, p4
– Also to NFS, SSH when fetching snapshots
• Mail server processes incoming email
– Storing them as comments
11/30/06 13
Snapshots
• Copies of files taken from user's directory
– Updated whenever change view visited
– Solve two problems with the old process/tools
• What if the files aren't on NFS?
– Linux: use SSH/SCP to user's workstation
– Others: author uploads plain old patch
• Snapshots and comments are kept forever
– To satisfy auditors
– To track extended history of changes
11/30/06 14
Web User Interface
• Mostly pretty traditional HTML with CSS
– Django templates, wsgiref server (all Python)
• Some JavaScript for UI niceties
– Expand, collapse comments
– Show unified diffs in-line in CL view (AJAX)
• Full file view uses more AJAX:
– Keyboard navigation
– Inline draft comment editing
• Avoids full-page refresh
11/30/06 15
Editing Inline Draft Comments
• Each line in the diff is two table rows:
– <tr><td> 123 textA</td><td> 127 textB</td></tr>
– <tr><td>…</td> <td>…</td> </tr>
– First row displays left & right diff text
– Next row (hidden) used for inline comments
– Each <td> has a unique id {old,new}+lineno
• Double click on first row calls JavaScript
– Inserts form into next row
– “Submit” sends form data to server
– Server sends back HTML to replace form
11/30/06 16
Mail Server
• Receives every email sent to review logs
• Ignores messages sent by Mondrian itself
• Parses subject looking for revision #
• Inserts message as comment into Bigtable
• Also updates reviewers’ TO DO queues
• Implemented using standard smtpd.py
11/30/06 17
Performance
• Mostly fast enough, on just one server
• Most of the work is done elsewhere:
– Bigtable+GFS server infrastructure
– Perforce server
– In the browser (rendering reams of HTML)
• What's slow:
– Contention for Perforce
– Generating HTML for loaded dashboard
– Diffing huge files (uses Python's difflib)

Contenu connexe

En vedette

Mauritius mandla
Mauritius mandlaMauritius mandla
Mauritius mandlaMandla Dube
 
Doing science!
Doing science!Doing science!
Doing science!betti18
 
Introduction r-programming
Introduction r-programmingIntroduction r-programming
Introduction r-programmingpaurushpraveen
 
Sponsor pay manifesto
Sponsor pay manifestoSponsor pay manifesto
Sponsor pay manifestoseisemeia
 
η ελλαδα μια βολτα μέρος 1ο
η ελλαδα μια βολτα μέρος 1οη ελλαδα μια βολτα μέρος 1ο
η ελλαδα μια βολτα μέρος 1οbabis1977_v
 
Kdqt eng chap012
Kdqt eng chap012Kdqt eng chap012
Kdqt eng chap012huongntt16
 
10 11 ignacio aldekoa laburpena
10 11  ignacio aldekoa laburpena10 11  ignacio aldekoa laburpena
10 11 ignacio aldekoa laburpenaignacioaldekoa
 
Ερευνητική Εργασία Τάξης Α'
Ερευνητική Εργασία Τάξης Α'Ερευνητική Εργασία Τάξης Α'
Ερευνητική Εργασία Τάξης Α'babis1977_v
 
Recursos oa
Recursos oaRecursos oa
Recursos oaaloguar
 
dene/Sunumlar/cab_abst.ppt
dene/Sunumlar/cab_abst.pptdene/Sunumlar/cab_abst.ppt
dene/Sunumlar/cab_abst.pptBatın Düz
 
Why Should You Exhibit at eTailing India Expo M17?
Why Should You Exhibit at eTailing India Expo M17?Why Should You Exhibit at eTailing India Expo M17?
Why Should You Exhibit at eTailing India Expo M17?eTailing India
 
Atom Payment Solution Presentation by at Mr Shaival Shah
Atom Payment Solution Presentation by at Mr Shaival Shah Atom Payment Solution Presentation by at Mr Shaival Shah
Atom Payment Solution Presentation by at Mr Shaival Shah eTailing India
 
What's New in NAV 2013
What's New in NAV 2013What's New in NAV 2013
What's New in NAV 2013SociusPartner
 
Why Logistics Company Should Partner With eTailing India?
Why Logistics Company Should Partner With eTailing India?Why Logistics Company Should Partner With eTailing India?
Why Logistics Company Should Partner With eTailing India?eTailing India
 
Funding Trends In Indian eCommerce 2014
Funding Trends In Indian eCommerce 2014Funding Trends In Indian eCommerce 2014
Funding Trends In Indian eCommerce 2014eTailing India
 
Flipkart and Paytm to Play out Last eCommerce Festive Sales
Flipkart and Paytm to Play out Last eCommerce Festive SalesFlipkart and Paytm to Play out Last eCommerce Festive Sales
Flipkart and Paytm to Play out Last eCommerce Festive SaleseTailing India
 
Boost Checkout Conversions at eTailing India Expo'17
Boost Checkout Conversions at eTailing India Expo'17Boost Checkout Conversions at eTailing India Expo'17
Boost Checkout Conversions at eTailing India Expo'17eTailing India
 
Finally, Amazon Prime Video Launched in India
Finally, Amazon Prime Video Launched in IndiaFinally, Amazon Prime Video Launched in India
Finally, Amazon Prime Video Launched in IndiaeTailing India
 

En vedette (20)

Mauritius mandla
Mauritius mandlaMauritius mandla
Mauritius mandla
 
Doing science!
Doing science!Doing science!
Doing science!
 
Introduction r-programming
Introduction r-programmingIntroduction r-programming
Introduction r-programming
 
Sponsor pay manifesto
Sponsor pay manifestoSponsor pay manifesto
Sponsor pay manifesto
 
η ελλαδα μια βολτα μέρος 1ο
η ελλαδα μια βολτα μέρος 1οη ελλαδα μια βολτα μέρος 1ο
η ελλαδα μια βολτα μέρος 1ο
 
Kdqt eng chap012
Kdqt eng chap012Kdqt eng chap012
Kdqt eng chap012
 
10 11 ignacio aldekoa laburpena
10 11  ignacio aldekoa laburpena10 11  ignacio aldekoa laburpena
10 11 ignacio aldekoa laburpena
 
Ερευνητική Εργασία Τάξης Α'
Ερευνητική Εργασία Τάξης Α'Ερευνητική Εργασία Τάξης Α'
Ερευνητική Εργασία Τάξης Α'
 
Recursos oa
Recursos oaRecursos oa
Recursos oa
 
dene/Sunumlar/cab_abst.ppt
dene/Sunumlar/cab_abst.pptdene/Sunumlar/cab_abst.ppt
dene/Sunumlar/cab_abst.ppt
 
Zoolander
ZoolanderZoolander
Zoolander
 
Why Should You Exhibit at eTailing India Expo M17?
Why Should You Exhibit at eTailing India Expo M17?Why Should You Exhibit at eTailing India Expo M17?
Why Should You Exhibit at eTailing India Expo M17?
 
Atom Payment Solution Presentation by at Mr Shaival Shah
Atom Payment Solution Presentation by at Mr Shaival Shah Atom Payment Solution Presentation by at Mr Shaival Shah
Atom Payment Solution Presentation by at Mr Shaival Shah
 
What's New in NAV 2013
What's New in NAV 2013What's New in NAV 2013
What's New in NAV 2013
 
Why Logistics Company Should Partner With eTailing India?
Why Logistics Company Should Partner With eTailing India?Why Logistics Company Should Partner With eTailing India?
Why Logistics Company Should Partner With eTailing India?
 
Funding Trends In Indian eCommerce 2014
Funding Trends In Indian eCommerce 2014Funding Trends In Indian eCommerce 2014
Funding Trends In Indian eCommerce 2014
 
Flipkart and Paytm to Play out Last eCommerce Festive Sales
Flipkart and Paytm to Play out Last eCommerce Festive SalesFlipkart and Paytm to Play out Last eCommerce Festive Sales
Flipkart and Paytm to Play out Last eCommerce Festive Sales
 
Boost Checkout Conversions at eTailing India Expo'17
Boost Checkout Conversions at eTailing India Expo'17Boost Checkout Conversions at eTailing India Expo'17
Boost Checkout Conversions at eTailing India Expo'17
 
dene/ders1.ppt
dene/ders1.pptdene/ders1.ppt
dene/ders1.ppt
 
Finally, Amazon Prime Video Launched in India
Finally, Amazon Prime Video Launched in IndiaFinally, Amazon Prime Video Launched in India
Finally, Amazon Prime Video Launched in India
 

Similaire à Code review on the Web - Google

Code the docs-yu liu
Code the docs-yu liuCode the docs-yu liu
Code the docs-yu liuStreamNative
 
NDC London 2020 - Challenges of Managing CoreFx Repo -- Karel Zikmund
NDC London 2020 - Challenges of Managing CoreFx Repo -- Karel ZikmundNDC London 2020 - Challenges of Managing CoreFx Repo -- Karel Zikmund
NDC London 2020 - Challenges of Managing CoreFx Repo -- Karel ZikmundKarel Zikmund
 
Engage 2020 - Best Practices for analyzing Domino Applications
Engage 2020 - Best Practices for analyzing Domino ApplicationsEngage 2020 - Best Practices for analyzing Domino Applications
Engage 2020 - Best Practices for analyzing Domino Applicationspanagenda
 
Agileand saas davepatterson_armandofox_050813webinar
Agileand saas davepatterson_armandofox_050813webinarAgileand saas davepatterson_armandofox_050813webinar
Agileand saas davepatterson_armandofox_050813webinarRoberto Jr. Figueroa
 
Contributing to open source using Git
Contributing to open source using GitContributing to open source using Git
Contributing to open source using GitYan Vugenfirer
 
Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Henry S
 
Spring Roo Add-On Development & Distribution
Spring Roo Add-On Development & DistributionSpring Roo Add-On Development & Distribution
Spring Roo Add-On Development & DistributionStefan Schmidt
 
Stencil JS for Framework Free Web Components | Steven Zelek
Stencil JS for Framework Free Web Components | Steven ZelekStencil JS for Framework Free Web Components | Steven Zelek
Stencil JS for Framework Free Web Components | Steven ZelekIlyaDmitriev11
 
Guidelines for Working with Contract Developers in Evergreen
Guidelines for Working with Contract Developers in EvergreenGuidelines for Working with Contract Developers in Evergreen
Guidelines for Working with Contract Developers in Evergreenloriayre
 
Mixing d ps building architecture on the cross cutting example
Mixing d ps building architecture on the cross cutting exampleMixing d ps building architecture on the cross cutting example
Mixing d ps building architecture on the cross cutting examplecorehard_by
 
Introducing Systems Analysis Design Development
Introducing Systems Analysis Design DevelopmentIntroducing Systems Analysis Design Development
Introducing Systems Analysis Design Developmentbsadd
 
B-Translator as a Software Engineering Project
B-Translator as a Software Engineering ProjectB-Translator as a Software Engineering Project
B-Translator as a Software Engineering ProjectDashamir Hoxha
 
Socialite, the Open Source Status Feed Part 1: Design Overview and Scaling fo...
Socialite, the Open Source Status Feed Part 1: Design Overview and Scaling fo...Socialite, the Open Source Status Feed Part 1: Design Overview and Scaling fo...
Socialite, the Open Source Status Feed Part 1: Design Overview and Scaling fo...MongoDB
 
L06 a versioning_system_overview
L06 a versioning_system_overviewL06 a versioning_system_overview
L06 a versioning_system_overviewM. Shahzad Mughal
 
Web Tools for GemStone/S
Web Tools for GemStone/SWeb Tools for GemStone/S
Web Tools for GemStone/SESUG
 
Presentation for git jira and linux
Presentation for git jira and linuxPresentation for git jira and linux
Presentation for git jira and linuxdkylko1
 
Hackaton for health 2015 - Sharing the Code we Make
Hackaton for health 2015 - Sharing the Code we MakeHackaton for health 2015 - Sharing the Code we Make
Hackaton for health 2015 - Sharing the Code we Makeesben1962
 
Introducing systems analysis, design & development Concepts
Introducing systems analysis, design & development ConceptsIntroducing systems analysis, design & development Concepts
Introducing systems analysis, design & development ConceptsShafiul Azam Chowdhury
 

Similaire à Code review on the Web - Google (20)

Code the docs-yu liu
Code the docs-yu liuCode the docs-yu liu
Code the docs-yu liu
 
NDC London 2020 - Challenges of Managing CoreFx Repo -- Karel Zikmund
NDC London 2020 - Challenges of Managing CoreFx Repo -- Karel ZikmundNDC London 2020 - Challenges of Managing CoreFx Repo -- Karel Zikmund
NDC London 2020 - Challenges of Managing CoreFx Repo -- Karel Zikmund
 
Engage 2020 - Best Practices for analyzing Domino Applications
Engage 2020 - Best Practices for analyzing Domino ApplicationsEngage 2020 - Best Practices for analyzing Domino Applications
Engage 2020 - Best Practices for analyzing Domino Applications
 
Agileand saas davepatterson_armandofox_050813webinar
Agileand saas davepatterson_armandofox_050813webinarAgileand saas davepatterson_armandofox_050813webinar
Agileand saas davepatterson_armandofox_050813webinar
 
Contributing to open source using Git
Contributing to open source using GitContributing to open source using Git
Contributing to open source using Git
 
Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1
 
Spring Roo Add-On Development & Distribution
Spring Roo Add-On Development & DistributionSpring Roo Add-On Development & Distribution
Spring Roo Add-On Development & Distribution
 
Stencil JS for Framework Free Web Components | Steven Zelek
Stencil JS for Framework Free Web Components | Steven ZelekStencil JS for Framework Free Web Components | Steven Zelek
Stencil JS for Framework Free Web Components | Steven Zelek
 
Guidelines for Working with Contract Developers in Evergreen
Guidelines for Working with Contract Developers in EvergreenGuidelines for Working with Contract Developers in Evergreen
Guidelines for Working with Contract Developers in Evergreen
 
Mixing d ps building architecture on the cross cutting example
Mixing d ps building architecture on the cross cutting exampleMixing d ps building architecture on the cross cutting example
Mixing d ps building architecture on the cross cutting example
 
Migrating To GitHub
Migrating To GitHub  Migrating To GitHub
Migrating To GitHub
 
Introducing Systems Analysis Design Development
Introducing Systems Analysis Design DevelopmentIntroducing Systems Analysis Design Development
Introducing Systems Analysis Design Development
 
B-Translator as a Software Engineering Project
B-Translator as a Software Engineering ProjectB-Translator as a Software Engineering Project
B-Translator as a Software Engineering Project
 
Socialite, the Open Source Status Feed Part 1: Design Overview and Scaling fo...
Socialite, the Open Source Status Feed Part 1: Design Overview and Scaling fo...Socialite, the Open Source Status Feed Part 1: Design Overview and Scaling fo...
Socialite, the Open Source Status Feed Part 1: Design Overview and Scaling fo...
 
L06 a versioning_system_overview
L06 a versioning_system_overviewL06 a versioning_system_overview
L06 a versioning_system_overview
 
Github
GithubGithub
Github
 
Web Tools for GemStone/S
Web Tools for GemStone/SWeb Tools for GemStone/S
Web Tools for GemStone/S
 
Presentation for git jira and linux
Presentation for git jira and linuxPresentation for git jira and linux
Presentation for git jira and linux
 
Hackaton for health 2015 - Sharing the Code we Make
Hackaton for health 2015 - Sharing the Code we MakeHackaton for health 2015 - Sharing the Code we Make
Hackaton for health 2015 - Sharing the Code we Make
 
Introducing systems analysis, design & development Concepts
Introducing systems analysis, design & development ConceptsIntroducing systems analysis, design & development Concepts
Introducing systems analysis, design & development Concepts
 

Dernier

How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 

Dernier (20)

How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 

Code review on the Web - Google

  • 1. Mondrian: Code Review on the Web Nov 30, 2006 Open Source Speakers Series Guido van Rossum guido@google.com
  • 2. 11/30/06 2 What is Code Review? • When one developer writes code, another developer is asked to review that code • A careful line-by-line critique • Happens in a non-threatening context • Goal is cooperation, not fault-finding • Often an integral part of coding process • Involuntary code review happens when debugging someone else's broken code – Not so good; emotions may flare
  • 3. 11/30/06 3 Benefits of Code Review • Two pairs of eyes catch more bugs (duh) – Catch 'em early to save hours of debugging • Enforce coding standards, style guides – Keep overall readability & code quality high • Mentoring of new developers – Learn from mistakes without breaking stuff • Establish trust relationships – Prepare for more delegation • A good alternative to pair programming
  • 4. 11/30/06 4 Code Review in Open Source • Author & reviewer on separate computers • Author invokes "diff -u" to create patch file • Author mails patch file to reviewer – or uploads to e.g. SourceForge patch manager • Reviewer uses "patch" to recreate the files • They email back-and-forth a few times • Finally, reviewer submits into svn/cvs/etc – patch author often has no privileges (yet) • process helps "vetting" new developers
  • 5. 11/30/06 5 Google's Development Process • (In theory :-) • Single company-wide Perforce (p4) depot – No developer branches • Company-wide NFS – Developers workspaces accessibly by others • All code reviewed before submission – All code-review email logged for auditors • Wrapper "g4" implements superset of "p4" – Originally a shell script; now a Python program
  • 6. 11/30/06 6 Google's Code Review Process • All command-line and email based: 1. Author edits changes in workspace, tests etc. 2. Author send email to reviewer (a tool helps) 3. Reviewer views the diff (another tool helps) 4. Reviewer sends mail back (regular mail reply) 5. Rinse and repeat (using regular mail replies) 6. When reviewer replies "lgtm", author submits • lgtm = looks good to me
  • 7. 11/30/06 7 Original, Minimal Tools • "g4 change" invoked by author defines set of files involved, adding comments • "g4 mail" sends form email to reviewer – (also integrated with g4 change call) • "g4 diff" invoked by reviewer diffs files straight out of author's workspace – "tkdiff" X11-based side-by-side differ • "g4 reply" synthesizes reply mail – optional; not used very much
  • 8. 11/30/06 8 Problems With Old Process • VPN usage (reviewers working from home) – can’t use tkdiff, or it is too slow • Line numbers change as code evolves – line-oriented comments get out of sync • Can't diff between pre-submit revisions – reviewer must keep manual track of evolution • Email can get lost in inbox; no work flow – reviewer: what do I still need to review? – author: is my code reviewed?
  • 9. 11/30/06 9 Enter Mondrian • Web-server based – Addresses VPN issues – Snapshots all previously reviewed versions • Shows side-by-side diff (like tkdiff) • Lets you add in-line comments – Collect comments into a single message • Also receives and organizes email – Not all parties need to use Mondrian
  • 10. 11/30/06 10 Live Demo • Show dashboard – explain categories; hover over CL, flags, users, description • Show someone else’s dashboard • Show a group’s TO DO list (build-grouplet) • Show a CL view – browse some comments (expand/collapse) – follow links to Sourcerer, p4web – show Request code review form; Upload snapshot form; Approve form • Show a file view – use n/p to navigate diff chunks – navigate between files – show intra-region diffs – add, edit, discard, reply to in-line comments • Show Review and publish form
  • 11. 11/30/06 11 How It Started • As a Noogler, I needed a starter project • Someone proposed a code review web app • Decided to freshen up my web knowledge • Learned some Django on the way • Adopted WSGI (PEP 333) while I was at it • Learned about Google's Bigtable and p4lib • Early prototype was immediately hot!
  • 12. 11/30/06 12 How It Works (Overview) • Bigtable (a Googly db) used to store: – Change metadata (description, list of files, …) – Comments (entered on web or received email) – File snapshots taken from user workspaces – Per-user data (active changes, last view dates) • Web server talks to user, Bigtable, p4 – Also to NFS, SSH when fetching snapshots • Mail server processes incoming email – Storing them as comments
  • 13. 11/30/06 13 Snapshots • Copies of files taken from user's directory – Updated whenever change view visited – Solve two problems with the old process/tools • What if the files aren't on NFS? – Linux: use SSH/SCP to user's workstation – Others: author uploads plain old patch • Snapshots and comments are kept forever – To satisfy auditors – To track extended history of changes
  • 14. 11/30/06 14 Web User Interface • Mostly pretty traditional HTML with CSS – Django templates, wsgiref server (all Python) • Some JavaScript for UI niceties – Expand, collapse comments – Show unified diffs in-line in CL view (AJAX) • Full file view uses more AJAX: – Keyboard navigation – Inline draft comment editing • Avoids full-page refresh
  • 15. 11/30/06 15 Editing Inline Draft Comments • Each line in the diff is two table rows: – <tr><td> 123 textA</td><td> 127 textB</td></tr> – <tr><td>…</td> <td>…</td> </tr> – First row displays left & right diff text – Next row (hidden) used for inline comments – Each <td> has a unique id {old,new}+lineno • Double click on first row calls JavaScript – Inserts form into next row – “Submit” sends form data to server – Server sends back HTML to replace form
  • 16. 11/30/06 16 Mail Server • Receives every email sent to review logs • Ignores messages sent by Mondrian itself • Parses subject looking for revision # • Inserts message as comment into Bigtable • Also updates reviewers’ TO DO queues • Implemented using standard smtpd.py
  • 17. 11/30/06 17 Performance • Mostly fast enough, on just one server • Most of the work is done elsewhere: – Bigtable+GFS server infrastructure – Perforce server – In the browser (rendering reams of HTML) • What's slow: – Contention for Perforce – Generating HTML for loaded dashboard – Diffing huge files (uses Python's difflib)