Merge lp:~julian-edwards/launchpad/disable-arch-bug-633139 into lp:launchpad/db-devel

Proposed by Julian Edwards
Status: Merged
Approved by: Julian Edwards
Approved revision: no longer in the source branch.
Merged at revision: 9769
Proposed branch: lp:~julian-edwards/launchpad/disable-arch-bug-633139
Merge into: lp:launchpad/db-devel
Diff against target: 119 lines (+70/-1)
5 files modified
lib/lp/soyuz/browser/distroarchseries.py (+2/-1)
lib/lp/soyuz/browser/tests/test_distroarchseries_view.py (+51/-0)
lib/lp/soyuz/doc/distroarchseries.txt (+10/-0)
lib/lp/soyuz/interfaces/distroarchseries.py (+6/-0)
lib/lp/soyuz/model/distroarchseries.py (+1/-0)
To merge this branch: bzr merge lp:~julian-edwards/launchpad/disable-arch-bug-633139
Reviewer Review Type Date Requested Status
Abel Deuring (community) code Approve
Review via email: mp+35072@code.launchpad.net

Commit message

Allow the "enabled" flag on distroarchseries to be editing on the DAS admin form.

Description of the change

= Summary =
Add an "enabled" flag on the distroarchseries admin page.

== Proposed fix ==
It's a simple form change.

== Pre-implementation notes ==
The Ubuntu team wanted to delete ia64 and sparc in maverick. We did this for lpia in hardy but with the new data model that includes recipes, the SQL to do this now is quite a lot harder - and *riskier*.

So, I discussed with LaMont about disabling the DAS instead, so that new builds are not created and more importantly nothing gets published in those disabled arches.

== Implementation details ==
This branch is the first part of the change and includes the UI change only.

== Tests ==
bin/test -cvv test_distroarchseries_view

== Demo and Q/A ==
make run
visit https://launchpad.dev/ubuntu/hoary/i386/+admin

= Launchpad lint =
Bogus lint deleted. Sigh.

To post a comment you must log in.
Revision history for this message
Julian Edwards (julian-edwards) wrote :

test comment

Revision history for this message
Abel Deuring (adeuring) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/soyuz/browser/distroarchseries.py'
--- lib/lp/soyuz/browser/distroarchseries.py 2010-08-20 20:31:18 +0000
+++ lib/lp/soyuz/browser/distroarchseries.py 2010-09-10 10:42:55 +0000
@@ -124,7 +124,8 @@
124 schema = IDistroArchSeries124 schema = IDistroArchSeries
125125
126 field_names = [126 field_names = [
127 'architecturetag', 'official', 'supports_virtualized'127 'architecturetag', 'official', 'supports_virtualized',
128 'enabled',
128 ]129 ]
129130
130 @action(_('Change'), name='update')131 @action(_('Change'), name='update')
131132
=== added file 'lib/lp/soyuz/browser/tests/test_distroarchseries_view.py'
--- lib/lp/soyuz/browser/tests/test_distroarchseries_view.py 1970-01-01 00:00:00 +0000
+++ lib/lp/soyuz/browser/tests/test_distroarchseries_view.py 2010-09-10 10:42:55 +0000
@@ -0,0 +1,51 @@
1# Copyright 2009 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).
3
4__metaclass__ = type
5
6from canonical.launchpad.ftests import login
7from canonical.launchpad.webapp.servers import LaunchpadTestRequest
8from canonical.testing import LaunchpadFunctionalLayer
9from lp.soyuz.browser.distroarchseries import DistroArchSeriesAdminView
10from lp.testing import TestCaseWithFactory
11from lp.testing.sampledata import LAUNCHPAD_ADMIN
12
13
14class TestDistroArchSeriesView(TestCaseWithFactory):
15
16 layer = LaunchpadFunctionalLayer
17
18 def setUp(self):
19 """Create a distroarchseries for the tests and login as an admin."""
20 super(TestDistroArchSeriesView, self).setUp()
21 self.das = self.factory.makeDistroArchSeries()
22 # Login as an admin to ensure access to the view's context
23 # object.
24 login(LAUNCHPAD_ADMIN)
25
26 def initialize_admin_view(self, enabled=True):
27 # Initialize the admin view with the supplied params.
28 method = 'POST'
29 form = {
30 'field.actions.update': 'update',
31 }
32
33 if enabled:
34 form['field.enabled'] = 'on'
35 else:
36 form['field.enabled'] = 'off'
37
38 view = DistroArchSeriesAdminView(
39 self.das, LaunchpadTestRequest(method=method, form=form))
40 view.initialize()
41 return view
42
43 def test_enabling_enabled_flag(self):
44 view = self.initialize_admin_view(enabled=False)
45 self.assertEqual(0, len(view.errors))
46 self.assertFalse(view.context.enabled)
47
48 def test_disabling_enabled_flag(self):
49 view = self.initialize_admin_view(enabled=True)
50 self.assertEqual(0, len(view.errors))
51 self.assertTrue(view.context.enabled)
052
=== modified file 'lib/lp/soyuz/doc/distroarchseries.txt'
--- lib/lp/soyuz/doc/distroarchseries.txt 2010-07-20 09:36:17 +0000
+++ lib/lp/soyuz/doc/distroarchseries.txt 2010-09-10 10:42:55 +0000
@@ -25,6 +25,16 @@
25# This needs many more tests to be effective.25# This needs many more tests to be effective.
2626
2727
28Properties
29==========
30
31Enabled is a boolean flag that says whether the arch will receive new builds
32and publish them.
33
34 >>> print hoary_i386.enabled
35 True
36
37
28DistroArchSeries can tell you about their published releases38DistroArchSeries can tell you about their published releases
29============================================================39============================================================
3040
3141
=== modified file 'lib/lp/soyuz/interfaces/distroarchseries.py'
--- lib/lp/soyuz/interfaces/distroarchseries.py 2010-08-20 20:31:18 +0000
+++ lib/lp/soyuz/interfaces/distroarchseries.py 2010-09-10 10:42:55 +0000
@@ -83,6 +83,12 @@
83 description=_("Indicate whether or not this port has support "83 description=_("Indicate whether or not this port has support "
84 "for building PPA packages."),84 "for building PPA packages."),
85 required=False))85 required=False))
86 enabled = Bool(
87 title=_("Enabled"),
88 description=_(
89 "Whether or not this DistroArchSeries is enabled for build "
90 "creation and publication."),
91 required=False, readonly=False)
8692
87 # Joins.93 # Joins.
88 packages = Attribute('List of binary packages in this port.')94 packages = Attribute('List of binary packages in this port.')
8995
=== modified file 'lib/lp/soyuz/model/distroarchseries.py'
--- lib/lp/soyuz/model/distroarchseries.py 2010-08-24 15:29:01 +0000
+++ lib/lp/soyuz/model/distroarchseries.py 2010-09-10 10:42:55 +0000
@@ -82,6 +82,7 @@
82 storm_validator=validate_public_person, notNull=True)82 storm_validator=validate_public_person, notNull=True)
83 package_count = IntCol(notNull=True, default=DEFAULT)83 package_count = IntCol(notNull=True, default=DEFAULT)
84 supports_virtualized = BoolCol(notNull=False, default=False)84 supports_virtualized = BoolCol(notNull=False, default=False)
85 enabled = BoolCol(notNull=False, default=True)
8586
86 packages = SQLRelatedJoin('BinaryPackageRelease',87 packages = SQLRelatedJoin('BinaryPackageRelease',
87 joinColumn='distroarchseries',88 joinColumn='distroarchseries',

Subscribers

People subscribed via source and target branches

to status/vote changes: