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 32class 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 51class 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 64committers_unable_to_review = [ 65 Committer("Aaron Boodman", "aa@chromium.org"), 66 Committer("Adam Langley", "agl@chromium.org"), 67 Committer("Albert J. Wong", "ajwong@chromium.org"), 68 Committer("Alejandro G. Castro", ["alex@igalia.com", "alex@webkit.org"]), 69 Committer("Alexander Kellett", ["lypanov@mac.com", "a-lists001@lypanov.net", "lypanov@kde.org"]), 70 Committer("Alexander Pavlov", "apavlov@chromium.org"), 71 Committer("Andre Boule", "aboule@apple.com"), 72 Committer("Andrew Wellington", ["andrew@webkit.org", "proton@wiretapped.net"]), 73 Committer("Andras Becsi", "abecsi@webkit.org"), 74 Committer("Anthony Ricaud", "rik@webkit.org"), 75 Committer("Anton Muhin", "antonm@chromium.org"), 76 Committer("Antonio Gomes", "tonikitoo@webkit.org"), 77 Committer("Ben Murdoch", "benm@google.com"), 78 Committer("Benjamin C Meyer", ["ben@meyerhome.net", "ben@webkit.org"]), 79 Committer("Benjamin Otte", ["otte@gnome.org", "otte@webkit.org"]), 80 Committer("Brent Fulgham", "bfulgham@webkit.org"), 81 Committer("Brett Wilson", "brettw@chromium.org"), 82 Committer("Brian Weinstein", "bweinstein@apple.com"), 83 Committer("Cameron McCormack", "cam@webkit.org"), 84 Committer("Carol Szabo", "carol.szabo@nokia.com"), 85 Committer("Chang Shu", "chang.shu@nokia.com"), 86 Committer("Chris Fleizach", "cfleizach@apple.com"), 87 Committer("Chris Jerdonek", "cjerdonek@webkit.org"), 88 Committer("Chris Marrin", "cmarrin@apple.com"), 89 Committer("Chris Petersen", "cpetersen@apple.com"), 90 Committer("Christian Dywan", ["christian@twotoasts.de", "christian@webkit.org"]), 91 Committer("Collin Jackson", "collinj@webkit.org"), 92 Committer("Csaba Osztrogonac", "ossy@webkit.org"), 93 Committer("Daniel Bates", "dbates@webkit.org"), 94 Committer("David Smith", ["catfish.man@gmail.com", "dsmith@webkit.org"]), 95 Committer("Dean Jackson", "dino@apple.com"), 96 Committer("Dirk Pranke", "dpranke@chromium.org"), 97 Committer("Drew Wilson", "atwilson@chromium.org"), 98 Committer("Dumitru Daniliuc", "dumi@chromium.org"), 99 Committer("Eli Fidler", "eli@staikos.net"), 100 Committer("Enrica Casucci", "enrica@apple.com"), 101 Committer("Erik Arvidsson", "arv@chromium.org"), 102 Committer("Eric Roman", "eroman@chromium.org"), 103 Committer("Feng Qian", "feng@chromium.org"), 104 Committer("Fumitoshi Ukai", "ukai@chromium.org"), 105 Committer("Gabor Loki", "loki@webkit.org"), 106 Committer("Girish Ramakrishnan", ["girish@forwardbias.in", "ramakrishnan.girish@gmail.com"]), 107 Committer("Graham Dennis", ["Graham.Dennis@gmail.com", "gdennis@webkit.org"]), 108 Committer("Greg Bolsinga", "bolsinga@apple.com"), 109 Committer("Hin-Chung Lam", ["hclam@google.com", "hclam@chromium.org"]), 110 Committer("Jakob Petsovits", ["jpetsovits@rim.com", "jpetso@gmx.at"]), 111 Committer("Jens Alfke", ["snej@chromium.org", "jens@apple.com"]), 112 Committer("Jeremy Moskovich", ["playmobil@google.com", "jeremy@chromium.org"]), 113 Committer("Jessie Berlin", ["jberlin@webkit.org", "jberlin@apple.com"]), 114 Committer("Jian Li", "jianli@chromium.org"), 115 Committer("John Abd-El-Malek", "jam@chromium.org"), 116 Committer("Joost de Valk", ["joost@webkit.org", "webkit-dev@joostdevalk.nl"]), 117 Committer("Joseph Pecoraro", "joepeck@webkit.org"), 118 Committer("Julie Parent", ["jparent@google.com", "jparent@chromium.org"]), 119 Committer("Julien Chaffraix", ["jchaffraix@webkit.org", "julien.chaffraix@gmail.com"]), 120 Committer("Jungshik Shin", "jshin@chromium.org"), 121 Committer("Keishi Hattori", "keishi@webkit.org"), 122 Committer("Kelly Norton", "knorton@google.com"), 123 Committer("Kenneth Russell", "kbr@google.com"), 124 Committer("Kent Tamura", "tkent@chromium.org"), 125 Committer("Krzysztof Kowalczyk", "kkowalczyk@gmail.com"), 126 Committer("Levi Weintraub", "lweintraub@apple.com"), 127 Committer("Mads Ager", "ager@chromium.org"), 128 Committer("Matt Lilek", ["webkit@mattlilek.com", "pewtermoose@webkit.org"]), 129 Committer("Matt Perry", "mpcomplete@chromium.org"), 130 Committer("Maxime Britto", ["maxime.britto@gmail.com", "britto@apple.com"]), 131 Committer("Maxime Simon", ["simon.maxime@gmail.com", "maxime.simon@webkit.org"]), 132 Committer("Martin Robinson", ["mrobinson@webkit.org", "martin.james.robinson@gmail.com"]), 133 Committer("Michelangelo De Simone", "michelangelo@webkit.org"), 134 Committer("Mike Belshe", ["mbelshe@chromium.org", "mike@belshe.com"]), 135 Committer("Mike Fenton", ["mike.fenton@torchmobile.com", "mifenton@rim.com"]), 136 Committer("Mike Thole", ["mthole@mikethole.com", "mthole@apple.com"]), 137 Committer("Mikhail Naganov", "mnaganov@chromium.org"), 138 Committer("Ojan Vafai", "ojan@chromium.org"), 139 Committer("Pam Greene", "pam@chromium.org"), 140 Committer("Peter Kasting", ["pkasting@google.com", "pkasting@chromium.org"]), 141 Committer("Philippe Normand", ["pnormand@igalia.com", "philn@webkit.org"]), 142 Committer("Pierre d'Herbemont", ["pdherbemont@free.fr", "pdherbemont@apple.com"]), 143 Committer("Pierre-Olivier Latour", "pol@apple.com"), 144 Committer("Roland Steiner", "rolandsteiner@chromium.org"), 145 Committer("Ryosuke Niwa", "rniwa@webkit.org"), 146 Committer("Scott Violet", "sky@chromium.org"), 147 Committer("Stephen White", "senorblanco@chromium.org"), 148 Committer("Steve Block", "steveblock@google.com"), 149 Committer("Tony Chang", "tony@chromium.org"), 150 Committer("Trey Matteson", "trey@usa.net"), 151 Committer("Tristan O'Tierney", ["tristan@otierney.net", "tristan@apple.com"]), 152 Committer("Victor Wang", "victorw@chromium.org"), 153 Committer("William Siegrist", "wsiegrist@apple.com"), 154 Committer("Yael Aharon", "yael.aharon@nokia.com"), 155 Committer("Yaar Schnitman", ["yaar@chromium.org", "yaar@google.com"]), 156 Committer("Yong Li", ["yong.li@torchmobile.com", "yong.li.webkit@gmail.com"]), 157 Committer("Yongjun Zhang", "yongjun.zhang@nokia.com"), 158 Committer("Yury Semikhatsky", "yurys@chromium.org"), 159 Committer("Yuzo Fujishima", "yuzo@google.com"), 160 Committer("Zoltan Herczeg", "zherczeg@webkit.org"), 161 Committer("Zoltan Horvath", "zoltan@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 170reviewers_list = [ 171 Reviewer("Ada Chan", "adachan@apple.com"), 172 Reviewer("Adam Barth", "abarth@webkit.org"), 173 Reviewer("Adam Roben", "aroben@apple.com"), 174 Reviewer("Adam Treat", ["treat@kde.org", "treat@webkit.org"]), 175 Reviewer("Adele Peterson", "adele@apple.com"), 176 Reviewer("Alexey Proskuryakov", ["ap@webkit.org", "ap@apple.com"]), 177 Reviewer("Alice Liu", "alice.liu@apple.com"), 178 Reviewer("Alp Toker", ["alp@nuanti.com", "alp@atoker.com", "alp@webkit.org"]), 179 Reviewer("Anders Carlsson", ["andersca@apple.com", "acarlsson@apple.com"]), 180 Reviewer("Antti Koivisto", ["koivisto@iki.fi", "antti@apple.com"]), 181 Reviewer("Ariya Hidayat", ["ariya.hidayat@gmail.com", "ariya@webkit.org"]), 182 Reviewer("Beth Dakin", "bdakin@apple.com"), 183 Reviewer("Brady Eidson", "beidson@apple.com"), 184 Reviewer("Cameron Zwarich", ["zwarich@apple.com", "cwzwarich@apple.com", "cwzwarich@webkit.org"]), 185 Reviewer("Chris Blumenberg", "cblu@apple.com"), 186 Reviewer("Dan Bernstein", ["mitz@webkit.org", "mitz@apple.com"]), 187 Reviewer("Darin Adler", "darin@apple.com"), 188 Reviewer("Darin Fisher", ["fishd@chromium.org", "darin@chromium.org"]), 189 Reviewer("David Harrison", "harrison@apple.com"), 190 Reviewer("David Hyatt", "hyatt@apple.com"), 191 Reviewer("David Kilzer", ["ddkilzer@webkit.org", "ddkilzer@apple.com"]), 192 Reviewer("David Levin", "levin@chromium.org"), 193 Reviewer("Dimitri Glazkov", "dglazkov@chromium.org"), 194 Reviewer("Dirk Schulze", "krit@webkit.org"), 195 Reviewer("Dmitry Titov", "dimich@chromium.org"), 196 Reviewer("Don Melton", "gramps@apple.com"), 197 Reviewer("Eric Carlson", "eric.carlson@apple.com"), 198 Reviewer("Eric Seidel", "eric@webkit.org"), 199 Reviewer("Gavin Barraclough", "barraclough@apple.com"), 200 Reviewer("Geoffrey Garen", "ggaren@apple.com"), 201 Reviewer("George Staikos", ["staikos@kde.org", "staikos@webkit.org"]), 202 Reviewer("Gustavo Noronha Silva", ["gns@gnome.org", "kov@webkit.org"]), 203 Reviewer("Holger Freyther", ["zecke@selfish.org", "zecke@webkit.org"]), 204 Reviewer("Jan Alonzo", ["jmalonzo@gmail.com", "jmalonzo@webkit.org"]), 205 Reviewer("Jeremy Orlow", "jorlow@chromium.org"), 206 Reviewer("John Sullivan", "sullivan@apple.com"), 207 Reviewer("Jon Honeycutt", "jhoneycutt@apple.com"), 208 Reviewer("Justin Garcia", "justin.garcia@apple.com"), 209 Reviewer("Ken Kocienda", "kocienda@apple.com"), 210 Reviewer("Kenneth Rohde Christiansen", ["kenneth@webkit.org", "kenneth.christiansen@openbossa.org"]), 211 Reviewer("Kevin Decker", "kdecker@apple.com"), 212 Reviewer("Kevin McCullough", "kmccullough@apple.com"), 213 Reviewer("Kevin Ollivier", ["kevino@theolliviers.com", "kevino@webkit.org"]), 214 Reviewer("Lars Knoll", ["lars@trolltech.com", "lars@kde.org"]), 215 Reviewer("Laszlo Gombos", "laszlo.1.gombos@nokia.com"), 216 Reviewer("Maciej Stachowiak", "mjs@apple.com"), 217 Reviewer("Mark Rowe", "mrowe@apple.com"), 218 Reviewer("Nate Chapin", "japhet@chromium.org"), 219 Reviewer("Nikolas Zimmermann", ["zimmermann@kde.org", "zimmermann@physik.rwth-aachen.de", "zimmermann@webkit.org"]), 220 Reviewer("Oliver Hunt", "oliver@apple.com"), 221 Reviewer("Pavel Feldman", "pfeldman@chromium.org"), 222 Reviewer("Richard Williamson", "rjw@apple.com"), 223 Reviewer("Rob Buis", ["rwlbuis@gmail.com", "rwlbuis@webkit.org"]), 224 Reviewer("Sam Weinig", ["sam@webkit.org", "weinig@apple.com"]), 225 Reviewer("Shinichiro Hamaji", "hamaji@chromium.org"), 226 Reviewer("Simon Fraser", "simon.fraser@apple.com"), 227 Reviewer("Simon Hausmann", ["hausmann@webkit.org", "hausmann@kde.org", "simon.hausmann@nokia.com"]), 228 Reviewer("Stephanie Lewis", "slewis@apple.com"), 229 Reviewer("Steve Falkenburg", "sfalken@apple.com"), 230 Reviewer("Tim Omernick", "timo@apple.com"), 231 Reviewer("Timothy Hatcher", ["timothy@hatcher.name", "timothy@apple.com"]), 232 Reviewer(u'Tor Arne Vestb\xf8', "vestbo@webkit.org"), 233 Reviewer("Vicki Murley", "vicki@apple.com"), 234 Reviewer("Xan Lopez", ["xan.lopez@gmail.com", "xan@gnome.org", "xan@webkit.org"]), 235 Reviewer("Zack Rusin", "zack@kde.org"), 236] 237 238 239class 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