Add rafaelw as a committer.
[WebKit-https.git] / Tools / Scripts / webkitpy / common / config / committers.py
1 # Copyright (c) 2011, Apple Inc. All rights reserved.
2 # Copyright (c) 2009, 2011, 2012 Google Inc. All rights reserved.
3 #
4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are
6 # met:
7 #
8 #     * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer.
10 #     * Redistributions in binary form must reproduce the above
11 # copyright notice, this list of conditions and the following disclaimer
12 # in the documentation and/or other materials provided with the
13 # distribution.
14 #     * Neither the name of Google Inc. nor the names of its
15 # contributors may be used to endorse or promote products derived from
16 # this software without specific prior written permission.
17 #
18 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 #
30 # WebKit's Python module for committer and reviewer validation.
31
32 from webkitpy.common.editdistance import edit_distance
33
34 class Account(object):
35     def __init__(self, name, email_or_emails, irc_nickname_or_nicknames=None):
36         assert(name)
37         assert(email_or_emails)
38         self.full_name = name
39         if isinstance(email_or_emails, str):
40             self.emails = [email_or_emails]
41         else:
42             self.emails = email_or_emails
43         self.emails = map(lambda email: email.lower(), self.emails)  # Emails are case-insensitive.
44         if isinstance(irc_nickname_or_nicknames, str):
45             self.irc_nicknames = [irc_nickname_or_nicknames]
46         else:
47             self.irc_nicknames = irc_nickname_or_nicknames
48         self.can_commit = False
49         self.can_review = False
50
51     def bugzilla_email(self):
52         # FIXME: We're assuming the first email is a valid bugzilla email,
53         # which might not be right.
54         return self.emails[0]
55
56     def __str__(self):
57         return '"%s" <%s>' % (self.full_name, self.emails[0])
58
59     def contains_string(self, search_string):
60         string = search_string.lower()
61         if string in self.full_name.lower():
62             return True
63         if self.irc_nicknames:
64             for nickname in self.irc_nicknames:
65                 if string in nickname.lower():
66                     return True
67         for email in self.emails:
68             if string in email:
69                 return True
70         return False
71
72
73 class Contributor(Account):
74     def __init__(self, name, email_or_emails, irc_nickname=None):
75         Account.__init__(self, name, email_or_emails, irc_nickname)
76         self.is_contributor = True
77
78
79 class Committer(Contributor):
80     def __init__(self, name, email_or_emails, irc_nickname=None):
81         Contributor.__init__(self, name, email_or_emails, irc_nickname)
82         self.can_commit = True
83
84
85 class Reviewer(Committer):
86     def __init__(self, name, email_or_emails, irc_nickname=None):
87         Committer.__init__(self, name, email_or_emails, irc_nickname)
88         self.can_review = True
89
90
91 # This is a list of email addresses that have bugzilla accounts but are not
92 # used for contributing (such as mailing lists).
93
94
95 watchers_who_are_not_contributors = [
96     Account("Chromium Compositor Bugs", ["cc-bugs@google.com"], ""),
97     Account("David Levin", ["levin+threading@chromium.org"], ""),
98     Account("David Levin", ["levin+watchlist@chromium.org"], ""),
99 ]
100
101
102 # This is a list of people (or bots) who are neither committers nor reviewers, but get
103 # frequently CC'ed by others on Bugzilla bugs, so their names should be
104 # supported by autocomplete. No review needed to add to the list.
105
106
107 contributors_who_are_not_committers = [
108     Contributor("Adam Kallai", "kallai.adam@stud.u-szeged.hu", 'kadam'),
109     Contributor("Aharon Lanin", "aharon@google.com"),
110     Contributor("Alan Stearns", "stearns@adobe.com", 'astearns'),
111     Contributor("Alexandre Elias", "aelias@chromium.org"),
112     Contributor("Alexey Marinichev", ["amarinichev@chromium.org", "amarinichev@google.com"], "amarinichev"),
113     Contributor("Andras Piroska", "pandras@inf.u-szeged.hu", "andris88"),
114     Contributor("Anne van Kesteren", "annevankesteren+webkit@gmail.com", "annevk"),
115     Contributor("Annie Sullivan", "sullivan@chromium.org", "annie"),
116     Contributor("Aryeh Gregor", "ayg@aryeh.name", "AryehGregor"),
117     Contributor("Balazs Ankes", "ankes.balazs@stud.u-szeged.hu", 'abalazs'),
118     Contributor("Commit Queue", "commit-queue@webkit.org"),
119     Contributor("Dana Jansens", "danakj@chromium.org", "danakj"),
120     Contributor("Daniel Sievers", "sievers@chromium.org"),
121     Contributor("David Barr", "davidbarr@chromium.org", "barrbrain"),
122     Contributor("David Dorwin", "ddorwin@chromium.org", "ddorwin"),
123     Contributor("David Reveman", "reveman@chromium.org", "reveman"),
124     Contributor("Douglas Davidson", "ddavidso@apple.com"),
125     Contributor("Edward O'Connor", "eoconnor@apple.com", "hober"),
126     Contributor("Eric Penner", "epenner@chromium.org", "epenner"),
127     Contributor("Felician Marton", ["felician@inf.u-szeged.hu", "marton.felician.zoltan@stud.u-szeged.hu"], "Felician"),
128     Contributor("Finnur Thorarinsson", ["finnur@chromium.org", "finnur.webkit@gmail.com"], "finnur"),
129     Contributor("Grace Kloba", "klobag@chromium.org", "klobag"),
130     Contributor("Greg Simon", "gregsimon@chromium.org", "gregsimon"),
131     Contributor("Gregg Tavares", ["gman@google.com", "gman@chromium.org"], "gman"),
132     Contributor("Ian Hickson", "ian@hixie.ch", "hixie"),
133     Contributor("Janos Badics", "dicska@gmail.hu", 'dicska'),
134     Contributor("John Bates", ["jbates@google.com", "jbates@chromium.org"], "jbates"),
135     Contributor("John Bauman", ["jbauman@chromium.org", "jbauman@google.com"], "jbauman"),
136     Contributor("Kaustubh Atrawalkar", ["kaustubh@motorola.com"], "silverroots"),
137     Contributor("Kulanthaivel Palanichamy", "kulanthaivel@codeaurora.org", "kvel"),
138     Contributor("Nandor Huszka", "huszka.nandor@stud.u-szeged.hu", "hnandor"),
139     Contributor("Oliver Varga", ["voliver@inf.u-szeged.hu", "Varga.Oliver@stud.u-szeged.hu"], "TwistO"),
140     Contributor("Peter Gal", "galpeter@inf.u-szeged.hu", "elecro"),
141     Contributor("Peter Linss", "peter.linss@hp.com", "plinss"),
142     Contributor("Radar WebKit Bug Importer", "webkit-bug-importer@group.apple.com"),
143     Contributor("Roland Takacs", "takacs.roland@stud.u-szeged.hu", "rtakacs"),
144     Contributor("Szilard Ledan-Muntean", "muntean-ledan.szilard@stud.u-szeged.hu", "szledan"),
145     Contributor("Tab Atkins", ["tabatkins@google.com", "jackalmage@gmail.com"], "tabatkins"),
146     Contributor("Tamas Czene", ["tczene@inf.u-szeged.hu", "Czene.Tamas@stud.u-szeged.hu"], "tczene"),
147     Contributor("WebKit Review Bot", "webkit.review.bot@gmail.com", "sheriff-bot"),
148     Contributor("Wyatt Carss", ["wcarss@chromium.org", "wcarss@google.com"], "wcarss"),
149     Contributor("Zoltan Arvai", "zarvai@inf.u-szeged.hu", "azbest_hu"),
150     Contributor("Zsolt Feher", "feherzs@inf.u-szeged.hu", "Smith"),
151 ]
152
153
154 # This is intended as a canonical, machine-readable list of all non-reviewer
155 # committers for WebKit.  If your name is missing here and you are a committer,
156 # please add it.  No review needed.  All reviewers are committers, so this list
157 # is only of committers who are not reviewers.
158
159
160 committers_unable_to_review = [
161     Committer("Aaron Boodman", "aa@chromium.org", "aboodman"),
162     Committer("Abhishek Arya", "inferno@chromium.org", "inferno-sec"),
163     Committer("Adam Klein", "adamk@chromium.org", "aklein"),
164     Committer("Adam Langley", "agl@chromium.org", "agl"),
165     Committer("Ademar de Souza Reis Jr", ["ademar.reis@gmail.com", "ademar@webkit.org"], "ademar"),
166     Committer("Adrienne Walker", ["enne@google.com", "enne@chromium.org"], "enne"),
167     Committer("Albert J. Wong", "ajwong@chromium.org"),
168     Committer("Alexander Kellett", ["lypanov@mac.com", "a-lists001@lypanov.net", "lypanov@kde.org"], "lypanov"),
169     Committer("Alexander Pavlov", "apavlov@chromium.org", "apavlov"),
170     Committer("Alexandru Chiculita", "achicu@adobe.com", "achicu"),
171     Committer("Alexis Menard", ["alexis.menard@openbossa.org", "menard@kde.org", "alexis.menard@nokia.com"], "darktears"),
172     Committer("Alice Boxhall", "aboxhall@chromium.org", "aboxhall"),
173     Committer("Alok Priyadarshi", "alokp@chromium.org", "alokp"),
174     Committer("Ami Fischman", ["fischman@chromium.org", "fischman@google.com"], "fischman"),
175     Committer("Amruth Raj", "amruthraj@motorola.com", "amruthraj"),
176     Committer("Andre Boule", "aboule@apple.com"),
177     Committer("Andrei Popescu", "andreip@google.com", "andreip"),
178     Committer("Andrew Wellington", ["andrew@webkit.org", "proton@wiretapped.net"], "proton"),
179     Committer("Andrew Scherkus", "scherkus@chromium.org", "scherkus"),
180     Committer("Andrey Kosyakov", "caseq@chromium.org", "caseq"),
181     Committer("Andras Becsi", ["abecsi@webkit.org", "andras.becsi@nokia.com"], "bbandix"),
182     Committer("Andy Wingo", "wingo@igalia.com", "wingo"),
183     Committer("Anna Cavender", "annacc@chromium.org", "annacc"),
184     Committer("Anthony Ricaud", "rik@webkit.org", "rik"),
185     Committer("Antoine Labour", "piman@chromium.org", "piman"),
186     Committer("Anton D'Auria", "adauria@apple.com", "antonlefou"),
187     Committer("Anton Muhin", "antonm@chromium.org", "antonm"),
188     Committer("Balazs Kelemen", "kbalazs@webkit.org", "kbalazs"),
189     Committer("Ben Murdoch", "benm@google.com", "benm"),
190     Committer("Ben Wells", "benwells@chromium.org", "benwells"),
191     Committer("Benjamin C Meyer", ["ben@meyerhome.net", "ben@webkit.org", "bmeyer@rim.com"], "icefox"),
192     Committer("Benjamin Kalman", ["kalman@chromium.org", "kalman@google.com"], "kalman"),
193     Committer("Benjamin Otte", ["otte@gnome.org", "otte@webkit.org"], "otte"),
194     Committer("Brett Wilson", "brettw@chromium.org", "brettx"),
195     Committer("Caio Marcelo de Oliveira Filho", ["cmarcelo@webkit.org", "caio.oliveira@openbossa.org"], "cmarcelo"),
196     Committer("Cameron McCormack", ["cam@mcc.id.au", "cam@webkit.org"], "heycam"),
197     Committer("Carlos Garcia Campos", ["cgarcia@igalia.com", "carlosgc@gnome.org", "carlosgc@webkit.org"], "KaL"),
198     Committer("Carol Szabo", ["carol@webkit.org", "carol.szabo@nokia.com"], "cszabo1"),
199     Committer("Cary Clark", ["caryclark@google.com", "caryclark@chromium.org"], "caryclark"),
200     Committer("Chris Evans", ["cevans@google.com", "cevans@chromium.org"]),
201     Committer("Chris Guillory", ["ctguil@chromium.org", "chris.guillory@google.com"], "ctguil"),
202     Committer("Chris Petersen", "cpetersen@apple.com", "cpetersen"),
203     Committer("Christian Dywan", ["christian@twotoasts.de", "christian@webkit.org", "christian@lanedo.com"]),
204     Committer("Collin Jackson", "collinj@webkit.org", "collinjackson"),
205     Committer("Cris Neckar", "cdn@chromium.org", "cneckar"),
206     Committer("Dan Winship", "danw@gnome.org", "danw"),
207     Committer("Daniel Cheng", "dcheng@chromium.org", "dcheng"),
208     Committer("David Grogan", ["dgrogan@chromium.org", "dgrogan@google.com"], "dgrogan"),
209     Committer("David Smith", ["catfish.man@gmail.com", "dsmith@webkit.org"], "catfishman"),
210     Committer("Diego Gonzalez", ["diegohcg@webkit.org", "diego.gonzalez@openbossa.org"], "diegohcg"),
211     Committer("Dmitry Lomov", ["dslomov@google.com", "dslomov@chromium.org"], "dslomov"),
212     Committer("Dominic Cooney", ["dominicc@chromium.org", "dominicc@google.com"], "dominicc"),
213     Committer("Dominic Mazzoni", ["dmazzoni@google.com", "dmazzoni@chromium.org"], "dmazzoni"),
214     Committer("Drew Wilson", "atwilson@chromium.org", "atwilson"),
215     Committer("Eli Fidler", ["eli@staikos.net", "efidler@rim.com"], "efidler"),
216     Committer("Emil A Eklund", "eae@chromium.org", "eae"),
217     Committer("Erik Arvidsson", "arv@chromium.org", "arv"),
218     Committer("Eric Roman", "eroman@chromium.org", "eroman"),
219     Committer("Eric Uhrhane", "ericu@chromium.org", "ericu"),
220     Committer("Evan Martin", "evan@chromium.org", "evmar"),
221     Committer("Evan Stade", "estade@chromium.org", "estade"),
222     Committer("Fady Samuel", "fsamuel@chromium.org", "fsamuel"),
223     Committer("Feng Qian", "feng@chromium.org"),
224     Committer("Fumitoshi Ukai", "ukai@chromium.org", "ukai"),
225     Committer("Gabor Loki", "loki@webkit.org", "loki04"),
226     Committer("Gabor Rapcsanyi", ["rgabor@webkit.org", "rgabor@inf.u-szeged.hu"], "rgabor"),
227     Committer("Gavin Peters", ["gavinp@chromium.org", "gavinp@webkit.org", "gavinp@google.com"], "gavinp"),
228     Committer("Girish Ramakrishnan", ["girish@forwardbias.in", "ramakrishnan.girish@gmail.com"], "girishr"),
229     Committer("Graham Dennis", ["Graham.Dennis@gmail.com", "gdennis@webkit.org"]),
230     Committer("Greg Bolsinga", "bolsinga@apple.com"),
231     Committer("Gyuyoung Kim", ["gyuyoung.kim@samsung.com", "gyuyoung.kim@webkit.org"], "gyuyoung"),
232     Committer("Hans Wennborg", "hans@chromium.org", "hwennborg"),
233     Committer("Hayato Ito", "hayato@chromium.org", "hayato"),
234     Committer("Helder Correia", "helder@sencha.com", "helder"),
235     Committer("Hin-Chung Lam", ["hclam@google.com", "hclam@chromium.org"]),
236     Committer("Igor Trindade Oliveira", ["igor.oliveira@webkit.org", "igor.oliveira@openbossa.org"], "igoroliveira"),
237     Committer("Ilya Sherman", "isherman@chromium.org", "isherman"),
238     Committer("Ilya Tikhonovsky", "loislo@chromium.org", "loislo"),
239     Committer("Ivan Krsti\u0107", "ike@apple.com"),
240     Committer("Jakob Petsovits", ["jpetsovits@rim.com", "jpetso@gmx.at"], "jpetso"),
241     Committer("Jakub Wieczorek", "jwieczorek@webkit.org", "fawek"),
242     Committer("James Hawkins", ["jhawkins@chromium.org", "jhawkins@google.com"], "jhawkins"),
243     Committer("James Kozianski", ["koz@chromium.org", "koz@google.com"], "koz"),
244     Committer("James Simonsen", "simonjam@chromium.org", "simonjam"),
245     Committer("Jarred Nicholls", ["jarred@webkit.org", "jarred@sencha.com"], "jarrednicholls"),
246     Committer("Jay Civelli", "jcivelli@chromium.org", "jcivelli"),
247     Committer("Jeff Miller", "jeffm@apple.com", "jeffm7"),
248     Committer("Jeffrey Pfau", ["jeffrey@endrift.com", "jpfau@apple.com"], "jpfau"),
249     Committer("Jenn Braithwaite", "jennb@chromium.org", "jennb"),
250     Committer("Jens Alfke", ["snej@chromium.org", "jens@apple.com"]),
251     Committer("Jer Noble", "jer.noble@apple.com", "jernoble"),
252     Committer("Jeremy Moskovich", ["playmobil@google.com", "jeremy@chromium.org"], "jeremymos"),
253     Committer("Jessie Berlin", ["jberlin@webkit.org", "jberlin@apple.com"]),
254     Committer("Jesus Sanchez-Palencia", ["jesus@webkit.org", "jesus.palencia@openbossa.org"], "jeez_"),
255     Committer("Jia Pu", "jpu@apple.com"),
256     Committer("Jocelyn Turcotte", "jocelyn.turcotte@nokia.com", "jturcotte"),
257     Committer("Jochen Eisinger", "jochen@chromium.org", "jochen__"),
258     Committer("John Abd-El-Malek", "jam@chromium.org", "jam"),
259     Committer("John Gregg", ["johnnyg@google.com", "johnnyg@chromium.org"], "johnnyg"),
260     Committer("John Knottenbelt", "jknotten@chromium.org", "jknotten"),
261     Committer("Johnny Ding", ["jnd@chromium.org", "johnnyding.webkit@gmail.com"], "johnnyding"),
262     Committer("Jon Lee", "jonlee@apple.com", "jonlee"),
263     Committer("Joone Hur", ["joone.hur@collabora.co.uk", "joone@kldp.org", "joone@webkit.org"], "joone"),
264     Committer("Joost de Valk", ["joost@webkit.org", "webkit-dev@joostdevalk.nl"], "Altha"),
265     Committer("Joshua Bell", ["jsbell@chromium.org", "jsbell@google.com"], "jsbell"),
266     Committer("Julie Parent", ["jparent@google.com", "jparent@chromium.org"], "jparent"),
267     Committer("Jungshik Shin", "jshin@chromium.org"),
268     Committer("Justin Schuh", "jschuh@chromium.org", "jschuh"),
269     Committer("Keishi Hattori", "keishi@webkit.org", "keishi"),
270     Committer("Kelly Norton", "knorton@google.com"),
271     Committer("Kenichi Ishibashi", "bashi@chromium.org", "bashi"),
272     Committer("Kenji Imasaki", "imasaki@chromium.org", "imasaki"),
273     Committer("Kent Hansen", "kent.hansen@nokia.com", "khansen"),
274     Committer(u"Kim Gr\u00f6nholm", "kim.1.gronholm@nokia.com"),
275     Committer("Kimmo Kinnunen", ["kimmo.t.kinnunen@nokia.com", "kimmok@iki.fi", "ktkinnun@webkit.org"], "kimmok"),
276     Committer("Kinuko Yasuda", "kinuko@chromium.org", "kinuko"),
277     Committer("Kristof Kosztyo", "kkristof@inf.u-szeged.hu", "kkristof"),
278     Committer("Krzysztof Kowalczyk", "kkowalczyk@gmail.com"),
279     Committer("Kwang Yul Seo", ["kwangyul.seo@gmail.com", "skyul@company100.net", "kseo@webkit.org"], "kwangseo"),
280     Committer("Leandro Gracia Gil", "leandrogracia@chromium.org", "leandrogracia"),
281     Committer("Leandro Pereira", ["leandro@profusion.mobi", "leandro@webkit.org"], "acidx"),
282     Committer("Leo Yang", ["leo.yang@torchmobile.com.cn", "leoyang@webkit.org", "leoyang.webkit@gmail.com", "leo.yang.c@gmail.com"], "leoyang"),
283     Committer("Levi Weintraub", ["leviw@chromium.org", "leviw@google.com", "lweintraub@apple.com"], "leviw"),
284     Committer("Lucas De Marchi", ["demarchi@webkit.org", "lucas.demarchi@profusion.mobi"], "demarchi"),
285     Committer("Lucas Forschler", ["lforschler@apple.com"], "lforschler"),
286     Committer("Luke Macpherson", ["macpherson@chromium.org", "macpherson@google.com"], "macpherson"),
287     Committer("Mads Ager", "ager@chromium.org"),
288     Committer("Mahesh Kulkarni", "mahesh.kulkarni@nokia.com", "maheshk"),
289     Committer("Marcus Voltis Bulach", "bulach@chromium.org"),
290     Committer("Mario Sanchez Prada", ["msanchez@igalia.com", "mario@webkit.org"], "msanchez"),
291     Committer("Mark Hahnenberg", "mhahnenberg@apple.com"),
292     Committer("Matt Delaney", "mdelaney@apple.com"),
293     Committer("Matt Lilek", ["mlilek@apple.com", "webkit@mattlilek.com", "pewtermoose@webkit.org"], "pewtermoose"),
294     Committer("Matt Perry", "mpcomplete@chromium.org"),
295     Committer("Maxime Britto", ["maxime.britto@gmail.com", "britto@apple.com"]),
296     Committer("Maxime Simon", ["simon.maxime@gmail.com", "maxime.simon@webkit.org"], "maxime.simon"),
297     Committer("Michael Nordman", "michaeln@google.com", "michaeln"),
298     Committer("Michelangelo De Simone", "michelangelo@webkit.org", "michelangelo"),
299     Committer("Mihnea Ovidenie", "mihnea@adobe.com", "mihnea"),
300     Committer("Mike Belshe", ["mbelshe@chromium.org", "mike@belshe.com"]),
301     Committer("Mike Fenton", ["mifenton@rim.com", "mike.fenton@torchmobile.com"], "mfenton"),
302     Committer("Mike Lawther", "mikelawther@chromium.org", "mikelawther"),
303     Committer("Mike Reed", "reed@google.com", "reed"),
304     Committer("Mike Thole", ["mthole@mikethole.com", "mthole@apple.com"]),
305     Committer("Mikhail Naganov", "mnaganov@chromium.org"),
306     Committer("Naoki Takano", ["honten@chromium.org", "takano.naoki@gmail.com"], "honten"),
307     Committer("Nat Duca", ["nduca@chromium.org", "nduca@google.com"], "nduca"),
308     Committer("Nayan Kumar K", ["nayankk@motorola.com", "nayankk@gmail.com"], "xc0ffee"),
309     Committer("Nico Weber", ["thakis@chromium.org", "thakis@google.com"], "thakis"),
310     Committer("Noel Gordon", ["noel.gordon@gmail.com", "noel@chromium.org", "noel@google.com"], "noel"),
311     Committer("Pam Greene", "pam@chromium.org", "pamg"),
312     Committer("Patrick Gansterer", ["paroga@paroga.com", "paroga@webkit.org"], "paroga"),
313     Committer("Pavel Podivilov", "podivilov@chromium.org", "podivilov"),
314     Committer("Peter Beverloo", ["peter@chromium.org", "beverloo@google.com"], "beverloo"),
315     Committer("Peter Kasting", ["pkasting@google.com", "pkasting@chromium.org"], "pkasting"),
316     Committer("Peter Varga", ["pvarga@webkit.org", "pvarga@inf.u-szeged.hu"], "stampho"),
317     Committer("Pierre d'Herbemont", ["pdherbemont@free.fr", "pdherbemont@apple.com"], "pdherbemont"),
318     Committer("Pierre-Olivier Latour", "pol@apple.com", "pol"),
319     Committer("Pierre Rossi", "pierre.rossi@gmail.com", "elproxy"),
320     Committer("Pratik Solanki", "psolanki@apple.com", "psolanki"),
321     Committer("Qi Zhang", ["qi.2.zhang@nokia.com", "qi.zhang02180@gmail.com"], "qi"),
322     Committer("Rafael Antognolli", "antognolli@profusion.mobi", "antognolli"),
323     Committer("Rafael Weinstein", "rafaelw@chromium.org", "rafaelw"),
324     Committer("Raphael Kubo da Costa", ["kubo@profusion.mobi", "rakuco@FreeBSD.org"], "rakuco"),
325     Committer("Ravi Kasibhatla", "ravi.kasibhatla@motorola.com", "kphanee"),
326     Committer("Renata Hodovan", "reni@webkit.org", "reni"),
327     Committer("Robert Hogan", ["robert@webkit.org", "robert@roberthogan.net", "lists@roberthogan.net"], "mwenge"),
328     Committer("Roland Steiner", "rolandsteiner@chromium.org"),
329     Committer("Ryuan Choi", "ryuan.choi@samsung.com", "ryuan"),
330     Committer("Satish Sampath", "satish@chromium.org"),
331     Committer("Scott Violet", "sky@chromium.org", "sky"),
332     Committer("Sergio Villar Senin", ["svillar@igalia.com", "sergio@webkit.org"], "svillar"),
333     Committer("Shawn Singh", "shawnsingh@chromium.org", "shawnsingh"),
334     Committer("Shinya Kawanaka", "shinyak@chromium.org", "shinyak"),
335     Committer("Siddharth Mathur", "siddharth.mathur@nokia.com", "simathur"),
336     Committer("Steve Lacey", "sjl@chromium.org", "stevela"),
337     Committer("Takashi Toyoshima", "toyoshim@chromium.org", "toyoshim"),
338     Committer("Thomas Sepez", "tsepez@chromium.org", "tsepez"),
339     Committer("Tim Horton", "timothy_horton@apple.com", "thorton"),
340     Committer("Tom Zakrajsek", "tomz@codeaurora.org", "tomz"),
341     Committer("Tommy Widenflycht", "tommyw@google.com", "tommyw"),
342     Committer("Trey Matteson", "trey@usa.net", "trey"),
343     Committer("Tristan O'Tierney", ["tristan@otierney.net", "tristan@apple.com"]),
344     Committer("Vangelis Kokkevis", "vangelis@chromium.org", "vangelis"),
345     Committer("Viatcheslav Ostapenko", "ostapenko.viatcheslav@nokia.com", "ostap"),
346     Committer("Victor Wang", "victorw@chromium.org", "victorw"),
347     Committer("Victoria Kirst", ["vrk@chromium.org", "vrk@google.com"], "vrk"),
348     Committer("Vincent Scheib", "scheib@chromium.org", "scheib"),
349     Committer("Vitaly Repeshko", "vitalyr@chromium.org"),
350     Committer("William Siegrist", "wsiegrist@apple.com", "wms"),
351     Committer("W. James MacLean", "wjmaclean@chromium.org", "wjmaclean"),
352     Committer("Xianzhu Wang", ["wangxianzhu@chromium.org", "phnixwxz@gmail.com", "wangxianzhu@google.com"], "wangxianzhu"),
353     Committer("Xiaomei Ji", "xji@chromium.org", "xji"),
354     Committer("Yael Aharon", "yael.aharon@nokia.com", "yael"),
355     Committer("Yaar Schnitman", ["yaar@chromium.org", "yaar@google.com"]),
356     Committer("Yong Li", ["yong.li.webkit@gmail.com", "yong.li@torchmobile.com", "yoli@rim.com"], "yong"),
357     Committer("Yongjun Zhang", ["yongjun.zhang@nokia.com", "yongjun_zhang@apple.com"]),
358     Committer("Yuqiang Xian", "yuqiang.xian@intel.com"),
359     Committer("Yi Shen", ["yi.4.shen@nokia.com", "shenyi2006@gmail.com"]),
360     Committer("Yuta Kitamura", "yutak@chromium.org", "yutak"),
361     Committer("Yuzo Fujishima", "yuzo@google.com", "yuzo"),
362     Committer("Zeno Albisser", ["zeno@webkit.org", "zeno.albisser@nokia.com"], "zalbisser"),
363     Committer("Zhenyao Mo", "zmo@google.com", "zhenyao"),
364     Committer("Zoltan Horvath", ["zoltan@webkit.org", "hzoltan@inf.u-szeged.hu", "horvath.zoltan.6@stud.u-szeged.hu"], "zoltan"),
365 ]
366
367
368 # This is intended as a canonical, machine-readable list of all reviewers for
369 # WebKit.  If your name is missing here and you are a reviewer, please add it.
370 # No review needed.
371
372
373 reviewers_list = [
374     Reviewer("Ada Chan", "adachan@apple.com", "chanada"),
375     Reviewer("Adam Barth", "abarth@webkit.org", "abarth"),
376     Reviewer("Adam Roben", "aroben@apple.com", "aroben"),
377     Reviewer("Adam Treat", ["treat@kde.org", "treat@webkit.org", "atreat@rim.com"], "manyoso"),
378     Reviewer("Alejandro G. Castro", ["alex@igalia.com", "alex@webkit.org"], "alexg__"),
379     Reviewer("Adele Peterson", "adele@apple.com", "adele"),
380     Reviewer("Alexey Proskuryakov", ["ap@webkit.org", "ap@apple.com"], "ap"),
381     Reviewer("Alice Liu", "alice.liu@apple.com", "aliu"),
382     Reviewer("Alp Toker", ["alp@nuanti.com", "alp@atoker.com", "alp@webkit.org"], "alp"),
383     Reviewer("Anders Carlsson", ["andersca@apple.com", "acarlsson@apple.com"], "andersca"),
384     Reviewer("Andreas Kling", ["kling@webkit.org", "awesomekling@apple.com", "andreas.kling@nokia.com"], "kling"),
385     Reviewer("Andy Estes", "aestes@apple.com", "estes"),
386     Reviewer("Antonio Gomes", ["tonikitoo@webkit.org", "agomes@rim.com"], "tonikitoo"),
387     Reviewer("Antti Koivisto", ["koivisto@iki.fi", "antti@apple.com", "antti.j.koivisto@nokia.com"], "anttik"),
388     Reviewer("Ariya Hidayat", ["ariya.hidayat@gmail.com", "ariya@sencha.com", "ariya@webkit.org"], "ariya"),
389     Reviewer("Benjamin Poulain", ["benjamin@webkit.org", "benjamin.poulain@nokia.com", "ikipou@gmail.com"], "benjaminp"),
390     Reviewer("Beth Dakin", "bdakin@apple.com", "dethbakin"),
391     Reviewer("Brady Eidson", "beidson@apple.com", "bradee-oh"),
392     Reviewer("Brent Fulgham", "bfulgham@webkit.org", "bfulgham"),
393     Reviewer("Brian Weinstein", "bweinstein@apple.com", "bweinstein"),
394     Reviewer("Cameron Zwarich", ["zwarich@apple.com", "cwzwarich@apple.com", "cwzwarich@webkit.org"]),
395     Reviewer("Chang Shu", ["cshu@webkit.org", "Chang.Shu@nokia.com"], "cshu"),
396     Reviewer("Chris Blumenberg", "cblu@apple.com", "cblu"),
397     Reviewer("Chris Marrin", "cmarrin@apple.com", "cmarrin"),
398     Reviewer("Chris Fleizach", "cfleizach@apple.com", "cfleizach"),
399     Reviewer("Chris Jerdonek", "cjerdonek@webkit.org", "cjerdonek"),
400     Reviewer("Chris Rogers", "crogers@google.com", "crogers"),
401     Reviewer(u"Csaba Osztrogon\u00e1c", "ossy@webkit.org", "ossy"),
402     Reviewer("Dan Bernstein", ["mitz@webkit.org", "mitz@apple.com"], "mitzpettel"),
403     Reviewer("Daniel Bates", ["dbates@webkit.org", "dbates@rim.com"], "dydz"),
404     Reviewer("Darin Adler", "darin@apple.com", "darin"),
405     Reviewer("Darin Fisher", ["fishd@chromium.org", "darin@chromium.org"], "fishd"),
406     Reviewer("David Harrison", "harrison@apple.com", "harrison"),
407     Reviewer("David Hyatt", "hyatt@apple.com", ["dhyatt", "hyatt"]),
408     Reviewer("David Kilzer", ["ddkilzer@webkit.org", "ddkilzer@apple.com"], "ddkilzer"),
409     Reviewer("David Levin", "levin@chromium.org", "dave_levin"),
410     Reviewer("Dean Jackson", "dino@apple.com", "dino"),
411     Reviewer("Dimitri Glazkov", "dglazkov@chromium.org", "dglazkov"),
412     Reviewer("Dirk Pranke", "dpranke@chromium.org", "dpranke"),
413     Reviewer("Dirk Schulze", "krit@webkit.org", "krit"),
414     Reviewer("Dmitry Titov", "dimich@chromium.org", "dimich"),
415     Reviewer("Don Melton", "gramps@apple.com", "gramps"),
416     Reviewer("Dumitru Daniliuc", "dumi@chromium.org", "dumi"),
417     Reviewer("Enrica Casucci", "enrica@apple.com", "enrica"),
418     Reviewer("Eric Carlson", "eric.carlson@apple.com", "eric_carlson"),
419     Reviewer("Eric Seidel", "eric@webkit.org", "eseidel"),
420     Reviewer("Filip Pizlo", "fpizlo@apple.com", "pizlo"),
421     Reviewer("Gavin Barraclough", "barraclough@apple.com", "gbarra"),
422     Reviewer("Geoffrey Garen", "ggaren@apple.com", "ggaren"),
423     Reviewer("George Staikos", ["staikos@kde.org", "staikos@webkit.org"]),
424     Reviewer("Gustavo Noronha Silva", ["gns@gnome.org", "kov@webkit.org", "gustavo.noronha@collabora.co.uk", "gustavo.noronha@collabora.com"], "kov"),
425     Reviewer("Hajime Morita", ["morrita@google.com", "morrita@chromium.org"], "morrita"),
426     Reviewer("Holger Freyther", ["zecke@selfish.org", "zecke@webkit.org"], "zecke"),
427     Reviewer("James Robinson", ["jamesr@chromium.org", "jamesr@google.com"], "jamesr"),
428     Reviewer("Jan Alonzo", ["jmalonzo@gmail.com", "jmalonzo@webkit.org"], "janm"),
429     Reviewer("Jeremy Orlow", ["jorlow@webkit.org", "jorlow@chromium.org"], "jorlow"),
430     Reviewer("Jian Li", "jianli@chromium.org", "jianli"),
431     Reviewer("John Sullivan", "sullivan@apple.com", "sullivan"),
432     Reviewer("Jon Honeycutt", "jhoneycutt@apple.com", "jhoneycutt"),
433     Reviewer("Joseph Pecoraro", ["joepeck@webkit.org", "pecoraro@apple.com"], "JoePeck"),
434     Reviewer("Julien Chaffraix", ["jchaffraix@webkit.org", "julien.chaffraix@gmail.com", "jchaffraix@google.com", "jchaffraix@codeaurora.org"], "jchaffraix"),
435     Reviewer("Justin Garcia", "justin.garcia@apple.com", "justing"),
436     Reviewer("Ken Kocienda", "kocienda@apple.com"),
437     Reviewer("Kenneth Rohde Christiansen", ["kenneth@webkit.org", "kenneth.christiansen@openbossa.org", "kenneth.christiansen@gmail.com"], ["kenne", "kenneth"]),
438     Reviewer("Kenneth Russell", "kbr@google.com", "kbr_google"),
439     Reviewer("Kent Tamura", ["tkent@chromium.org", "tkent@google.com"], "tkent"),
440     Reviewer("Kentaro Hara", ["haraken@chromium.org"], "haraken"),
441     Reviewer("Kevin Decker", "kdecker@apple.com", "superkevin"),
442     Reviewer("Kevin McCullough", "kmccullough@apple.com", "maculloch"),
443     Reviewer("Kevin Ollivier", ["kevino@theolliviers.com", "kevino@webkit.org"], "kollivier"),
444     Reviewer("Lars Knoll", ["lars@trolltech.com", "lars@kde.org", "lars.knoll@nokia.com"], "lars"),
445     Reviewer("Laszlo Gombos", "laszlo.1.gombos@nokia.com", "lgombos"),
446     Reviewer("Luiz Agostini", ["luiz@webkit.org", "luiz.agostini@openbossa.org"], "lca"),
447     Reviewer("Maciej Stachowiak", "mjs@apple.com", "othermaciej"),
448     Reviewer("Mark Rowe", "mrowe@apple.com", "bdash"),
449     Reviewer("Martin Robinson", ["mrobinson@webkit.org", "mrobinson@igalia.com", "martin.james.robinson@gmail.com"], "mrobinson"),
450     Reviewer("Michael Saboff", "msaboff@apple.com", "msaboff"),
451     Reviewer("Mihai Parparita", "mihaip@chromium.org", "mihaip"),
452     Reviewer("Nate Chapin", "japhet@chromium.org", ["japhet", "natechapin"]),
453     Reviewer("Nikolas Zimmermann", ["zimmermann@kde.org", "zimmermann@physik.rwth-aachen.de", "zimmermann@webkit.org", "nzimmermann@rim.com"], "wildfox"),
454     Reviewer("Noam Rosenthal", "noam.rosenthal@nokia.com", "noamr"),
455     Reviewer("Ojan Vafai", "ojan@chromium.org", "ojan"),
456     Reviewer("Oliver Hunt", "oliver@apple.com", "olliej"),
457     Reviewer("Pavel Feldman", ["pfeldman@chromium.org", "pfeldman@google.com"], "pfeldman"),
458     Reviewer("Philippe Normand", ["pnormand@igalia.com", "philn@webkit.org", "philn@igalia.com"], ["philn-tp", "pnormand"]),
459     Reviewer("Richard Williamson", "rjw@apple.com", "rjw"),
460     Reviewer("Rob Buis", ["rwlbuis@gmail.com", "rwlbuis@webkit.org", "rbuis@rim.com"], "rwlbuis"),
461     Reviewer("Ryosuke Niwa", "rniwa@webkit.org", "rniwa"),
462     Reviewer("Sam Weinig", ["sam@webkit.org", "weinig@apple.com"], "weinig"),
463     Reviewer("Shinichiro Hamaji", "hamaji@chromium.org", "hamaji"),
464     Reviewer("Simon Fraser", "simon.fraser@apple.com", "smfr"),
465     Reviewer("Simon Hausmann", ["hausmann@webkit.org", "hausmann@kde.org", "simon.hausmann@nokia.com"], "tronical"),
466     Reviewer("Stephanie Lewis", "slewis@apple.com", "sundiamonde"),
467     Reviewer("Stephen White", "senorblanco@chromium.org", "senorblanco"),
468     Reviewer("Steve Block", "steveblock@google.com", "steveblock"),
469     Reviewer("Steve Falkenburg", "sfalken@apple.com", "sfalken"),
470     Reviewer("Tim Omernick", "timo@apple.com"),
471     Reviewer("Timothy Hatcher", ["timothy@apple.com", "timothy@hatcher.name"], "xenon"),
472     Reviewer("Tony Chang", "tony@chromium.org", "tony^work"),
473     Reviewer("Tony Gentilcore", "tonyg@chromium.org", "tonyg-cr"),
474     Reviewer(u"Tor Arne Vestb\u00f8", ["vestbo@webkit.org", "tor.arne.vestbo@nokia.com"], "torarne"),
475     Reviewer("Vicki Murley", "vicki@apple.com"),
476     Reviewer("Vsevolod Vlasov", "vsevik@chromium.org", "vsevik"),
477     Reviewer("Xan Lopez", ["xan.lopez@gmail.com", "xan@gnome.org", "xan@webkit.org", "xlopez@igalia.com"], "xan"),
478     Reviewer("Yury Semikhatsky", "yurys@chromium.org", "yurys"),
479     Reviewer("Zack Rusin", "zack@kde.org", "zackr"),
480     Reviewer("Zoltan Herczeg", ["zherczeg@webkit.org", "zherczeg@inf.u-szeged.hu"], "zherczeg"),
481 ]
482
483 class CommitterList(object):
484
485     # Committers and reviewers are passed in to allow easy testing
486     def __init__(self,
487                  committers=committers_unable_to_review,
488                  reviewers=reviewers_list,
489                  contributors=contributors_who_are_not_committers,
490                  watchers=watchers_who_are_not_contributors):
491         self._accounts = watchers + contributors + committers + reviewers
492         self._contributors = contributors + committers + reviewers
493         self._committers = committers + reviewers
494         self._reviewers = reviewers
495         self._contributors_by_name = {}
496         self._accounts_by_email = {}
497         self._accounts_by_login = {}
498
499     def accounts(self):
500         return self._accounts
501
502     def contributors(self):
503         return self._contributors
504
505     def committers(self):
506         return self._committers
507
508     def reviewers(self):
509         return self._reviewers
510
511     def _name_to_contributor_map(self):
512         if not len(self._contributors_by_name):
513             for contributor in self._contributors:
514                 assert(contributor.full_name)
515                 assert(contributor.full_name.lower() not in self._contributors_by_name)  # We should never have duplicate names.
516                 self._contributors_by_name[contributor.full_name.lower()] = contributor
517         return self._contributors_by_name
518
519     def _email_to_account_map(self):
520         if not len(self._accounts_by_email):
521             for account in self._accounts:
522                 for email in account.emails:
523                     assert(email not in self._accounts_by_email)  # We should never have duplicate emails.
524                     self._accounts_by_email[email] = account
525         return self._accounts_by_email
526
527     def _login_to_account_map(self):
528         if not len(self._accounts_by_login):
529             for account in self._accounts:
530                 if account.emails:
531                     login = account.bugzilla_email()
532                     assert(login not in self._accounts_by_login)  # We should never have duplicate emails.
533                     self._accounts_by_login[login] = account
534         return self._accounts_by_login
535
536     def _contributor_only(self, record):
537         if record and not record.is_contributor:
538             return None
539         return record
540
541     def _committer_only(self, record):
542         if record and not record.can_commit:
543             return None
544         return record
545
546     def _reviewer_only(self, record):
547         if record and not record.can_review:
548             return None
549         return record
550
551     def committer_by_name(self, name):
552         return self._committer_only(self.contributor_by_name(name))
553
554     def contributor_by_irc_nickname(self, irc_nickname):
555         for contributor in self.contributors():
556             # FIXME: This should do case-insensitive comparison or assert that all IRC nicknames are in lowercase
557             if contributor.irc_nicknames and irc_nickname in contributor.irc_nicknames:
558                 return contributor
559         return None
560
561     def contributors_by_search_string(self, string):
562         return filter(lambda contributor: contributor.contains_string(string), self.contributors())
563
564     def contributors_by_email_username(self, string):
565         string = string + '@'
566         result = []
567         for contributor in self.contributors():
568             for email in contributor.emails:
569                 if email.startswith(string):
570                     result.append(contributor)
571                     break
572         return result
573
574     def _contributor_name_shorthands(self, contributor):
575         if ' ' not in contributor.full_name:
576             return []
577         split_fullname = contributor.full_name.split()
578         first_name = split_fullname[0]
579         last_name = split_fullname[-1]
580         return first_name, last_name, first_name + last_name[0], first_name + ' ' + last_name[0]
581
582     def _tokenize_contributor_name(self, contributor):
583         full_name_in_lowercase = contributor.full_name.lower()
584         tokens = [full_name_in_lowercase] + full_name_in_lowercase.split()
585         if contributor.irc_nicknames:
586             return tokens + [nickname.lower() for nickname in contributor.irc_nicknames if len(nickname) > 5]
587         return tokens
588
589     def contributors_by_fuzzy_match(self, string):
590         string_in_lowercase = string.lower()
591
592         # 1. Exact match for fullname, email and irc_nicknames
593         account = self.contributor_by_name(string_in_lowercase) or self.account_by_email(string_in_lowercase) or self.contributor_by_irc_nickname(string_in_lowercase)
594         if account:
595             return [account], 0
596
597         # 2. Exact match for email username (before @)
598         accounts = self.contributors_by_email_username(string_in_lowercase)
599         if accounts and len(accounts) == 1:
600             return accounts, 0
601
602         # 3. Exact match for first name, last name, and first name + initial combinations such as "Dan B" and "Tim H"
603         accounts = [contributor for contributor in self.contributors() if string in self._contributor_name_shorthands(contributor)]
604         if accounts and len(accounts) == 1:
605             return accounts, 0
606
607         # 4. Finally, fuzzy-match using edit-distance
608         string = string_in_lowercase
609         contributorWithMinDistance = []
610         minDistance = len(string) / 2 - 1
611         for contributor in self.contributors():
612             tokens = self._tokenize_contributor_name(contributor)
613             editdistances = [edit_distance(token, string) for token in tokens if abs(len(token) - len(string)) <= minDistance]
614             if not editdistances:
615                 continue
616             distance = min(editdistances)
617             if distance == minDistance:
618                 contributorWithMinDistance.append(contributor)
619             elif distance < minDistance:
620                 contributorWithMinDistance = [contributor]
621                 minDistance = distance
622         if not len(contributorWithMinDistance):
623             return [], len(string)
624         return contributorWithMinDistance, minDistance
625
626     def account_by_login(self, login):
627         return self._login_to_account_map().get(login.lower()) if login else None
628
629     def account_by_email(self, email):
630         return self._email_to_account_map().get(email.lower()) if email else None
631
632     def contributor_by_name(self, name):
633         return self._name_to_contributor_map().get(name.lower()) if name else None
634
635     def contributor_by_email(self, email):
636         return self._contributor_only(self.account_by_email(email))
637
638     def committer_by_email(self, email):
639         return self._committer_only(self.account_by_email(email))
640
641     def reviewer_by_email(self, email):
642         return self._reviewer_only(self.account_by_email(email))