Jump to content
 







Main menu
   


Navigation  



Main page
Get MediaWiki
Get extensions
Tech blog
Contribute
 




Support  



User help
FAQ
Technical manual
Support desk
Communication
 




Development  



Developer portal
Code statistics
 




mediawiki.org  



Community portal
Recent changes
Translate content
Random page
Village pump
Sandbox
 




In other languages  




Add links
 







Search  









English
 


















Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



Beginning
 


1 Goals  





2 Finding patches to review  



2.1  By request  





2.2  By project  





2.3  By author  





2.4  New contributors to our projects  





2.5  Chronological (and Reverse Chronological)  







3 Review checklist  



3.1  Is it wanted  





3.2  General  





3.3  Performance  





3.4  Design  





3.5  Style  





3.6  Readability  





3.7  Security  





3.8  Architecture  





3.9  Logic  







4 Complete the review  



4.1  Giving positive feedback  





4.2  Giving negative feedback  







5 Contacts  





6 See also  





7 References  














Gerrit/Code review










Page
Discussion
 

















Read
Edit
View history
 








Tools
   


Actions  



Read
Edit
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Cite this page
Get shortened URL
Download QR code
 




Print/export  



Create a book
Download as PDF
Printable version
 
















From mediawiki.org
 

< Gerrit

  • English
  • français
  • polski
  • português do Brasil
  • čeština
  • русский
  • 中文
  • 日本語
  • 閩南語 / Bân-lâm-gú
  • 한국어
  • This is a guide to reviewing and merging contributions to Wikimedia code repositories, written primarily for developers performing code reviews.

    Goals[edit]

    Finding patches to review[edit]

    Some developers may ask you to review their code via drone.

    There is a lot of code to review. How to break up the task into more manageable portions?

    There are several basic patterns:

    By request[edit]

    Contributors can request code review in Gerrit by adding a reviewer and clicking "Add to attention set". This is a helpful way to indicate to a user that you are wish them to review.

    In the Gerrit UI patch contributors can request reviewer by adding their user name and clicking "Add to attention set"

    Reviewers should therefore bookmark and monitor requests for code review in this form using the Gerrit URL query has:attention.

    When a patch has your attention you can either:

    By project[edit]

    If you are a maintainer, consider setting up email notifications for new patchsets in your projects (repositories) via "Watched Projects" in Gerrit. Alternatively you can add yourself to the Gerrit Reviewer Bot which will automatically add you as a reviewer to each new patchset.

    By author[edit]

    If someone already added you as a potential reviewer and you know you will not review the patch, remove yourself from the list of reviewers.[1]

    New contributors to our projects[edit]

    You can add (some of) the queries below to your menu by editing your user preferences. A "new contributor" is defined as a person who has contributed five or less changesets in total.

    Chronological (and Reverse Chronological)[edit]

    Review checklist[edit]

    Is it wanted[edit]

    General[edit]

    Performance[edit]

    Design[edit]

    Style[edit]

    Readability[edit]

    Security[edit]

    Architecture[edit]

    Logic[edit]

    Complete the review[edit]

    Warning Warning: Please do not use "Verified +2". This is a "force-merge" that bypasses tests. See also Gerrit/Privilege_policy#Merging_without_review

    Giving positive feedback[edit]

    Giving negative feedback[edit]

    You have to weigh up the costs and benefits of each course of action. If you reject the change completely (Code-Review -2), then that change will be lost, and the developer may be discouraged. If you tolerate the fault, the end product will suffer. If you fix it yourself, then you're letting yourself get distracted, and perhaps you're making the developer believe that it is acceptable to submit low-quality code and then let someone else worry about the details.

    General guidelines on comment style, especially when giving negative feedback:

    1. Focus your comments on the code and any objectively-observed behavior, not motivations; for example, don't state or imply assumptions about motivating factors like whether the developer was too lazy or unexperienced to do things right. Ask questions instead of making demands to foster a technical discussion: "What do you think about...?" "Did you consider...?" "Can you clarify...?"[3]
    2. Be empathetic and kind. Recognise that the developer has probably put a lot of work in their idea, and thank them for their contribution if you feel comfortable and sincere in doing so. "Why didn't you just..." provides a judgement, putting people on the defensive.[3] Be positive.
    3. Let them know where they can appeal your decision. For example, invite them to discuss the issue on mail:wikitech-l or on IRC.
    4. Be clear. Don't sugarcoat things so much that the central message is obscured.
    5. Most importantly, give the feedback quickly. Don't just leave negative feedback to someone else or hope they aren't persistent enough to get their contribution accepted.

    Contacts[edit]

    During the review you may have some questions or problems. Don't worry! We can try to help you.

    For questions related to Wikimedia Gerrit and code review or specific patches, feel free to see the list of IRC Channels and choose a relevant one. See also the Communication page for additional platforms.

    For example, for questions related to MediaWiki patches, feel free to join #mediawiki connect.

    If you have problems with the jenkins-bot, feel free to kindly contact #wikimedia-releng connect.

    See also[edit]

    References[edit]

  • Sage Sharp: The Gentle Art of Patch Review
  • 3.0 3.1 Prior, D., "Cultivating a Code Review Culture" at RailsConf 2015

  • Retrieved from "https://www.mediawiki.org/w/index.php?title=Gerrit/Code_review&oldid=6602963"

    Categories: 
    Git
    Development guidelines
    Gerrit
     



    This page was last edited on 25 June 2024, at 21:17.

    Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. See Terms of Use for details.



    Privacy policy

    About mediawiki.org

    Disclaimers

    Code of Conduct

    Developers

    Statistics

    Cookie statement

    Mobile view



    Wikimedia Foundation
    Powered by MediaWiki