Home | History | Annotate | Download | only in webkitpy
      1 # Copyright (c) 2009, Google Inc. All rights reserved.
      2 #
      3 # Redistribution and use in source and binary forms, with or without
      4 # modification, are permitted provided that the following conditions are
      5 # met:
      6 #
      7 #     * Redistributions of source code must retain the above copyright
      8 # notice, this list of conditions and the following disclaimer.
      9 #     * Redistributions in binary form must reproduce the above
     10 # copyright notice, this list of conditions and the following disclaimer
     11 # in the documentation and/or other materials provided with the
     12 # distribution.
     13 #     * Neither the name of Google Inc. nor the names of its
     14 # contributors may be used to endorse or promote products derived from
     15 # this software without specific prior written permission.
     16 #
     17 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     18 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     19 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
     20 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     21 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
     22 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
     23 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
     27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     28 #
     29 # WebKit's Python module for committer and reviewer validation
     30 
     31 
     32 class Committer:
     33 
     34     def __init__(self, name, email_or_emails):
     35         self.full_name = name
     36         if isinstance(email_or_emails, str):
     37             self.emails = [email_or_emails]
     38         else:
     39             self.emails = email_or_emails
     40         self.can_review = False
     41 
     42     def bugzilla_email(self):
     43         # FIXME: We're assuming the first email is a valid bugzilla email,
     44         # which might not be right.
     45         return self.emails[0]
     46 
     47     def __str__(self):
     48         return '"%s" <%s>' % (self.full_name, self.emails[0])
     49 
     50 
     51 class Reviewer(Committer):
     52 
     53     def __init__(self, name, email_or_emails):
     54         Committer.__init__(self, name, email_or_emails)
     55         self.can_review = True
     56 
     57 
     58 # This is intended as a canonical, machine-readable list of all non-reviewer
     59 # committers for WebKit.  If your name is missing here and you are a committer,
     60 # please add it.  No review needed.  All reviewers are committers, so this list
     61 # is only of committers who are not reviewers.
     62 
     63 
     64 committers_unable_to_review = [
     65     Committer("Aaron Boodman", "aa (at] chromium.org"),
     66     Committer("Adam Langley", "agl (at] chromium.org"),
     67     Committer("Albert J. Wong", "ajwong (at] chromium.org"),
     68     Committer("Alejandro G. Castro", ["alex (at] igalia.com", "alex (at] webkit.org"]),
     69     Committer("Alexander Kellett", ["lypanov (at] mac.com", "a-lists001 (at] lypanov.net", "lypanov (at] kde.org"]),
     70     Committer("Alexander Pavlov", "apavlov (at] chromium.org"),
     71     Committer("Andre Boule", "aboule (at] apple.com"),
     72     Committer("Andrew Wellington", ["andrew (at] webkit.org", "proton (at] wiretapped.net"]),
     73     Committer("Andras Becsi", "abecsi (at] webkit.org"),
     74     Committer("Anthony Ricaud", "rik (at] webkit.org"),
     75     Committer("Anton Muhin", "antonm (at] chromium.org"),
     76     Committer("Antonio Gomes", "tonikitoo (at] webkit.org"),
     77     Committer("Ben Murdoch", "benm (at] google.com"),
     78     Committer("Benjamin C Meyer", ["ben (at] meyerhome.net", "ben (at] webkit.org"]),
     79     Committer("Benjamin Otte", ["otte (at] gnome.org", "otte (at] webkit.org"]),
     80     Committer("Brent Fulgham", "bfulgham (at] webkit.org"),
     81     Committer("Brett Wilson", "brettw (at] chromium.org"),
     82     Committer("Brian Weinstein", "bweinstein (at] apple.com"),
     83     Committer("Cameron McCormack", "cam (at] webkit.org"),
     84     Committer("Carol Szabo", "carol.szabo (at] nokia.com"),
     85     Committer("Chang Shu", "chang.shu (at] nokia.com"),
     86     Committer("Chris Fleizach", "cfleizach (at] apple.com"),
     87     Committer("Chris Jerdonek", "cjerdonek (at] webkit.org"),
     88     Committer("Chris Marrin", "cmarrin (at] apple.com"),
     89     Committer("Chris Petersen", "cpetersen (at] apple.com"),
     90     Committer("Christian Dywan", ["christian (at] twotoasts.de", "christian (at] webkit.org"]),
     91     Committer("Collin Jackson", "collinj (at] webkit.org"),
     92     Committer("Csaba Osztrogonac", "ossy (at] webkit.org"),
     93     Committer("Daniel Bates", "dbates (at] webkit.org"),
     94     Committer("David Smith", ["catfish.man (at] gmail.com", "dsmith (at] webkit.org"]),
     95     Committer("Dean Jackson", "dino (at] apple.com"),
     96     Committer("Dirk Pranke", "dpranke (at] chromium.org"),
     97     Committer("Drew Wilson", "atwilson (at] chromium.org"),
     98     Committer("Dumitru Daniliuc", "dumi (at] chromium.org"),
     99     Committer("Eli Fidler", "eli (at] staikos.net"),
    100     Committer("Enrica Casucci", "enrica (at] apple.com"),
    101     Committer("Erik Arvidsson", "arv (at] chromium.org"),
    102     Committer("Eric Roman", "eroman (at] chromium.org"),
    103     Committer("Feng Qian", "feng (at] chromium.org"),
    104     Committer("Fumitoshi Ukai", "ukai (at] chromium.org"),
    105     Committer("Gabor Loki", "loki (at] webkit.org"),
    106     Committer("Girish Ramakrishnan", ["girish (at] forwardbias.in", "ramakrishnan.girish (at] gmail.com"]),
    107     Committer("Graham Dennis", ["Graham.Dennis (at] gmail.com", "gdennis (at] webkit.org"]),
    108     Committer("Greg Bolsinga", "bolsinga (at] apple.com"),
    109     Committer("Hin-Chung Lam", ["hclam (at] google.com", "hclam (at] chromium.org"]),
    110     Committer("Jakob Petsovits", ["jpetsovits (at] rim.com", "jpetso (at] gmx.at"]),
    111     Committer("Jens Alfke", ["snej (at] chromium.org", "jens (at] apple.com"]),
    112     Committer("Jeremy Moskovich", ["playmobil (at] google.com", "jeremy (at] chromium.org"]),
    113     Committer("Jessie Berlin", ["jberlin (at] webkit.org", "jberlin (at] apple.com"]),
    114     Committer("Jian Li", "jianli (at] chromium.org"),
    115     Committer("John Abd-El-Malek", "jam (at] chromium.org"),
    116     Committer("Joost de Valk", ["joost (at] webkit.org", "webkit-dev (at] joostdevalk.nl"]),
    117     Committer("Joseph Pecoraro", "joepeck (at] webkit.org"),
    118     Committer("Julie Parent", ["jparent (at] google.com", "jparent (at] chromium.org"]),
    119     Committer("Julien Chaffraix", ["jchaffraix (at] webkit.org", "julien.chaffraix (at] gmail.com"]),
    120     Committer("Jungshik Shin", "jshin (at] chromium.org"),
    121     Committer("Keishi Hattori", "keishi (at] webkit.org"),
    122     Committer("Kelly Norton", "knorton (at] google.com"),
    123     Committer("Kenneth Russell", "kbr (at] google.com"),
    124     Committer("Kent Tamura", "tkent (at] chromium.org"),
    125     Committer("Krzysztof Kowalczyk", "kkowalczyk (at] gmail.com"),
    126     Committer("Levi Weintraub", "lweintraub (at] apple.com"),
    127     Committer("Mads Ager", "ager (at] chromium.org"),
    128     Committer("Matt Lilek", ["webkit (at] mattlilek.com", "pewtermoose (at] webkit.org"]),
    129     Committer("Matt Perry", "mpcomplete (at] chromium.org"),
    130     Committer("Maxime Britto", ["maxime.britto (at] gmail.com", "britto (at] apple.com"]),
    131     Committer("Maxime Simon", ["simon.maxime (at] gmail.com", "maxime.simon (at] webkit.org"]),
    132     Committer("Martin Robinson", ["mrobinson (at] webkit.org", "martin.james.robinson (at] gmail.com"]),
    133     Committer("Michelangelo De Simone", "michelangelo (at] webkit.org"),
    134     Committer("Mike Belshe", ["mbelshe (at] chromium.org", "mike (at] belshe.com"]),
    135     Committer("Mike Fenton", ["mike.fenton (at] torchmobile.com", "mifenton (at] rim.com"]),
    136     Committer("Mike Thole", ["mthole (at] mikethole.com", "mthole (at] apple.com"]),
    137     Committer("Mikhail Naganov", "mnaganov (at] chromium.org"),
    138     Committer("Ojan Vafai", "ojan (at] chromium.org"),
    139     Committer("Pam Greene", "pam (at] chromium.org"),
    140     Committer("Peter Kasting", ["pkasting (at] google.com", "pkasting (at] chromium.org"]),
    141     Committer("Philippe Normand", ["pnormand (at] igalia.com", "philn (at] webkit.org"]),
    142     Committer("Pierre d'Herbemont", ["pdherbemont (at] free.fr", "pdherbemont (at] apple.com"]),
    143     Committer("Pierre-Olivier Latour", "pol (at] apple.com"),
    144     Committer("Roland Steiner", "rolandsteiner (at] chromium.org"),
    145     Committer("Ryosuke Niwa", "rniwa (at] webkit.org"),
    146     Committer("Scott Violet", "sky (at] chromium.org"),
    147     Committer("Stephen White", "senorblanco (at] chromium.org"),
    148     Committer("Steve Block", "steveblock (at] google.com"),
    149     Committer("Tony Chang", "tony (at] chromium.org"),
    150     Committer("Trey Matteson", "trey (at] usa.net"),
    151     Committer("Tristan O'Tierney", ["tristan (at] otierney.net", "tristan (at] apple.com"]),
    152     Committer("Victor Wang", "victorw (at] chromium.org"),
    153     Committer("William Siegrist", "wsiegrist (at] apple.com"),
    154     Committer("Yael Aharon", "yael.aharon (at] nokia.com"),
    155     Committer("Yaar Schnitman", ["yaar (at] chromium.org", "yaar (at] google.com"]),
    156     Committer("Yong Li", ["yong.li (at] torchmobile.com", "yong.li.webkit (at] gmail.com"]),
    157     Committer("Yongjun Zhang", "yongjun.zhang (at] nokia.com"),
    158     Committer("Yury Semikhatsky", "yurys (at] chromium.org"),
    159     Committer("Yuzo Fujishima", "yuzo (at] google.com"),
    160     Committer("Zoltan Herczeg", "zherczeg (at] webkit.org"),
    161     Committer("Zoltan Horvath", "zoltan (at] webkit.org"),
    162 ]
    163 
    164 
    165 # This is intended as a canonical, machine-readable list of all reviewers for
    166 # WebKit.  If your name is missing here and you are a reviewer, please add it.
    167 # No review needed.
    168 
    169 
    170 reviewers_list = [
    171     Reviewer("Ada Chan", "adachan (at] apple.com"),
    172     Reviewer("Adam Barth", "abarth (at] webkit.org"),
    173     Reviewer("Adam Roben", "aroben (at] apple.com"),
    174     Reviewer("Adam Treat", ["treat (at] kde.org", "treat (at] webkit.org"]),
    175     Reviewer("Adele Peterson", "adele (at] apple.com"),
    176     Reviewer("Alexey Proskuryakov", ["ap (at] webkit.org", "ap (at] apple.com"]),
    177     Reviewer("Alice Liu", "alice.liu (at] apple.com"),
    178     Reviewer("Alp Toker", ["alp (at] nuanti.com", "alp (at] atoker.com", "alp (at] webkit.org"]),
    179     Reviewer("Anders Carlsson", ["andersca (at] apple.com", "acarlsson (at] apple.com"]),
    180     Reviewer("Antti Koivisto", ["koivisto (at] iki.fi", "antti (at] apple.com"]),
    181     Reviewer("Ariya Hidayat", ["ariya.hidayat (at] gmail.com", "ariya (at] webkit.org"]),
    182     Reviewer("Beth Dakin", "bdakin (at] apple.com"),
    183     Reviewer("Brady Eidson", "beidson (at] apple.com"),
    184     Reviewer("Cameron Zwarich", ["zwarich (at] apple.com", "cwzwarich (at] apple.com", "cwzwarich (at] webkit.org"]),
    185     Reviewer("Chris Blumenberg", "cblu (at] apple.com"),
    186     Reviewer("Dan Bernstein", ["mitz (at] webkit.org", "mitz (at] apple.com"]),
    187     Reviewer("Darin Adler", "darin (at] apple.com"),
    188     Reviewer("Darin Fisher", ["fishd (at] chromium.org", "darin (at] chromium.org"]),
    189     Reviewer("David Harrison", "harrison (at] apple.com"),
    190     Reviewer("David Hyatt", "hyatt (at] apple.com"),
    191     Reviewer("David Kilzer", ["ddkilzer (at] webkit.org", "ddkilzer (at] apple.com"]),
    192     Reviewer("David Levin", "levin (at] chromium.org"),
    193     Reviewer("Dimitri Glazkov", "dglazkov (at] chromium.org"),
    194     Reviewer("Dirk Schulze", "krit (at] webkit.org"),
    195     Reviewer("Dmitry Titov", "dimich (at] chromium.org"),
    196     Reviewer("Don Melton", "gramps (at] apple.com"),
    197     Reviewer("Eric Carlson", "eric.carlson (at] apple.com"),
    198     Reviewer("Eric Seidel", "eric (at] webkit.org"),
    199     Reviewer("Gavin Barraclough", "barraclough (at] apple.com"),
    200     Reviewer("Geoffrey Garen", "ggaren (at] apple.com"),
    201     Reviewer("George Staikos", ["staikos (at] kde.org", "staikos (at] webkit.org"]),
    202     Reviewer("Gustavo Noronha Silva", ["gns (at] gnome.org", "kov (at] webkit.org"]),
    203     Reviewer("Holger Freyther", ["zecke (at] selfish.org", "zecke (at] webkit.org"]),
    204     Reviewer("Jan Alonzo", ["jmalonzo (at] gmail.com", "jmalonzo (at] webkit.org"]),
    205     Reviewer("Jeremy Orlow", "jorlow (at] chromium.org"),
    206     Reviewer("John Sullivan", "sullivan (at] apple.com"),
    207     Reviewer("Jon Honeycutt", "jhoneycutt (at] apple.com"),
    208     Reviewer("Justin Garcia", "justin.garcia (at] apple.com"),
    209     Reviewer("Ken Kocienda", "kocienda (at] apple.com"),
    210     Reviewer("Kenneth Rohde Christiansen", ["kenneth (at] webkit.org", "kenneth.christiansen (at] openbossa.org"]),
    211     Reviewer("Kevin Decker", "kdecker (at] apple.com"),
    212     Reviewer("Kevin McCullough", "kmccullough (at] apple.com"),
    213     Reviewer("Kevin Ollivier", ["kevino (at] theolliviers.com", "kevino (at] webkit.org"]),
    214     Reviewer("Lars Knoll", ["lars (at] trolltech.com", "lars (at] kde.org"]),
    215     Reviewer("Laszlo Gombos", "laszlo.1.gombos (at] nokia.com"),
    216     Reviewer("Maciej Stachowiak", "mjs (at] apple.com"),
    217     Reviewer("Mark Rowe", "mrowe (at] apple.com"),
    218     Reviewer("Nate Chapin", "japhet (at] chromium.org"),
    219     Reviewer("Nikolas Zimmermann", ["zimmermann (at] kde.org", "zimmermann (at] physik.rwth-aachen.de", "zimmermann (at] webkit.org"]),
    220     Reviewer("Oliver Hunt", "oliver (at] apple.com"),
    221     Reviewer("Pavel Feldman", "pfeldman (at] chromium.org"),
    222     Reviewer("Richard Williamson", "rjw (at] apple.com"),
    223     Reviewer("Rob Buis", ["rwlbuis (at] gmail.com", "rwlbuis (at] webkit.org"]),
    224     Reviewer("Sam Weinig", ["sam (at] webkit.org", "weinig (at] apple.com"]),
    225     Reviewer("Shinichiro Hamaji", "hamaji (at] chromium.org"),
    226     Reviewer("Simon Fraser", "simon.fraser (at] apple.com"),
    227     Reviewer("Simon Hausmann", ["hausmann (at] webkit.org", "hausmann (at] kde.org", "simon.hausmann (at] nokia.com"]),
    228     Reviewer("Stephanie Lewis", "slewis (at] apple.com"),
    229     Reviewer("Steve Falkenburg", "sfalken (at] apple.com"),
    230     Reviewer("Tim Omernick", "timo (at] apple.com"),
    231     Reviewer("Timothy Hatcher", ["timothy (at] hatcher.name", "timothy (at] apple.com"]),
    232     Reviewer(u'Tor Arne Vestb\xf8', "vestbo (at] webkit.org"),
    233     Reviewer("Vicki Murley", "vicki (at] apple.com"),
    234     Reviewer("Xan Lopez", ["xan.lopez (at] gmail.com", "xan (at] gnome.org", "xan (at] webkit.org"]),
    235     Reviewer("Zack Rusin", "zack (at] kde.org"),
    236 ]
    237 
    238 
    239 class CommitterList:
    240 
    241     # Committers and reviewers are passed in to allow easy testing
    242 
    243     def __init__(self,
    244                  committers=committers_unable_to_review,
    245                  reviewers=reviewers_list):
    246         self._committers = committers + reviewers
    247         self._reviewers = reviewers
    248         self._committers_by_email = {}
    249 
    250     def committers(self):
    251         return self._committers
    252 
    253     def reviewers(self):
    254         return self._reviewers
    255 
    256     def _email_to_committer_map(self):
    257         if not len(self._committers_by_email):
    258             for committer in self._committers:
    259                 for email in committer.emails:
    260                     self._committers_by_email[email] = committer
    261         return self._committers_by_email
    262 
    263     def committer_by_email(self, email):
    264         return self._email_to_committer_map().get(email)
    265 
    266     def reviewer_by_email(self, email):
    267         committer = self.committer_by_email(email)
    268         if committer and not committer.can_review:
    269             return None
    270         return committer
    271