2009-11-01 Jessie Berlin <jberlin@webkit.org>
[WebKit-https.git] / WebKitTools / Scripts / modules / committers.py
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 class Committer:
32     def __init__(self, name, email):
33         self.full_name = name
34         self.bugzilla_email = email
35         self.can_review = False
36
37     def __str__(self):
38         return '"%s" <%s>' % (self.full_name, self.bugzilla_email)
39
40 class Reviewer(Committer):
41     def __init__(self, name, email):
42         Committer.__init__(self, name, email)
43         self.can_review = True
44
45 # This is intended as a cannonical, machine-readable list of all non-reviewer committers for WebKit.
46 # If your name is missing here and you are a committer, please add it.  No review needed.
47 # All reviewers are committers, so this list is only of committers who are not reviewers.
48 committers_unable_to_review = [
49     Committer("Aaron Boodman", "aa@chromium.org"),
50     Committer("Adam Langley", "agl@chromium.org"),
51     Committer("Albert J. Wong", "ajwong@chromium.org"),
52     Committer("Anton Muhin", "antonm@chromium.org"),
53     Committer("Antonio Gomes", "tonikitoo@webkit.org"),
54     Committer("Anthony Ricaud", "rik@webkit.org"),
55     Committer("Ben Murdoch", "benm@google.com"),
56     Committer("Chris Fleizach", "cfleizach@apple.com"),
57     Committer("Brent Fulgham", "bfulgham@webkit.org"),
58     Committer("Brian Weinstein", "bweinstein@apple.com"),
59     Committer("Cameron McCormack", "cam@webkit.org"),
60     Committer("Collin Jackson", "collinj@webkit.org"),
61     Committer("Csaba Osztrogonac", "ossy@webkit.org"),
62     Committer("Daniel Bates", "dbates@webkit.org"),
63     Committer("Drew Wilson", "atwilson@chromium.org"),
64     Committer("Dirk Schulze", "krit@webkit.org"),
65     Committer("Dmitry Titov", "dimich@chromium.org"),
66     Committer("Dumitru Daniliuc", "dumi@chromium.org"),
67     Committer("Eli Fidler", "eli@staikos.net"),
68     Committer("Eric Roman", "eroman@chromium.org"),
69     Committer("Fumitoshi Ukai", "ukai@chromium.org"),
70     Committer("Greg Bolsinga", "bolsinga@apple.com"),
71     Committer("Jeremy Moskovich", "playmobil@google.com"),
72     Committer("Jeremy Orlow", "jorlow@chromium.org"),
73     Committer("Jessie Berlin", "jberlin@webkit.org"),
74     Committer("Jian Li", "jianli@chromium.org"),
75     Committer("John Abd-El-Malek", "jam@chromium.org"),
76     Committer("Joseph Pecoraro", "joepeck@webkit.org"),
77     Committer("Julie Parent", "jparent@google.com"),
78     Committer("Kenneth Rohde Christiansen", "kenneth@webkit.org"),
79     Committer("Kent Tamura", "tkent@chromium.org"),
80     Committer("Laszlo Gombos", "laszlo.1.gombos@nokia.com"),
81     Committer("Mads Ager", "ager@chromium.org"),
82     Committer("Mike Belshe", "mike@belshe.com"),
83     Committer("Nate Chapin", "japhet@chromium.org"),
84     Committer("Ojan Vafai", "ojan@chromium.org"),
85     Committer("Pam Greene", "pam@chromium.org"),
86     Committer("Peter Kasting", "pkasting@google.com"),
87     Committer("Pierre d'Herbemont", "pdherbemont@free.fr"),
88     Committer("Roland Steiner", "rolandsteiner@chromium.org"),
89     Committer("Ryosuke Niwa", "rniwa@webkit.org"),
90     Committer("Scott Violet", "sky@chromium.org"),
91     Committer("Shinichiro Hamaji", "hamaji@chromium.org"),
92     Committer("Steve Block", "steveblock@google.com"),
93     Committer("Tony Chang", "tony@chromium.org"),
94     Committer("Yael Aharon", "yael.aharon@nokia.com"),
95     Committer("Yong Li", "yong.li@torchmobile.com"),
96     Committer("Yury Semikhatsky", "yurys@chromium.org"),
97     Committer("Zoltan Horvath", "zoltan@webkit.org"),
98 ]
99
100 # This is intended as a cannonical, machine-readable list of all reviewers for WebKit.
101 # If your name is missing here and you are a reviewer, please add it.  No review needed.
102 reviewers_list = [
103     Reviewer("Adam Barth", "abarth@webkit.org"),
104     Reviewer("Ada Chan", "adachan@apple.com"),
105     Reviewer("Adam Roben", "aroben@apple.com"),
106     Reviewer("Adam Treat", "treat@kde.org"),
107     Reviewer("Adele Peterson", "adele@apple.com"),
108     Reviewer("Alexey Proskuryakov", "ap@webkit.org"),
109     Reviewer("Alice Liu", "alice.liu@apple.com"),
110     Reviewer("Alp Toker", "alp@nuanti.com"),
111     Reviewer("Anders Carlsson", "andersca@apple.com"),
112     Reviewer("Antti Koivisto", "koivisto@iki.fi"),
113     Reviewer("Ariya Hidayat", "ariya.hidayat@trolltech.com"),
114     Reviewer("Brady Eidson", "beidson@apple.com"),
115     Reviewer("Cameron Zwarich", "zwarich@apple.com"),
116     Reviewer("Dan Bernstein", "mitz@webkit.org"),
117     Reviewer("Darin Adler", "darin@apple.com"),
118     Reviewer("Darin Fisher", "fishd@chromium.org"),
119     Reviewer("David Harrison", "harrison@apple.com"),
120     Reviewer("David Hyatt", "hyatt@apple.com"),
121     Reviewer("David Kilzer", "ddkilzer@webkit.org"),
122     Reviewer("David Levin", "levin@chromium.org"),
123     Reviewer("Dimitri Glazkov", "dglazkov@chromium.org"),
124     Reviewer("Don Melton", "gramps@apple.com"),
125     Reviewer("Dmitri Titov", "dimich@chromium.org"),
126     Reviewer("Eric Carlson", "eric.carlson@apple.com"),
127     Reviewer("Eric Seidel", "eric@webkit.org"),
128     Reviewer("Gavin Barraclough", "barraclough@apple.com"),
129     Reviewer("Geoffrey Garen", "ggaren@apple.com"),
130     Reviewer("George Staikos", "staikos@kde.org"),
131     Reviewer("Gustavo Noronha", "gns@gnome.org"),
132     Reviewer("Holger Freyther", "zecke@selfish.org"),
133     Reviewer("Jan Alonzo", "jmalonzo@gmail.com"),
134     Reviewer("John Sullivan", "sullivan@apple.com"),
135     Reviewer("Jon Honeycutt", "jhoneycutt@apple.com"),
136     Reviewer("Justin Garcia", "justin.garcia@apple.com"),
137     Reviewer("Kevin Decker", "kdecker@apple.com"),
138     Reviewer("Kevin McCullough", "kmccullough@apple.com"),
139     Reviewer("Kevin Ollivier", "kevino@theolliviers.com"),
140     Reviewer("Lars Knoll", "lars@trolltech.com"),
141     Reviewer("Maciej Stachowiak", "mjs@apple.com"),
142     Reviewer("Mark Rowe", "mrowe@apple.com"),
143     Reviewer("Nikolas Zimmermann", "zimmermann@kde.org"),
144     Reviewer("Oliver Hunt", "oliver@apple.com"),
145     Reviewer("Pavel Feldman", "pfeldman@chromium.org"),
146     Reviewer("Rob Buis", "rwlbuis@gmail.com"),
147     Reviewer("Sam Weinig", "sam@webkit.org"),
148     Reviewer("Simon Fraser", "simon.fraser@apple.com"),
149     Reviewer("Simon Hausmann", "hausmann@webkit.org"),
150     Reviewer("Stephanie Lewis", "slewis@apple.com"),
151     Reviewer("Steve Falkenburg", "sfalken@apple.com"),
152     Reviewer("Timothy Hatcher", "timothy@hatcher.name"),
153     Reviewer(u'Tor Arne Vestb\xf8', "vestbo@webkit.org"),
154     Reviewer("Xan Lopez", "xan.lopez@gmail.com"),
155 ]
156
157
158 class CommitterList:
159     # Committers and reviewers are passed in to allow easy testing
160     def __init__(self, committers=committers_unable_to_review, reviewers=reviewers_list):
161         self._committers = committers + reviewers
162         self._reviewers = reviewers
163         self._committers_by_email = {}
164
165     def committers(self):
166         return self._committers
167
168     def _email_to_committer_map(self):
169         if not len(self._committers_by_email):
170             for committer in self._committers:
171                 self._committers_by_email[committer.bugzilla_email] = committer
172         return self._committers_by_email
173
174     def committer_by_bugzilla_email(self, bugzilla_email):
175         return self._email_to_committer_map().get(bugzilla_email)
176
177     def reviewer_by_bugzilla_email(self, bugzilla_email):
178         committer = self.committer_by_bugzilla_email(bugzilla_email)
179         if committer and not committer.can_review:
180             return None
181         return committer