2009-10-11 Adam Barth <abarth@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 # All reviewers are committers, so this list is only of committers
46 # who are not reviewers.
47 committers_unable_to_review = [
48     Committer("Aaron Boodman", "aa@chromium.org"),
49     Committer("Adam Langley", "agl@chromium.org"),
50     Committer("Albert J. Wong", "ajwong@chromium.org"),
51     Committer("Antonio Gomes", "tonikitoo@webkit.org"),
52     Committer("Anthony Ricaud", "rik@webkit.org"),
53     Committer("Ben Murdoch", "benm@google.com"),
54     Committer("Brent Fulgham", "bfulgham@webkit.org"),
55     Committer("Brian Weinstein", "bweinstein@apple.com"),
56     Committer("Cameron McCormack", "cam@webkit.org"),
57     Committer("Collin Jackson", "collinj@webkit.org"),
58     Committer("Daniel Bates", "dbates@webkit.org"),
59     Committer("Drew Wilson", "atwilson@chromium.org"),
60     Committer("Dirk Schulze", "krit@webkit.org"),
61     Committer("Dmitry Titov", "dimich@chromium.org"),
62     Committer("Eli Fidler", "eli@staikos.net"),
63     Committer("Eric Roman", "eroman@chromium.org"),
64     Committer("Fumitoshi Ukai", "ukai@chromium.org"),
65     Committer("Greg Bolsinga", "bolsinga@apple.com"),
66     Committer("Jeremy Moskovich", "playmobil@google.com"),
67     Committer("Jeremy Orlow", "jorlow@chromium.org"),
68     Committer("Jian Li", "jianli@chromium.org"),
69     Committer("John Abd-El-Malek", "jam@chromium.org"),
70     Committer("Joseph Pecoraro", "joepeck@webkit.org"),
71     Committer("Julie Parent", "jparent@google.com"),
72     Committer("Kenneth Rohde Christiansen", "kenneth@webkit.org"),
73     Committer("Laszlo Gombos", "laszlo.1.gombos@nokia.com"),
74     Committer("Nate Chapin", "japhet@chromium.org"),
75     Committer("Ojan Vafai", "ojan@chromium.org"),
76     Committer("Pam Greene", "pam@chromium.org"),
77     Committer("Peter Kasting", "pkasting@google.com"),
78     Committer("Pierre d'Herbemont", "pdherbemont@free.fr"),
79     Committer("Ryosuke Niwa", "rniwa@webkit.org"),
80     Committer("Scott Violet", "sky@chromium.org"),
81     Committer("Shinichiro Hamaji", "hamaji@chromium.org"),
82     Committer("Tony Chang", "tony@chromium.org"),
83     Committer("Yael Aharon", "yael.aharon@nokia.com"),
84     Committer("Yong Li", "yong.li@torchmobile.com"),
85     Committer("Zoltan Horvath", "zoltan@webkit.org"),
86 ]
87
88 reviewers_list = [
89     Reviewer("Adam Barth", "abarth@webkit.org"),
90     Reviewer("Adam Roben", "aroben@apple.com"),
91     Reviewer("Adam Treat", "treat@kde.org"),
92     Reviewer("Adele Peterson", "adele@apple.com"),
93     Reviewer("Alexey Proskuryakov", "ap@webkit.org"),
94     Reviewer("Anders Carlsson", "andersca@apple.com"),
95     Reviewer("Antti Koivisto", "koivisto@iki.fi"),
96     Reviewer("Ariya Hidayat", "ariya.hidayat@trolltech.com"),
97     Reviewer("Brady Eidson", "beidson@apple.com"),
98     Reviewer("Dan Bernstein", "mitz@webkit.org"),
99     Reviewer("Darin Adler", "darin@apple.com"),
100     Reviewer("Darin Fisher", "fishd@chromium.org"),
101     Reviewer("David Hyatt", "hyatt@apple.com"),
102     Reviewer("David Kilzer", "ddkilzer@webkit.org"),
103     Reviewer("David Levin", "levin@chromium.org"),
104     Reviewer("Dimitri Glazkov", "dglazkov@chromium.org"),
105     Reviewer("Eric Carlson", "eric.carlson@apple.com"),
106     Reviewer("Eric Seidel", "eric@webkit.org"),
107     Reviewer("Gavin Barraclough", "barraclough@apple.com"),
108     Reviewer("Geoffrey Garen", "ggaren@apple.com"),
109     Reviewer("George Staikos", "staikos@kde.org"),
110     Reviewer("Gustavo Noronha", "gns@gnome.org"),
111     Reviewer("Holger Freyther", "zecke@selfish.org"),
112     Reviewer("Jan Alonzo", "jmalonzo@gmail.com"),
113     Reviewer("John Sullivan", "sullivan@apple.com"),
114     Reviewer("Justin Garcia", "justin.garcia@apple.com"),
115     Reviewer("Kevin McCullough", "kmccullough@apple.com"),
116     Reviewer("Kevin Ollivier", "kevino@theolliviers.com"),
117     Reviewer("Maciej Stachowiak", "mjs@apple.com"),
118     Reviewer("Mark Rowe", "mrowe@apple.com"),
119     Reviewer("Nikolas Zimmermann", "zimmermann@kde.org"),
120     Reviewer("Oliver Hunt", "oliver@apple.com"),
121     Reviewer("Sam Weinig", "sam@webkit.org"),
122     Reviewer("Simon Fraser", "simon.fraser@apple.com"),
123     Reviewer("Simon Hausmann", "hausmann@webkit.org"),
124     Reviewer("Steve Falkenburg", "sfalken@apple.com"),
125     Reviewer("Timothy Hatcher", "timothy@hatcher.name"),
126     Reviewer(u'Tor Arne Vestb\xf8', "vestbo@webkit.org"),
127     Reviewer("Xan Lopez", "xan.lopez@gmail.com"),
128 ]
129
130
131 class CommitterList:
132     # Committers and reviewers are passed in to allow easy testing
133     def __init__(self, committers=committers_unable_to_review, reviewers=reviewers_list):
134         self._committers = committers + reviewers
135         self._reviewers = reviewers
136         self._committers_by_email = {}
137
138     def committers(self):
139         return self._committers
140
141     def _email_to_committer_map(self):
142         if not len(self._committers_by_email):
143             for committer in self._committers:
144                 self._committers_by_email[committer.bugzilla_email] = committer
145         return self._committers_by_email
146
147     def committer_by_bugzilla_email(self, bugzilla_email):
148         return self._email_to_committer_map().get(bugzilla_email)
149
150     def reviewer_by_bugzilla_email(self, bugzilla_email):
151         committer = self.committer_by_bugzilla_email(bugzilla_email)
152         if committer and not committer.can_review:
153             return None
154         return committer