Merge lp:~wgrant/launchpad/maybe-publish-debug-symbols-db into lp:launchpad/db-devel

Proposed by William Grant
Status: Superseded
Proposed branch: lp:~wgrant/launchpad/maybe-publish-debug-symbols-db
Merge into: lp:launchpad/db-devel
Diff against target: 90 lines (+39/-2)
4 files modified
database/schema/patch-2209-45-0.sql (+9/-0)
lib/lp/soyuz/model/publishing.py (+12/-0)
lib/lp/soyuz/tests/test_publishing.py (+16/-0)
lib/lp/testing/__init__.py (+2/-2)
To merge this branch: bzr merge lp:~wgrant/launchpad/maybe-publish-debug-symbols-db
Reviewer Review Type Date Requested Status
Stuart Bishop db Pending
Review via email: mp+163665@code.launchpad.net

This proposal has been superseded by a proposal from 2013-05-14.

Commit message

Add Archive.publish_debug_symbols to the DB.

Description of the change

The Ubuntu primary archive needs to build ddebs, but we don't have the space or need to publish them to the archive tree right now. So add an Archive.publish_debug_symbols to the DB to control publishing separately from building.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'database/schema/patch-2209-45-0.sql'
2--- database/schema/patch-2209-45-0.sql 1970-01-01 00:00:00 +0000
3+++ database/schema/patch-2209-45-0.sql 2013-05-14 09:27:28 +0000
4@@ -0,0 +1,9 @@
5+-- Copyright 2013 Canonical Ltd. This software is licensed under the
6+-- GNU Affero General Public License version 3 (see the file LICENSE).
7+
8+SET client_min_messages=ERROR;
9+
10+ALTER TABLE archive ADD COLUMN publish_debug_symbols boolean;
11+ALTER TABLE archive ALTER COLUMN publish_debug_symbols SET DEFAULT false;
12+
13+INSERT INTO LaunchpadDatabaseRevision VALUES (2209, 45, 0);
14
15=== modified file 'lib/lp/soyuz/model/publishing.py'
16--- lib/lp/soyuz/model/publishing.py 2013-05-08 06:18:50 +0000
17+++ lib/lp/soyuz/model/publishing.py 2013-05-14 09:27:28 +0000
18@@ -1159,6 +1159,12 @@
19 "component, section, priority and/or "
20 "phased_update_percentage.")
21
22+ bpr = self.binarypackagerelease
23+ if bpr.binpackageformat == BinaryPackageFormat.DDEB:
24+ raise OverrideError(
25+ "Cannot override ddeb publications directly; override "
26+ "the corresponding deb instead.")
27+
28 # Check there is a change to make
29 if new_component is None:
30 new_component = self.component
31@@ -1300,6 +1306,12 @@
32 "Cannot delete publications from suite '%s'" %
33 self.distroseries.getSuite(self.pocket))
34
35+ bpr = self.binarypackagerelease
36+ if bpr.binpackageformat == BinaryPackageFormat.DDEB:
37+ raise DeletionError(
38+ "Cannot delete ddeb publications directly; delete the "
39+ "corresponding deb instead.")
40+
41 self.setDeleted(removed_by, removal_comment)
42
43 def binaryFileUrls(self, include_meta=False):
44
45=== modified file 'lib/lp/soyuz/tests/test_publishing.py'
46--- lib/lp/soyuz/tests/test_publishing.py 2013-05-08 06:08:37 +0000
47+++ lib/lp/soyuz/tests/test_publishing.py 2013-05-14 09:27:28 +0000
48@@ -1056,6 +1056,22 @@
49 [new_bpph])
50 self.assertEqual(new_debug_bpph.section, new_section)
51
52+ def test_requestDeletion_forbids_debug_package(self):
53+ bpph, debug_bpph = self.factory.makeBinaryPackagePublishingHistory(
54+ pocket=PackagePublishingPocket.RELEASE, with_debug=True)
55+ self.assertRaisesWithContent(
56+ DeletionError, "Cannot delete ddeb publications directly; delete "
57+ "the corresponding deb instead.",
58+ debug_bpph.requestDeletion, self.factory.makePerson())
59+
60+ def test_changeOverride_forbids_debug_package(self):
61+ bpph, debug_bpph = self.factory.makeBinaryPackagePublishingHistory(
62+ pocket=PackagePublishingPocket.RELEASE, with_debug=True)
63+ self.assertRaisesWithContent(
64+ OverrideError, "Cannot override ddeb publications directly; "
65+ "override the corresponding deb instead.",
66+ debug_bpph.changeOverride, new_phased_update_percentage=20)
67+
68
69 class TestSourceDomination(TestNativePublishingBase):
70 """Test SourcePackagePublishingHistory.supersede() operates correctly."""
71
72=== modified file 'lib/lp/testing/__init__.py'
73--- lib/lp/testing/__init__.py 2012-12-26 01:34:53 +0000
74+++ lib/lp/testing/__init__.py 2013-05-14 09:27:28 +0000
75@@ -573,13 +573,13 @@
76 self.assertThat(iter1, MatchesSetwise(*(map(Equals, iter2))))
77
78 def assertRaisesWithContent(self, exception, exception_content,
79- func, *args):
80+ func, *args, **kwargs):
81 """Check if the given exception is raised with given content.
82
83 If the exception isn't raised or the exception_content doesn't
84 match what was raised an AssertionError is raised.
85 """
86- err = self.assertRaises(exception, func, *args)
87+ err = self.assertRaises(exception, func, *args, **kwargs)
88 self.assertEqual(exception_content, str(err))
89
90 def assertBetween(self, lower_bound, variable, upper_bound):

Subscribers

People subscribed via source and target branches

to status/vote changes: