Merge lp:~jml/pkgme-service/pass-maintainer-through into lp:pkgme-service

Proposed by Jonathan Lange
Status: Merged
Approved by: Jonathan Lange
Approved revision: 82
Merged at revision: 82
Proposed branch: lp:~jml/pkgme-service/pass-maintainer-through
Merge into: lp:pkgme-service
Diff against target: 94 lines (+35/-1)
5 files modified
django_project/main.cfg (+1/-0)
django_project/schema.py (+1/-0)
src/djpkgme/tasks.py (+3/-0)
src/djpkgme/tests/test_integration.py (+0/-1)
src/djpkgme/tests/test_tasks.py (+30/-0)
To merge this branch: bzr merge lp:~jml/pkgme-service/pass-maintainer-through
Reviewer Review Type Date Requested Status
James Westby (community) Approve
Review via email: mp+99385@code.launchpad.net

Commit message

Set the maintainer in the config and pass that through to pkgme-binary, thus setting the maintainer in generated changelogs.

Description of the change

Does what https://code.launchpad.net/~jml/pkgme-service/set-debemail/+merge/99305 does except by setting the maintainer via the metadata rather than an environment variable.

Relies on https://code.launchpad.net/~jml/pkgme-binary/maintainer-from-metadata/+merge/99358

To post a comment you must log in.
Revision history for this message
James Westby (james-w) :
review: Approve
Revision history for this message
Canonical CA Tarmac (ca-tarmac) wrote :

Attempt to merge into lp:pkgme-service failed due to conflicts:

text conflict in django_project/main.cfg
text conflict in django_project/schema.py

82. By Jonathan Lange

Merge trunk, resolving conflicts.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'django_project/main.cfg'
2--- django_project/main.cfg 2012-03-26 18:01:53 +0000
3+++ django_project/main.cfg 2012-03-27 09:28:19 +0000
4@@ -2,6 +2,7 @@
5 myapps_realm = Pkgme
6 pkgme_allowed_backends = binary
7 pdf
8+pkgme_maintainer_email = pkgme-service bot <ca-pkgme-service-bot@canonical.com>
9 pkgme_output_directory = packaged-tarballs
10
11 [celery]
12
13=== modified file 'django_project/schema.py'
14--- django_project/schema.py 2012-03-26 18:01:53 +0000
15+++ django_project/schema.py 2012-03-27 09:28:19 +0000
16@@ -29,6 +29,7 @@
17 myapps_token_secret = schema.StringOption()
18 myapps_base_url = schema.StringOption()
19 pkgme_allowed_backends = schema.ListOption(item=schema.StringOption())
20+ pkgme_maintainer_email = schema.StringOption()
21 pkgme_output_directory = schema.StringOption()
22 pkgme_output_url = schema.StringOption()
23 extra_installed_apps = schema.ListOption(item=schema.StringOption())
24
25=== modified file 'src/djpkgme/tasks.py'
26--- src/djpkgme/tasks.py 2012-03-27 09:20:29 +0000
27+++ src/djpkgme/tasks.py 2012-03-27 09:28:19 +0000
28@@ -328,6 +328,9 @@
29 # The contents of $output_dir (i.e. the source package files and
30 # devportal-metadata.json) are tarred up and stored in a preconfigured
31 # location: PKGME_OUTPUT_DIRECTORY.
32+ debemail = settings.PKGME_MAINTAINER_EMAIL
33+ if debemail:
34+ metadata[MetadataBackend.MAINTAINER] = debemail
35 with TempDir() as temp_dir:
36 output_dir = temp_dir.path
37 download_dir = os.path.join(
38
39=== modified file 'src/djpkgme/tests/test_integration.py'
40--- src/djpkgme/tests/test_integration.py 2012-03-05 11:07:58 +0000
41+++ src/djpkgme/tests/test_integration.py 2012-03-27 09:28:19 +0000
42@@ -15,7 +15,6 @@
43 TempDir,
44 )
45 from pkgme.run_script import ScriptFailed
46-from testtools import run_test_with
47 from testtools.content import (
48 Content,
49 text_content,
50
51=== modified file 'src/djpkgme/tests/test_tasks.py'
52--- src/djpkgme/tests/test_tasks.py 2012-03-26 18:21:44 +0000
53+++ src/djpkgme/tests/test_tasks.py 2012-03-27 09:28:19 +0000
54@@ -8,6 +8,10 @@
55 import tarfile
56 import traceback
57
58+# In lucid, python-debian exports its package as 'debian_bundle'.
59+from testtools import try_imports
60+changelog = try_imports(['debian.changelog', 'debian_bundle.changelog'])
61+
62 from devportalbinary.metadata import MetadataBackend
63 from django.conf import settings
64 from fixtures import TempDir
65@@ -620,3 +624,29 @@
66 basename = os.path.basename(output_tar_path)
67 cleaned_package_name = PackageName.clean(name)
68 self.assertEqual("%s.tar.gz" % cleaned_package_name, basename)
69+
70+ def test_uses_pkgme_maintainer_email(self):
71+ unpack_dir = self.useFixture(TempDir()).path
72+ metadata = self.factory.make_metadata()
73+ debemail = 'Dude <dude@example.com>'
74+ with patch_settings(PKGME_MAINTAINER_EMAIL=debemail):
75+ output_tar_path = self.run_task(
76+ metadata, self.factory.make_packagable_tarball())
77+ output_tar = tarfile.open(output_tar_path, 'r:gz')
78+ try:
79+ output_tar.extractall(unpack_dir)
80+ finally:
81+ output_tar.close()
82+ package_name = metadata['package_name']
83+ package_tarball_path = os.path.join(
84+ unpack_dir, '%s_0.tar.gz' % (package_name,))
85+ t = tarfile.open(package_tarball_path)
86+ try:
87+ t.extractall(unpack_dir)
88+ finally:
89+ t.close()
90+ debian_dir = os.path.join(unpack_dir, package_name, 'debian')
91+ changelog_path = os.path.join(debian_dir, 'changelog')
92+ cl = changelog.Changelog(open(changelog_path).read())
93+ [change_block] = list(cl)
94+ self.assertEqual(debemail, change_block.author)

Subscribers

People subscribed via source and target branches