Merge lp:~soren/nova/credits into lp:~hudson-openstack/nova/trunk

Proposed by Soren Hansen
Status: Merged
Approved by: Soren Hansen
Approved revision: 402
Merged at revision: 420
Proposed branch: lp:~soren/nova/credits
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 204 lines (+111/-6)
6 files modified
.mailmap (+29/-0)
Authors (+7/-1)
nova/tests/misc_unittest.py (+48/-0)
nova/utils.py (+18/-0)
run_tests.py (+3/-1)
setup.py (+6/-4)
To merge this branch: bzr merge lp:~soren/nova/credits
Reviewer Review Type Date Requested Status
Jay Pipes (community) Approve
Eric Day (community) Approve
Review via email: mp+40767@code.launchpad.net

Description of the change

Added a .mailmap that maps addresses in bzr to people's real, preferred
e-mail addresses. (I made a few guesses along the way, feel free to
adjust according to what is actually the preferred e-mail)

Added a couple of methods to nova.utils to parse said .mailmap and do
the appropriate (though highly naïve) replacement.

Apply mailmap replacement in changelog generation in setup.py.

Add a unit test that checks everyone is properly listed in Authors.

Add missing people to Authors.

To post a comment you must log in.
Revision history for this message
Eric Day (eday) wrote :

lgtm

review: Approve
Revision history for this message
Anne Gentle (annegentle) wrote :

I've got some additions and I have sleepsonthefloor's real name, how do I merge with this branch?

Revision history for this message
Soren Hansen (soren) wrote :

If you've got your changes in a branch, I can merge them into this one, or we can merge this first, and merge yours afterwards. It doesn't matter much.
--
Sent from my Android phone with K-9 Mail. Please excuse my brevity.

Revision history for this message
Anne Gentle (annegentle) wrote :

Okay I put my changes into a branch at ~annegentle/+junk/authors, thanks for merging for me.

Revision history for this message
Soren Hansen (soren) wrote :

Sorry it took me so long. I've merged your changes. Everything should be up-to-date now.

Revision history for this message
Jay Pipes (jaypipes) wrote :

lgtm.

review: Approve
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

The attempt to merge lp:~soren/nova/credits into lp:nova failed. Below is the output from the failed tests.

nova/utils.py:177:1: E302 expected 2 blank lines, found 1
def parse_mailmap(mailmap='.mailmap'):
^
    Separate top-level function and class definitions with two blank lines.

    Method definitions inside a class are separated by a single blank line.

    Extra blank lines may be used (sparingly) to separate groups of related
    functions. Blank lines may be omitted between a bunch of related
    one-liners (e.g. a set of dummy implementations).

    Use blank lines in functions, sparingly, to indicate logical sections.

    Okay: def a():\n pass\n\n\ndef b():\n pass
    Okay: def a():\n pass\n\n\n# Foo\n# Bar\n\ndef b():\n pass

    E301: class Foo:\n b = 0\n def bar():\n pass
    E302: def a():\n pass\n\ndef b(n):\n pass
    E303: def a():\n pass\n\n\n\ndef b(n):\n pass
    E303: def a():\n\n\n\n pass
    E304: @decorator\n\ndef a():\n pass
nova/utils.py:188:1: E302 expected 2 blank lines, found 1
def str_dict_replace(s, mapping):
^
    Separate top-level function and class definitions with two blank lines.

    Method definitions inside a class are separated by a single blank line.

    Extra blank lines may be used (sparingly) to separate groups of related
    functions. Blank lines may be omitted between a bunch of related
    one-liners (e.g. a set of dummy implementations).

    Use blank lines in functions, sparingly, to indicate logical sections.

    Okay: def a():\n pass\n\n\ndef b():\n pass
    Okay: def a():\n pass\n\n\n# Foo\n# Bar\n\ndef b():\n pass

    E301: class Foo:\n b = 0\n def bar():\n pass
    E302: def a():\n pass\n\ndef b(n):\n pass
    E303: def a():\n pass\n\n\n\ndef b(n):\n pass
    E303: def a():\n\n\n\n pass
    E304: @decorator\n\ndef a():\n pass

Revision history for this message
Soren Hansen (soren) wrote :

/me shakes his fist at run_tests.py for not running pep8..

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :
Download full text (13.6 KiB)

The attempt to merge lp:~soren/nova/credits into lp:nova failed. Below is the output from the failed tests.

nova.tests.access_unittest
  AccessTestCase
    test_001_allow_all ... [OK]
    test_002_allow_none ... [OK]
    test_003_allow_project_manager ... [OK]
    test_004_allow_sys_and_net ... [OK]
nova.tests.api_unittest
  ApiEc2TestCase
    test_authorize_revoke_security_group_cidr ... [OK]
    test_authorize_revoke_security_group_foreign_group ... [OK]
    test_create_delete_security_group ... [OK]
    test_describe_instances ... [OK]
    test_get_all_key_pairs ... [OK]
    test_get_all_security_groups ... [OK]
  XmlConversionTestCase
    test_number_conversion ... [OK]
nova.tests.auth_unittest
  AuthManagerDbTestCase
    test_004_signature_is_valid ... [OK]
    test_005_can_get_credentials ... [OK]
    test_add_user_role_doesnt_infect_project_roles ... [OK]
    test_adding_role_to_project_is_ignored_unless_added_to_user ... [OK]
    test_can_add_and_remove_user_role ... [OK]
    test_can_add_remove_user_with_role ... [OK]
    test_can_add_user_to_project ... [OK]
    test_can_create_and_get_project ... [OK]
    test_can_create_and_get_project_with_attributes ... [OK]
    test_can_create_project_with_manager ... [OK]
    test_can_delete_project ... [OK]
    test_can_delete_user ... [OK]
    test_can_generate_x509 ... [OK]
    test_can_list_project_roles ... [OK]
    test_can_list_projects ... [OK]
    test_can_list_user_roles ... [OK]
    test_can_list_users ... [OK]
    test_can_modify_project ... [OK]
    test_can_modify_users ... [OK]
    test_can_remove_project_role_but_keep_user_role ... [OK]
    test_can_remove_user_from_project ... [OK]
    test_can_remove_user_roles ... [OK]
    test_can_retrieve_project_by_user ... [OK]
    test_create_and_find_user ... [OK]
    test_create_and_find_with_properties ... [OK]
    test_create_project_assigns_manager_to_members .....

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :
Download full text (13.9 KiB)

The attempt to merge lp:~soren/nova/credits into lp:nova failed. Below is the output from the failed tests.

nova.tests.access_unittest
  AccessTestCase
    test_001_allow_all ... [OK]
    test_002_allow_none ... [OK]
    test_003_allow_project_manager ... [OK]
    test_004_allow_sys_and_net ... [OK]
nova.tests.api_unittest
  ApiEc2TestCase
    test_authorize_revoke_security_group_cidr ... [OK]
    test_authorize_revoke_security_group_foreign_group ... [OK]
    test_create_delete_security_group ... [OK]
    test_describe_instances ... [OK]
    test_get_all_key_pairs ... [OK]
    test_get_all_security_groups ... [OK]
  XmlConversionTestCase
    test_number_conversion ... [OK]
nova.tests.auth_unittest
  AuthManagerDbTestCase
    test_004_signature_is_valid ... [OK]
    test_005_can_get_credentials ... [OK]
    test_add_user_role_doesnt_infect_project_roles ... [OK]
    test_adding_role_to_project_is_ignored_unless_added_to_user ... [OK]
    test_can_add_and_remove_user_role ... [OK]
    test_can_add_remove_user_with_role ... [OK]
    test_can_add_user_to_project ... [OK]
    test_can_create_and_get_project ... [OK]
    test_can_create_and_get_project_with_attributes ... [OK]
    test_can_create_project_with_manager ... [OK]
    test_can_delete_project ... [OK]
    test_can_delete_user ... [OK]
    test_can_generate_x509 ... [OK]
    test_can_list_project_roles ... [OK]
    test_can_list_projects ... [OK]
    test_can_list_user_roles ... [OK]
    test_can_list_users ... [OK]
    test_can_modify_project ... [OK]
    test_can_modify_users ... [OK]
    test_can_remove_project_role_but_keep_user_role ... [OK]
    test_can_remove_user_from_project ... [OK]
    test_can_remove_user_roles ... [OK]
    test_can_retrieve_project_by_user ... [OK]
    test_create_and_find_user ... [OK]
    test_create_and_find_with_properties ... [OK]
    test_create_project_assigns_manager_to_members .....

Revision history for this message
Soren Hansen (soren) wrote :

*grumble*

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file '.mailmap'
2--- .mailmap 1970-01-01 00:00:00 +0000
3+++ .mailmap 2010-11-23 21:37:18 +0000
4@@ -0,0 +1,29 @@
5+# Format is:
6+# <preferred e-mail> <other e-mail>
7+<code@term.ie> <github@anarkystic.com>
8+<code@term.ie> <termie@preciousroy.local>
9+<Armando.Migliaccio@eu.citrix.com> <armando.migliaccio@citrix.com>
10+<matt.dietz@rackspace.com> <matthewdietz@Matthew-Dietzs-MacBook-Pro.local>
11+<matt.dietz@rackspace.com> <mdietz@openstack>
12+<cbehrens@codestud.com> <chris.behrens@rackspace.com>
13+<devin.carlen@gmail.com> <devcamcar@illian.local>
14+<ewan.mellor@citrix.com> <emellor@silver>
15+<jaypipes@gmail.com> <jpipes@serialcoder>
16+<anotherjesse@gmail.com> <jesse@dancelamb>
17+<anotherjesse@gmail.com> <jesse@gigantor.local>
18+<anotherjesse@gmail.com> <jesse@ubuntu>
19+<jmckenty@gmail.com> <jmckenty@yyj-dhcp171.corp.flock.com>
20+<jmckenty@gmail.com> <jmckenty@joshua-mckentys-macbook-pro.local>
21+<jmckenty@gmail.com> <joshua.mckenty@nasa.gov>
22+<justin@fathomdb.com> <justinsb@justinsb-desktop>
23+<mordred@inaugust.com> <mordred@hudson>
24+<paul@openstack.org> <pvoccio@castor.local>
25+<paul@openstack.org> <paul.voccio@rackspace.com>
26+<todd@ansolabs.com> <todd@lapex>
27+<todd@ansolabs.com> <todd@rubidine.com>
28+<vishvananda@gmail.com> <vishvananda@yahoo.com>
29+<vishvananda@gmail.com> <root@mirror.nasanebula.net>
30+# These are from people who failed to set a proper committer
31+. <root@tonbuntu>
32+. <laner@controller>
33+. <root@ubuntu>
34
35=== modified file 'Authors'
36--- Authors 2010-10-22 19:06:34 +0000
37+++ Authors 2010-11-23 21:37:18 +0000
38@@ -1,6 +1,9 @@
39 Andy Smith <code@term.ie>
40 Anne Gentle <anne@openstack.org>
41+Anthony Young <sleepsonthefloor@gmail.com>
42+Armando Migliaccio <Armando.Migliaccio@eu.citrix.com>
43 Chris Behrens <cbehrens@codestud.com>
44+Dean Troyer <dtroyer@gmail.com>
45 Devin Carlen <devin.carlen@gmail.com>
46 Eric Day <eday@oddments.org>
47 Ewan Mellor <ewan.mellor@citrix.com>
48@@ -8,7 +11,8 @@
49 Jay Pipes <jaypipes@gmail.com>
50 Jesse Andrews <anotherjesse@gmail.com>
51 Joe Heck <heckj@mac.com>
52-Joel Moore joelbm24@gmail.com
53+Joel Moore <joelbm24@gmail.com>
54+Josh Kearney <josh.kearney@rackspace.com>
55 Joshua McKenty <jmckenty@gmail.com>
56 Justin Santa Barbara <justin@fathomdb.com>
57 Matt Dietz <matt.dietz@rackspace.com>
58@@ -19,3 +23,5 @@
59 Soren Hansen <soren.hansen@rackspace.com>
60 Todd Willey <todd@ansolabs.com>
61 Vishvananda Ishaya <vishvananda@gmail.com>
62+Youcef Laribi <Youcef.Laribi@eu.citrix.com>
63+Zhixue Wu <Zhixue.Wu@citrix.com>
64
65=== added file 'nova/tests/misc_unittest.py'
66--- nova/tests/misc_unittest.py 1970-01-01 00:00:00 +0000
67+++ nova/tests/misc_unittest.py 2010-11-23 21:37:18 +0000
68@@ -0,0 +1,48 @@
69+# vim: tabstop=4 shiftwidth=4 softtabstop=4
70+
71+# Copyright 2010 OpenStack LLC
72+#
73+# Licensed under the Apache License, Version 2.0 (the "License"); you may
74+# not use this file except in compliance with the License. You may obtain
75+# a copy of the License at
76+#
77+# http://www.apache.org/licenses/LICENSE-2.0
78+#
79+# Unless required by applicable law or agreed to in writing, software
80+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
81+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
82+# License for the specific language governing permissions and limitations
83+# under the License.
84+
85+import os
86+import subprocess
87+
88+from nova import test
89+from nova.utils import parse_mailmap, str_dict_replace
90+
91+
92+class ProjectTestCase(test.TrialTestCase):
93+ def test_authors_up_to_date(self):
94+ if os.path.exists('../.bzr'):
95+ log_cmd = subprocess.Popen(["bzr", "log", "-n0"],
96+ stdout=subprocess.PIPE)
97+ changelog = log_cmd.communicate()[0]
98+ mailmap = parse_mailmap('../.mailmap')
99+
100+ contributors = set()
101+ for l in changelog.split('\n'):
102+ l = l.strip()
103+ if (l.startswith('author:') or l.startswith('committer:')
104+ and not l == 'committer: Tarmac'):
105+ email = l.split(' ')[-1]
106+ contributors.add(str_dict_replace(email, mailmap))
107+
108+ authors_file = open('../Authors', 'r').read()
109+
110+ missing = set()
111+ for contributor in contributors:
112+ if not contributor in authors_file:
113+ missing.add(contributor)
114+
115+ self.assertTrue(len(missing) == 0,
116+ '%r not listed in Authors' % missing)
117
118=== modified file 'nova/utils.py'
119--- nova/utils.py 2010-11-16 02:08:08 +0000
120+++ nova/utils.py 2010-11-23 21:37:18 +0000
121@@ -175,6 +175,24 @@
122 return datetime.datetime.strptime(timestr, TIME_FORMAT)
123
124
125+def parse_mailmap(mailmap='.mailmap'):
126+ mapping = {}
127+ if os.path.exists(mailmap):
128+ fp = open(mailmap, 'r')
129+ for l in fp:
130+ l = l.strip()
131+ if not l.startswith('#') and ' ' in l:
132+ canonical_email, alias = l.split(' ')
133+ mapping[alias] = canonical_email
134+ return mapping
135+
136+
137+def str_dict_replace(s, mapping):
138+ for s1, s2 in mapping.iteritems():
139+ s = s.replace(s1, s2)
140+ return s
141+
142+
143 class LazyPluggable(object):
144 """A pluggable backend loaded lazily based on some value."""
145
146
147=== modified file 'run_tests.py'
148--- run_tests.py 2010-11-13 17:59:07 +0000
149+++ run_tests.py 2010-11-23 21:37:18 +0000
150@@ -49,11 +49,12 @@
151 from nova import twistd
152
153 from nova.tests.access_unittest import *
154+from nova.tests.api_unittest import *
155 from nova.tests.auth_unittest import *
156-from nova.tests.api_unittest import *
157 from nova.tests.cloud_unittest import *
158 from nova.tests.compute_unittest import *
159 from nova.tests.flags_unittest import *
160+from nova.tests.misc_unittest import *
161 from nova.tests.network_unittest import *
162 from nova.tests.objectstore_unittest import *
163 from nova.tests.process_unittest import *
164@@ -64,6 +65,7 @@
165 from nova.tests.twistd_unittest import *
166 from nova.tests.validator_unittest import *
167 from nova.tests.virt_unittest import *
168+from nova.tests.virt_unittest import *
169 from nova.tests.volume_unittest import *
170
171
172
173=== modified file 'setup.py'
174--- setup.py 2010-11-19 22:04:37 +0000
175+++ setup.py 2010-11-23 21:37:18 +0000
176@@ -16,13 +16,14 @@
177 # License for the specific language governing permissions and limitations
178 # under the License.
179
180+import os
181+import subprocess
182+
183 from setuptools import setup, find_packages
184 from setuptools.command.sdist import sdist
185 from sphinx.setup_command import BuildDoc
186
187-import os
188-import subprocess
189-
190+from nova.util import parse_mailmap, str_dict_replace
191
192 class local_BuildDoc(BuildDoc):
193 def run(self):
194@@ -42,8 +43,9 @@
195 log_cmd = subprocess.Popen(["bzr", "log", "--novalog"],
196 stdout=subprocess.PIPE, env=env)
197 changelog = log_cmd.communicate()[0]
198+ mailmap = parse_mailmap()
199 with open("ChangeLog", "w") as changelog_file:
200- changelog_file.write(changelog)
201+ changelog_file.write(str_dict_replace(changelog, mailmap))
202 sdist.run(self)
203
204 setup(name='nova',