Merge lp:~rvb/launchpad/db-add-distro-registrant into lp:launchpad/db-devel

Proposed by Raphaël Badin
Status: Merged
Approved by: Stuart Bishop
Approved revision: no longer in the source branch.
Merged at revision: 10300
Proposed branch: lp:~rvb/launchpad/db-add-distro-registrant
Merge into: lp:launchpad/db-devel
Diff against target: 658 lines (+243/-58)
18 files modified
database/sampledata/current-dev.sql (+27/-10)
database/sampledata/current.sql (+27/-10)
database/schema/comments.sql (+1/-1)
database/schema/patch-2208-53-0.sql (+20/-0)
lib/lp/app/stories/launchpad-root/site-search.txt (+5/-3)
lib/lp/registry/browser/configure.zcml (+1/-1)
lib/lp/registry/browser/distribution.py (+9/-1)
lib/lp/registry/browser/tests/test_distribution_views.py (+83/-2)
lib/lp/registry/interfaces/distribution.py (+6/-1)
lib/lp/registry/model/distribution.py (+5/-1)
lib/lp/registry/stories/distribution/xx-distribution-overview.txt (+3/-1)
lib/lp/registry/stories/webservice/xx-distribution.txt (+1/-0)
lib/lp/registry/templates/distribution-index.pt (+2/-2)
lib/lp/registry/tests/test_distribution.py (+35/-13)
lib/lp/registry/tests/test_distributionsourcepackage.py (+2/-1)
lib/lp/registry/tests/test_pillarname_triggers.py (+10/-7)
lib/lp/soyuz/doc/archive.txt (+1/-1)
lib/lp/testing/factory.py (+5/-3)
To merge this branch: bzr merge lp:~rvb/launchpad/db-add-distro-registrant
Reviewer Review Type Date Requested Status
Stuart Bishop (community) db Approve
Curtis Hovey (community) code Approve
Raphaël Badin (community) Abstain
Robert Collins db Pending
Review via email: mp+53001@code.launchpad.net

Commit message

[r=sinzui,stub][bug=727632] Add a registrant field to distribution and use this instead of owner in the UI in the 'Registered by' slot.

Description of the change

= Summary =

This branch adds a registrant field to distribution (read-only field) only filled when a distribution is registered. It also fixes the interface to display this field in the 'Registered by' slot (instead of owner).

Since it involves changing the database schema it it targeted at db-devel.

This issue was discussed with Curtis and is the first part of a refactoring which will involve moving the 'owner' field to a new 'registrant' (read-only) field for distroseries, productseries, and productrelease and fixing things accordingly (no reassignments possible for those objects and various UI fixes).

= Tests =

Added tests:
{{{
./bin/test -cvv test_distribution test_registrant_owner_differ
./bin/test -cvv test_distribution test_registrant_set_by_creation
./bin/test -cvv test_distribution test_reassign_change_owner_not_registrant
./bin/test -cvv test_distribution test_reassign_page_title
}}}

Existing impacted tests:
{{{
./bin/test -cvv test_pillarname_triggers testDistributionTable
./bin/test -cvv -t xx-distribution-launchpad-usage.txt
./bin/test -cvv -t archive.txt
./bin/test -cvv -t xx-distribution-overview.txt
./bin/test -cvv -t site-search.txt
}}}

= QA =

Create a distribution. Make sure the 'Registered by' slot displays the creator's name. Reassign the distribution by editing the maintainer. Make sure the registrant has not changed after that.

Make sure all existing distributions appear to have been registered by ~registry.

To post a comment you must log in.
Revision history for this message
Curtis Hovey (sinzui) wrote :
Download full text (5.0 KiB)

Raphaël:

This branch looks very good. I think the implementation is perfect. I have some concerns about the primary test.

> @@ -260,3 +267,79 @@
> text='Series and milestones'))
> self.assertThat(view.render(), series_header_match)
> self.assertThat(view.render(), Not(add_series_match))
> +
> +
> +class DistroRegistrantTestCase(TestCaseWithFactory):
> + """A TestCase for registrants and owners of a distribution.
> +
> + The registrant is the creator of the distribution (read-only field).
> + The owner is really the maintainer.
> + """

This test case will be difficult to extend. I think we want tests for
the model object and tests for the views. I preffer that each view (+add
and +reassign) be have separate test cases, but that may not be necessary.
Some of these tests need to move to a different directory.

    Test interfaces in lp/registry/doc
    Test models in lp/registry/tests
    Test views in lp/registry/browser/tests

Get the rest of this test case updated per my remarks that split it into
model and view tests.

> + layer = LaunchpadFunctionalLayer

This is the wrong layer. LaunchpadFunctionalLayer is slow and only needed
if you are working with the librarian (uploading/downloading/email messages).
Use
    layer = DatabaseFunctionalLayer

+ def setUp(self):
+ super(DistroRegistrantTestCase, self).setUp()
+ self.owner = self.factory.makePerson()
+ self.registrant = self.factory.makePerson()
+ self.admin = getUtility(IPersonSet).getByEmail('<email address hidden>')
+ self.registry = getUtility(IPersonSet).getByName('registry')

Let's not ever use sampledata. You do not need the admin or registy attrs.
You can use login_celebrity('admins') or `with celebrity_logged_in('admins'):`.
Both login functions create a user that is a member of the celebrity team,
'admins' or 'registry_experts', and *only* that team. The sample data
users are members of many teams and the permission may not be as you assume.

+ def test_registrant_owner_differ(self):
+ distribution = self.factory.makeDistribution(
+ name="boobuntu", owner=self.owner, registrant=self.registrant)
+ self.assertNotEqual(distribution.owner, distribution.registrant)
+ self.assertEqual(distribution.owner, self.owner)
+ self.assertEqual(distribution.registrant, self.registrant)

^ Model test. This is fine.

+ def test_registrant_set_by_creation(self):
+ """The registrant field should be set to the Person creating
+ the distribution.
+ """
+ login_person(self.admin)
+ distributionset = getUtility(IDistributionSet)
+ creation_form = {
+ 'field.name': 'newbuntu',
+ 'field.displayname': 'newbuntu',
+ 'field.title': 'newbuntu',
+ 'field.summary': 'newbuntu',
+ 'field.description': 'newbuntu',
+ 'field.domainname': 'newbuntu',
+ 'field.members': 'registry',
+ 'field.actions.save': 'Save',
+ }
+ view = create_initialized_view(
+ distributionset, '+add', principal=self.admin,
+ method='POST', form=...

Read more...

review: Needs Fixing (code)
Revision history for this message
Raphaël Badin (rvb) wrote :

Fixed the tests (used DatabaseFunctionalLayer, refactored the tests into the proper places/classes, removed the use of sampledata). Thanks for the careful review.

review: Needs Resubmitting
Revision history for this message
Raphaël Badin (rvb) :
review: Abstain
Revision history for this message
Curtis Hovey (sinzui) wrote :

Thank you for restructuring the tests. I think the code and test portion of this branch is good to land.

review: Approve (code)
Revision history for this message
Robert Collins (lifeless) wrote :

This seems wrong:
+update Distribution
179 + SET registrant = (select id from Person where name='registry');

The registrant of the existing distros is the current owner, no?

Revision history for this message
Stuart Bishop (stub) wrote :

The DB change looks fine.

You need to remove the BEGIN and COMMIT statements - the tool we use to apply db patches already wraps the patches in a transaction, and adding them again will break things.

We want an index on Person.registrant (all references to Person have them, including ones like this where the small number of rows means they likely will never be used). Please add the following:

    CREATE INDEX distribution__registrant__idx ON Distribution(registrant);

DB patch number is patch-2208-53-0.sql. You need to rename the .sql file and change the value being inserted into LaunchpadDatabaseRevision to match.

review: Approve (db)
Revision history for this message
Curtis Hovey (sinzui) wrote :

The registrant certainly was not the owner. Only an admin could have registered the project. Most are registered by kiko and mthaddon. I advised that ~registry be used instead because the Admin is not the person to contact if the maintain is absent.

Revision history for this message
Robert Collins (lifeless) wrote :

On Tue, Mar 15, 2011 at 3:13 AM, Curtis Hovey
<email address hidden> wrote:
> The registrant certainly was not the owner. Only an admin could have registered the project.  Most are registered by kiko and mthaddon. I advised that ~registry be used instead because the Admin is not the person to contact if the maintain is absent.

But the registrant is not the person to contact *either*. Registrants
are uninteresting.

Revision history for this message
Raphaël Badin (rvb) wrote :

Robert Collins wrote:
> But the registrant is not the person to contact *either*. Registrants
> are uninteresting.

Curtis will correct this if I'm wrong but this change is more about
making the data in the database right. Then, once this is done, we could
change the UI to display only interesting things (especially in the slot
that displays the registrant right now).

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'database/sampledata/current-dev.sql'
--- database/sampledata/current-dev.sql 2011-03-02 21:51:45 +0000
+++ database/sampledata/current-dev.sql 2011-03-14 14:59:36 +0000
@@ -840,6 +840,9 @@
840840
841841
842842
843
844
845
843SET SESSION AUTHORIZATION DEFAULT;846SET SESSION AUTHORIZATION DEFAULT;
844847
845ALTER TABLE account DISABLE TRIGGER ALL;848ALTER TABLE account DISABLE TRIGGER ALL;
@@ -1911,21 +1914,21 @@
19111914
1912ALTER TABLE distribution DISABLE TRIGGER ALL;1915ALTER TABLE distribution DISABLE TRIGGER ALL;
19131916
1914INSERT INTO distribution (id, name, title, description, domainname, owner, displayname, summary, members, translationgroup, translationpermission, bug_supervisor, official_malone, official_rosetta, security_contact, driver, translation_focus, mirror_admin, upload_admin, upload_sender, date_created, homepage_content, icon, mugshot, logo, fti, official_answers, language_pack_admin, official_blueprints, enable_bug_expiration, bug_reporting_guidelines, reviewer_whiteboard, max_bug_heat, bug_reported_acknowledgement, answers_usage, blueprints_usage, translations_usage) VALUES (1, 'ubuntu', 'Ubuntu Linux', 'Ubuntu is a new approach to Linux Distribution that includes regular releases, and a simplified single-CD installation system.', 'ubuntulinux.org', 17, 'Ubuntu', 'Ubuntu is a new approach to Linux Distribution that includes regular releases, and a simplified single-CD installation system.', 17, NULL, 1, NULL, true, true, NULL, NULL, 3, 59, NULL, NULL, '2006-10-16 18:31:43.415195', NULL, NULL, NULL, NULL, NULL, true, NULL, true, true, NULL, NULL, NULL, NULL, 20, 20, 20);1917INSERT INTO distribution (id, name, title, description, domainname, owner, displayname, summary, members, translationgroup, translationpermission, bug_supervisor, official_malone, official_rosetta, security_contact, driver, translation_focus, mirror_admin, upload_admin, upload_sender, date_created, homepage_content, icon, mugshot, logo, fti, official_answers, language_pack_admin, official_blueprints, enable_bug_expiration, bug_reporting_guidelines, reviewer_whiteboard, max_bug_heat, bug_reported_acknowledgement, answers_usage, blueprints_usage, translations_usage, registrant) VALUES (1, 'ubuntu', 'Ubuntu Linux', 'Ubuntu is a new approach to Linux Distribution that includes regular releases, and a simplified single-CD installation system.', 'ubuntulinux.org', 17, 'Ubuntu', 'Ubuntu is a new approach to Linux Distribution that includes regular releases, and a simplified single-CD installation system.', 17, NULL, 1, NULL, true, true, NULL, NULL, 3, 59, NULL, NULL, '2006-10-16 18:31:43.415195', NULL, NULL, NULL, NULL, NULL, true, NULL, true, true, NULL, NULL, NULL, NULL, 20, 20, 20, 60);
1915INSERT INTO distribution (id, name, title, description, domainname, owner, displayname, summary, members, translationgroup, translationpermission, bug_supervisor, official_malone, official_rosetta, security_contact, driver, translation_focus, mirror_admin, upload_admin, upload_sender, date_created, homepage_content, icon, mugshot, logo, fti, official_answers, language_pack_admin, official_blueprints, enable_bug_expiration, bug_reporting_guidelines, reviewer_whiteboard, max_bug_heat, bug_reported_acknowledgement, answers_usage, blueprints_usage, translations_usage) VALUES (2, 'redhat', 'Redhat Advanced Server', 'Red Hat is a commercial distribution of the GNU/Linux Operating System.', 'redhat.com', 1, 'Red Hat', 'Red Hat is a commercial distribution of the GNU/Linux Operating System.', 1, NULL, 1, NULL, false, false, NULL, 8, NULL, 1, NULL, NULL, '2006-10-16 18:31:43.417928', NULL, NULL, NULL, NULL, NULL, false, NULL, false, false, NULL, NULL, NULL, NULL, 10, 10, 10);1918INSERT INTO distribution (id, name, title, description, domainname, owner, displayname, summary, members, translationgroup, translationpermission, bug_supervisor, official_malone, official_rosetta, security_contact, driver, translation_focus, mirror_admin, upload_admin, upload_sender, date_created, homepage_content, icon, mugshot, logo, fti, official_answers, language_pack_admin, official_blueprints, enable_bug_expiration, bug_reporting_guidelines, reviewer_whiteboard, max_bug_heat, bug_reported_acknowledgement, answers_usage, blueprints_usage, translations_usage, registrant) VALUES (2, 'redhat', 'Redhat Advanced Server', 'Red Hat is a commercial distribution of the GNU/Linux Operating System.', 'redhat.com', 1, 'Red Hat', 'Red Hat is a commercial distribution of the GNU/Linux Operating System.', 1, NULL, 1, NULL, false, false, NULL, 8, NULL, 1, NULL, NULL, '2006-10-16 18:31:43.417928', NULL, NULL, NULL, NULL, NULL, false, NULL, false, false, NULL, NULL, NULL, NULL, 10, 10, 10, 60);
1916INSERT INTO distribution (id, name, title, description, domainname, owner, displayname, summary, members, translationgroup, translationpermission, bug_supervisor, official_malone, official_rosetta, security_contact, driver, translation_focus, mirror_admin, upload_admin, upload_sender, date_created, homepage_content, icon, mugshot, logo, fti, official_answers, language_pack_admin, official_blueprints, enable_bug_expiration, bug_reporting_guidelines, reviewer_whiteboard, max_bug_heat, bug_reported_acknowledgement, answers_usage, blueprints_usage, translations_usage) VALUES (3, 'debian', 'Debian GNU/Linux', 'Debian GNU/Linux is1919INSERT INTO distribution (id, name, title, description, domainname, owner, displayname, summary, members, translationgroup, translationpermission, bug_supervisor, official_malone, official_rosetta, security_contact, driver, translation_focus, mirror_admin, upload_admin, upload_sender, date_created, homepage_content, icon, mugshot, logo, fti, official_answers, language_pack_admin, official_blueprints, enable_bug_expiration, bug_reporting_guidelines, reviewer_whiteboard, max_bug_heat, bug_reported_acknowledgement, answers_usage, blueprints_usage, translations_usage, registrant) VALUES (3, 'debian', 'Debian GNU/Linux', 'Debian GNU/Linux is
1917a non commercial distribution of a GNU/Linux Operating System for many1920a non commercial distribution of a GNU/Linux Operating System for many
1918platforms.', 'debian.org', 1, 'Debian', 'Debian GNU/Linux is1921platforms.', 'debian.org', 1, 'Debian', 'Debian GNU/Linux is
1919a non commercial distribution of a GNU/Linux Operating System for many1922a non commercial distribution of a GNU/Linux Operating System for many
1920platforms.', 1, NULL, 1, NULL, false, false, NULL, NULL, NULL, 1, NULL, NULL, '2006-10-16 18:31:43.418942', NULL, NULL, NULL, NULL, NULL, false, NULL, false, false, NULL, NULL, NULL, NULL, 10, 10, 10);1923platforms.', 1, NULL, 1, NULL, false, false, NULL, NULL, NULL, 1, NULL, NULL, '2006-10-16 18:31:43.418942', NULL, NULL, NULL, NULL, NULL, false, NULL, false, false, NULL, NULL, NULL, NULL, 10, 10, 10, 60);
1921INSERT INTO distribution (id, name, title, description, domainname, owner, displayname, summary, members, translationgroup, translationpermission, bug_supervisor, official_malone, official_rosetta, security_contact, driver, translation_focus, mirror_admin, upload_admin, upload_sender, date_created, homepage_content, icon, mugshot, logo, fti, official_answers, language_pack_admin, official_blueprints, enable_bug_expiration, bug_reporting_guidelines, reviewer_whiteboard, max_bug_heat, bug_reported_acknowledgement, answers_usage, blueprints_usage, translations_usage) VALUES (4, 'gentoo', 'The Gentoo Linux', 'Gentoo is a very1924INSERT INTO distribution (id, name, title, description, domainname, owner, displayname, summary, members, translationgroup, translationpermission, bug_supervisor, official_malone, official_rosetta, security_contact, driver, translation_focus, mirror_admin, upload_admin, upload_sender, date_created, homepage_content, icon, mugshot, logo, fti, official_answers, language_pack_admin, official_blueprints, enable_bug_expiration, bug_reporting_guidelines, reviewer_whiteboard, max_bug_heat, bug_reported_acknowledgement, answers_usage, blueprints_usage, translations_usage, registrant) VALUES (4, 'gentoo', 'The Gentoo Linux', 'Gentoo is a very
1922customizeable GNU/Linux Distribution that is designed to let you build every1925customizeable GNU/Linux Distribution that is designed to let you build every
1923single package yourself, with your own preferences.', 'gentoo.org', 1, 'Gentoo', 'Gentoo is a very customizeable GNU/Linux Distribution that is designed to let you build every single package yourself, with your own preferences.', 1, NULL, 1, NULL, true, false, NULL, NULL, NULL, 1, NULL, NULL, '2006-10-16 18:31:43.41974', NULL, NULL, NULL, NULL, NULL, false, NULL, false, false, NULL, NULL, NULL, NULL, 10, 10, 10);1926single package yourself, with your own preferences.', 'gentoo.org', 1, 'Gentoo', 'Gentoo is a very customizeable GNU/Linux Distribution that is designed to let you build every single package yourself, with your own preferences.', 1, NULL, 1, NULL, true, false, NULL, NULL, NULL, 1, NULL, NULL, '2006-10-16 18:31:43.41974', NULL, NULL, NULL, NULL, NULL, false, NULL, false, false, NULL, NULL, NULL, NULL, 10, 10, 10, 60);
1924INSERT INTO distribution (id, name, title, description, domainname, owner, displayname, summary, members, translationgroup, translationpermission, bug_supervisor, official_malone, official_rosetta, security_contact, driver, translation_focus, mirror_admin, upload_admin, upload_sender, date_created, homepage_content, icon, mugshot, logo, fti, official_answers, language_pack_admin, official_blueprints, enable_bug_expiration, bug_reporting_guidelines, reviewer_whiteboard, max_bug_heat, bug_reported_acknowledgement, answers_usage, blueprints_usage, translations_usage) VALUES (5, 'kubuntu', 'Kubuntu - Free KDE-based Linux', 'Kubuntu is an entirely free Linux distribution that uses the K Desktop1927INSERT INTO distribution (id, name, title, description, domainname, owner, displayname, summary, members, translationgroup, translationpermission, bug_supervisor, official_malone, official_rosetta, security_contact, driver, translation_focus, mirror_admin, upload_admin, upload_sender, date_created, homepage_content, icon, mugshot, logo, fti, official_answers, language_pack_admin, official_blueprints, enable_bug_expiration, bug_reporting_guidelines, reviewer_whiteboard, max_bug_heat, bug_reported_acknowledgement, answers_usage, blueprints_usage, translations_usage, registrant) VALUES (5, 'kubuntu', 'Kubuntu - Free KDE-based Linux', 'Kubuntu is an entirely free Linux distribution that uses the K Desktop
1925Environment as its default desktop after install.', 'kubuntu.org', 1, 'Kubuntu', 'Kubuntu is an entirely free Linux distribution that uses the K Desktop1928Environment as its default desktop after install.', 'kubuntu.org', 1, 'Kubuntu', 'Kubuntu is an entirely free Linux distribution that uses the K Desktop
1926Environment as its default desktop after install.', 1, NULL, 1, NULL, false, false, NULL, 8, NULL, 1, NULL, NULL, '2006-10-16 18:31:43.420551', NULL, NULL, NULL, NULL, NULL, false, NULL, false, false, NULL, NULL, NULL, NULL, 10, 10, 10);1929Environment as its default desktop after install.', 1, NULL, 1, NULL, false, false, NULL, 8, NULL, 1, NULL, NULL, '2006-10-16 18:31:43.420551', NULL, NULL, NULL, NULL, NULL, false, NULL, false, false, NULL, NULL, NULL, NULL, 10, 10, 10, 60);
1927INSERT INTO distribution (id, name, title, description, domainname, owner, displayname, summary, members, translationgroup, translationpermission, bug_supervisor, official_malone, official_rosetta, security_contact, driver, translation_focus, mirror_admin, upload_admin, upload_sender, date_created, homepage_content, icon, mugshot, logo, fti, official_answers, language_pack_admin, official_blueprints, enable_bug_expiration, bug_reporting_guidelines, reviewer_whiteboard, max_bug_heat, bug_reported_acknowledgement, answers_usage, blueprints_usage, translations_usage) VALUES (7, 'guadalinex', 'GuadaLinex: Linux for Andalucia', 'GuadaLinex is based on Ubuntu and adds full support for applications specific to the local environment in Andalucia.', 'guadalinex.es', 4, 'GuadaLinex', 'The GuadaLinex team produces a high quality linux for the Andalucian marketplace.', 32, NULL, 1, NULL, false, false, NULL, NULL, NULL, 4, NULL, NULL, '2006-10-16 18:31:43.421329', NULL, NULL, NULL, NULL, NULL, false, NULL, false, false, NULL, NULL, NULL, NULL, 10, 10, 10);1930INSERT INTO distribution (id, name, title, description, domainname, owner, displayname, summary, members, translationgroup, translationpermission, bug_supervisor, official_malone, official_rosetta, security_contact, driver, translation_focus, mirror_admin, upload_admin, upload_sender, date_created, homepage_content, icon, mugshot, logo, fti, official_answers, language_pack_admin, official_blueprints, enable_bug_expiration, bug_reporting_guidelines, reviewer_whiteboard, max_bug_heat, bug_reported_acknowledgement, answers_usage, blueprints_usage, translations_usage, registrant) VALUES (7, 'guadalinex', 'GuadaLinex: Linux for Andalucia', 'GuadaLinex is based on Ubuntu and adds full support for applications specific to the local environment in Andalucia.', 'guadalinex.es', 4, 'GuadaLinex', 'The GuadaLinex team produces a high quality linux for the Andalucian marketplace.', 32, NULL, 1, NULL, false, false, NULL, NULL, NULL, 4, NULL, NULL, '2006-10-16 18:31:43.421329', NULL, NULL, NULL, NULL, NULL, false, NULL, false, false, NULL, NULL, NULL, NULL, 10, 10, 10, 60);
1928INSERT INTO distribution (id, name, title, description, domainname, owner, displayname, summary, members, translationgroup, translationpermission, bug_supervisor, official_malone, official_rosetta, security_contact, driver, translation_focus, mirror_admin, upload_admin, upload_sender, date_created, homepage_content, icon, mugshot, logo, fti, official_answers, language_pack_admin, official_blueprints, enable_bug_expiration, bug_reporting_guidelines, reviewer_whiteboard, max_bug_heat, bug_reported_acknowledgement, answers_usage, blueprints_usage, translations_usage) VALUES (8, 'ubuntutest', 'Ubuntu Test', 'Ubuntu Test', 'ubuntulinux.org', 17, 'ubuntutest', 'Ubuntu Test summary', 17, NULL, 1, NULL, false, false, NULL, NULL, NULL, 17, NULL, NULL, '2006-10-16 18:31:43.422162', NULL, NULL, NULL, NULL, NULL, false, NULL, false, false, NULL, NULL, NULL, NULL, 10, 10, 10);1931INSERT INTO distribution (id, name, title, description, domainname, owner, displayname, summary, members, translationgroup, translationpermission, bug_supervisor, official_malone, official_rosetta, security_contact, driver, translation_focus, mirror_admin, upload_admin, upload_sender, date_created, homepage_content, icon, mugshot, logo, fti, official_answers, language_pack_admin, official_blueprints, enable_bug_expiration, bug_reporting_guidelines, reviewer_whiteboard, max_bug_heat, bug_reported_acknowledgement, answers_usage, blueprints_usage, translations_usage, registrant) VALUES (8, 'ubuntutest', 'Ubuntu Test', 'Ubuntu Test', 'ubuntulinux.org', 17, 'ubuntutest', 'Ubuntu Test summary', 17, NULL, 1, NULL, false, false, NULL, NULL, NULL, 17, NULL, NULL, '2006-10-16 18:31:43.422162', NULL, NULL, NULL, NULL, NULL, false, NULL, false, false, NULL, NULL, NULL, NULL, 10, 10, 10, 60);
19291932
19301933
1931ALTER TABLE distribution ENABLE TRIGGER ALL;1934ALTER TABLE distribution ENABLE TRIGGER ALL;
@@ -4401,6 +4404,13 @@
4401ALTER TABLE featureflagchangelogentry ENABLE TRIGGER ALL;4404ALTER TABLE featureflagchangelogentry ENABLE TRIGGER ALL;
44024405
44034406
4407ALTER TABLE featureflagchangelogentry DISABLE TRIGGER ALL;
4408
4409
4410
4411ALTER TABLE featureflagchangelogentry ENABLE TRIGGER ALL;
4412
4413
4404ALTER TABLE flatpackagesetinclusion DISABLE TRIGGER ALL;4414ALTER TABLE flatpackagesetinclusion DISABLE TRIGGER ALL;
44054415
44064416
@@ -9915,6 +9925,13 @@
9915ALTER TABLE projectrelationship ENABLE TRIGGER ALL;9925ALTER TABLE projectrelationship ENABLE TRIGGER ALL;
99169926
99179927
9928ALTER TABLE publisherconfig DISABLE TRIGGER ALL;
9929
9930
9931
9932ALTER TABLE publisherconfig ENABLE TRIGGER ALL;
9933
9934
9918ALTER TABLE pushmirroraccess DISABLE TRIGGER ALL;9935ALTER TABLE pushmirroraccess DISABLE TRIGGER ALL;
99199936
99209937
99219938
=== modified file 'database/sampledata/current.sql'
--- database/sampledata/current.sql 2011-03-02 21:51:45 +0000
+++ database/sampledata/current.sql 2011-03-14 14:59:36 +0000
@@ -840,6 +840,9 @@
840840
841841
842842
843
844
845
843SET SESSION AUTHORIZATION DEFAULT;846SET SESSION AUTHORIZATION DEFAULT;
844847
845ALTER TABLE account DISABLE TRIGGER ALL;848ALTER TABLE account DISABLE TRIGGER ALL;
@@ -1911,21 +1914,21 @@
19111914
1912ALTER TABLE distribution DISABLE TRIGGER ALL;1915ALTER TABLE distribution DISABLE TRIGGER ALL;
19131916
1914INSERT INTO distribution (id, name, title, description, domainname, owner, displayname, summary, members, translationgroup, translationpermission, bug_supervisor, official_malone, official_rosetta, security_contact, driver, translation_focus, mirror_admin, upload_admin, upload_sender, date_created, homepage_content, icon, mugshot, logo, fti, official_answers, language_pack_admin, official_blueprints, enable_bug_expiration, bug_reporting_guidelines, reviewer_whiteboard, max_bug_heat, bug_reported_acknowledgement, answers_usage, blueprints_usage, translations_usage) VALUES (1, 'ubuntu', 'Ubuntu Linux', 'Ubuntu is a new approach to Linux Distribution that includes regular releases, and a simplified single-CD installation system.', 'ubuntulinux.org', 17, 'Ubuntu', 'Ubuntu is a new approach to Linux Distribution that includes regular releases, and a simplified single-CD installation system.', 17, NULL, 1, NULL, true, true, NULL, NULL, 3, 59, NULL, NULL, '2006-10-16 18:31:43.415195', NULL, NULL, NULL, NULL, NULL, true, NULL, true, true, NULL, NULL, NULL, NULL, 10, 10, 10);1917INSERT INTO distribution (id, name, title, description, domainname, owner, displayname, summary, members, translationgroup, translationpermission, bug_supervisor, official_malone, official_rosetta, security_contact, driver, translation_focus, mirror_admin, upload_admin, upload_sender, date_created, homepage_content, icon, mugshot, logo, fti, official_answers, language_pack_admin, official_blueprints, enable_bug_expiration, bug_reporting_guidelines, reviewer_whiteboard, max_bug_heat, bug_reported_acknowledgement, answers_usage, blueprints_usage, translations_usage, registrant) VALUES (1, 'ubuntu', 'Ubuntu Linux', 'Ubuntu is a new approach to Linux Distribution that includes regular releases, and a simplified single-CD installation system.', 'ubuntulinux.org', 17, 'Ubuntu', 'Ubuntu is a new approach to Linux Distribution that includes regular releases, and a simplified single-CD installation system.', 17, NULL, 1, NULL, true, true, NULL, NULL, 3, 59, NULL, NULL, '2006-10-16 18:31:43.415195', NULL, NULL, NULL, NULL, NULL, true, NULL, true, true, NULL, NULL, NULL, NULL, 10, 10, 10, 60);
1915INSERT INTO distribution (id, name, title, description, domainname, owner, displayname, summary, members, translationgroup, translationpermission, bug_supervisor, official_malone, official_rosetta, security_contact, driver, translation_focus, mirror_admin, upload_admin, upload_sender, date_created, homepage_content, icon, mugshot, logo, fti, official_answers, language_pack_admin, official_blueprints, enable_bug_expiration, bug_reporting_guidelines, reviewer_whiteboard, max_bug_heat, bug_reported_acknowledgement, answers_usage, blueprints_usage, translations_usage) VALUES (2, 'redhat', 'Redhat Advanced Server', 'Red Hat is a commercial distribution of the GNU/Linux Operating System.', 'redhat.com', 1, 'Red Hat', 'Red Hat is a commercial distribution of the GNU/Linux Operating System.', 1, NULL, 1, NULL, false, false, NULL, 8, NULL, 1, NULL, NULL, '2006-10-16 18:31:43.417928', NULL, NULL, NULL, NULL, NULL, false, NULL, false, false, NULL, NULL, NULL, NULL, 10, 10, 10);1918INSERT INTO distribution (id, name, title, description, domainname, owner, displayname, summary, members, translationgroup, translationpermission, bug_supervisor, official_malone, official_rosetta, security_contact, driver, translation_focus, mirror_admin, upload_admin, upload_sender, date_created, homepage_content, icon, mugshot, logo, fti, official_answers, language_pack_admin, official_blueprints, enable_bug_expiration, bug_reporting_guidelines, reviewer_whiteboard, max_bug_heat, bug_reported_acknowledgement, answers_usage, blueprints_usage, translations_usage, registrant) VALUES (2, 'redhat', 'Redhat Advanced Server', 'Red Hat is a commercial distribution of the GNU/Linux Operating System.', 'redhat.com', 1, 'Red Hat', 'Red Hat is a commercial distribution of the GNU/Linux Operating System.', 1, NULL, 1, NULL, false, false, NULL, 8, NULL, 1, NULL, NULL, '2006-10-16 18:31:43.417928', NULL, NULL, NULL, NULL, NULL, false, NULL, false, false, NULL, NULL, NULL, NULL, 10, 10, 10, 60);
1916INSERT INTO distribution (id, name, title, description, domainname, owner, displayname, summary, members, translationgroup, translationpermission, bug_supervisor, official_malone, official_rosetta, security_contact, driver, translation_focus, mirror_admin, upload_admin, upload_sender, date_created, homepage_content, icon, mugshot, logo, fti, official_answers, language_pack_admin, official_blueprints, enable_bug_expiration, bug_reporting_guidelines, reviewer_whiteboard, max_bug_heat, bug_reported_acknowledgement, answers_usage, blueprints_usage, translations_usage) VALUES (3, 'debian', 'Debian GNU/Linux', 'Debian GNU/Linux is1919INSERT INTO distribution (id, name, title, description, domainname, owner, displayname, summary, members, translationgroup, translationpermission, bug_supervisor, official_malone, official_rosetta, security_contact, driver, translation_focus, mirror_admin, upload_admin, upload_sender, date_created, homepage_content, icon, mugshot, logo, fti, official_answers, language_pack_admin, official_blueprints, enable_bug_expiration, bug_reporting_guidelines, reviewer_whiteboard, max_bug_heat, bug_reported_acknowledgement, answers_usage, blueprints_usage, translations_usage, registrant) VALUES (3, 'debian', 'Debian GNU/Linux', 'Debian GNU/Linux is
1917a non commercial distribution of a GNU/Linux Operating System for many1920a non commercial distribution of a GNU/Linux Operating System for many
1918platforms.', 'debian.org', 1, 'Debian', 'Debian GNU/Linux is1921platforms.', 'debian.org', 1, 'Debian', 'Debian GNU/Linux is
1919a non commercial distribution of a GNU/Linux Operating System for many1922a non commercial distribution of a GNU/Linux Operating System for many
1920platforms.', 1, NULL, 1, NULL, false, false, NULL, NULL, NULL, 1, NULL, NULL, '2006-10-16 18:31:43.418942', NULL, NULL, NULL, NULL, NULL, false, NULL, false, false, NULL, NULL, NULL, NULL, 10, 10, 10);1923platforms.', 1, NULL, 1, NULL, false, false, NULL, NULL, NULL, 1, NULL, NULL, '2006-10-16 18:31:43.418942', NULL, NULL, NULL, NULL, NULL, false, NULL, false, false, NULL, NULL, NULL, NULL, 10, 10, 10, 60);
1921INSERT INTO distribution (id, name, title, description, domainname, owner, displayname, summary, members, translationgroup, translationpermission, bug_supervisor, official_malone, official_rosetta, security_contact, driver, translation_focus, mirror_admin, upload_admin, upload_sender, date_created, homepage_content, icon, mugshot, logo, fti, official_answers, language_pack_admin, official_blueprints, enable_bug_expiration, bug_reporting_guidelines, reviewer_whiteboard, max_bug_heat, bug_reported_acknowledgement, answers_usage, blueprints_usage, translations_usage) VALUES (4, 'gentoo', 'The Gentoo Linux', 'Gentoo is a very1924INSERT INTO distribution (id, name, title, description, domainname, owner, displayname, summary, members, translationgroup, translationpermission, bug_supervisor, official_malone, official_rosetta, security_contact, driver, translation_focus, mirror_admin, upload_admin, upload_sender, date_created, homepage_content, icon, mugshot, logo, fti, official_answers, language_pack_admin, official_blueprints, enable_bug_expiration, bug_reporting_guidelines, reviewer_whiteboard, max_bug_heat, bug_reported_acknowledgement, answers_usage, blueprints_usage, translations_usage, registrant) VALUES (4, 'gentoo', 'The Gentoo Linux', 'Gentoo is a very
1922customizeable GNU/Linux Distribution that is designed to let you build every1925customizeable GNU/Linux Distribution that is designed to let you build every
1923single package yourself, with your own preferences.', 'gentoo.org', 1, 'Gentoo', 'Gentoo is a very customizeable GNU/Linux Distribution that is designed to let you build every single package yourself, with your own preferences.', 1, NULL, 1, NULL, true, false, NULL, NULL, NULL, 1, NULL, NULL, '2006-10-16 18:31:43.41974', NULL, NULL, NULL, NULL, NULL, false, NULL, false, false, NULL, NULL, NULL, NULL, 10, 10, 10);1926single package yourself, with your own preferences.', 'gentoo.org', 1, 'Gentoo', 'Gentoo is a very customizeable GNU/Linux Distribution that is designed to let you build every single package yourself, with your own preferences.', 1, NULL, 1, NULL, true, false, NULL, NULL, NULL, 1, NULL, NULL, '2006-10-16 18:31:43.41974', NULL, NULL, NULL, NULL, NULL, false, NULL, false, false, NULL, NULL, NULL, NULL, 10, 10, 10, 60);
1924INSERT INTO distribution (id, name, title, description, domainname, owner, displayname, summary, members, translationgroup, translationpermission, bug_supervisor, official_malone, official_rosetta, security_contact, driver, translation_focus, mirror_admin, upload_admin, upload_sender, date_created, homepage_content, icon, mugshot, logo, fti, official_answers, language_pack_admin, official_blueprints, enable_bug_expiration, bug_reporting_guidelines, reviewer_whiteboard, max_bug_heat, bug_reported_acknowledgement, answers_usage, blueprints_usage, translations_usage) VALUES (5, 'kubuntu', 'Kubuntu - Free KDE-based Linux', 'Kubuntu is an entirely free Linux distribution that uses the K Desktop1927INSERT INTO distribution (id, name, title, description, domainname, owner, displayname, summary, members, translationgroup, translationpermission, bug_supervisor, official_malone, official_rosetta, security_contact, driver, translation_focus, mirror_admin, upload_admin, upload_sender, date_created, homepage_content, icon, mugshot, logo, fti, official_answers, language_pack_admin, official_blueprints, enable_bug_expiration, bug_reporting_guidelines, reviewer_whiteboard, max_bug_heat, bug_reported_acknowledgement, answers_usage, blueprints_usage, translations_usage, registrant) VALUES (5, 'kubuntu', 'Kubuntu - Free KDE-based Linux', 'Kubuntu is an entirely free Linux distribution that uses the K Desktop
1925Environment as its default desktop after install.', 'kubuntu.org', 1, 'Kubuntu', 'Kubuntu is an entirely free Linux distribution that uses the K Desktop1928Environment as its default desktop after install.', 'kubuntu.org', 1, 'Kubuntu', 'Kubuntu is an entirely free Linux distribution that uses the K Desktop
1926Environment as its default desktop after install.', 1, NULL, 1, NULL, false, false, NULL, 8, NULL, 1, NULL, NULL, '2006-10-16 18:31:43.420551', NULL, NULL, NULL, NULL, NULL, false, NULL, false, false, NULL, NULL, NULL, NULL, 10, 10, 10);1929Environment as its default desktop after install.', 1, NULL, 1, NULL, false, false, NULL, 8, NULL, 1, NULL, NULL, '2006-10-16 18:31:43.420551', NULL, NULL, NULL, NULL, NULL, false, NULL, false, false, NULL, NULL, NULL, NULL, 10, 10, 10, 60);
1927INSERT INTO distribution (id, name, title, description, domainname, owner, displayname, summary, members, translationgroup, translationpermission, bug_supervisor, official_malone, official_rosetta, security_contact, driver, translation_focus, mirror_admin, upload_admin, upload_sender, date_created, homepage_content, icon, mugshot, logo, fti, official_answers, language_pack_admin, official_blueprints, enable_bug_expiration, bug_reporting_guidelines, reviewer_whiteboard, max_bug_heat, bug_reported_acknowledgement, answers_usage, blueprints_usage, translations_usage) VALUES (7, 'guadalinex', 'GuadaLinex: Linux for Andalucia', 'GuadaLinex is based on Ubuntu and adds full support for applications specific to the local environment in Andalucia.', 'guadalinex.es', 4, 'GuadaLinex', 'The GuadaLinex team produces a high quality linux for the Andalucian marketplace.', 32, NULL, 1, NULL, false, false, NULL, NULL, NULL, 4, NULL, NULL, '2006-10-16 18:31:43.421329', NULL, NULL, NULL, NULL, NULL, false, NULL, false, false, NULL, NULL, NULL, NULL, 10, 10, 10);1930INSERT INTO distribution (id, name, title, description, domainname, owner, displayname, summary, members, translationgroup, translationpermission, bug_supervisor, official_malone, official_rosetta, security_contact, driver, translation_focus, mirror_admin, upload_admin, upload_sender, date_created, homepage_content, icon, mugshot, logo, fti, official_answers, language_pack_admin, official_blueprints, enable_bug_expiration, bug_reporting_guidelines, reviewer_whiteboard, max_bug_heat, bug_reported_acknowledgement, answers_usage, blueprints_usage, translations_usage, registrant) VALUES (7, 'guadalinex', 'GuadaLinex: Linux for Andalucia', 'GuadaLinex is based on Ubuntu and adds full support for applications specific to the local environment in Andalucia.', 'guadalinex.es', 4, 'GuadaLinex', 'The GuadaLinex team produces a high quality linux for the Andalucian marketplace.', 32, NULL, 1, NULL, false, false, NULL, NULL, NULL, 4, NULL, NULL, '2006-10-16 18:31:43.421329', NULL, NULL, NULL, NULL, NULL, false, NULL, false, false, NULL, NULL, NULL, NULL, 10, 10, 10, 60);
1928INSERT INTO distribution (id, name, title, description, domainname, owner, displayname, summary, members, translationgroup, translationpermission, bug_supervisor, official_malone, official_rosetta, security_contact, driver, translation_focus, mirror_admin, upload_admin, upload_sender, date_created, homepage_content, icon, mugshot, logo, fti, official_answers, language_pack_admin, official_blueprints, enable_bug_expiration, bug_reporting_guidelines, reviewer_whiteboard, max_bug_heat, bug_reported_acknowledgement, answers_usage, blueprints_usage, translations_usage) VALUES (8, 'ubuntutest', 'Ubuntu Test', 'Ubuntu Test', 'ubuntulinux.org', 17, 'ubuntutest', 'Ubuntu Test summary', 17, NULL, 1, NULL, false, false, NULL, NULL, NULL, 17, NULL, NULL, '2006-10-16 18:31:43.422162', NULL, NULL, NULL, NULL, NULL, false, NULL, false, false, NULL, NULL, NULL, NULL, 10, 10, 10);1931INSERT INTO distribution (id, name, title, description, domainname, owner, displayname, summary, members, translationgroup, translationpermission, bug_supervisor, official_malone, official_rosetta, security_contact, driver, translation_focus, mirror_admin, upload_admin, upload_sender, date_created, homepage_content, icon, mugshot, logo, fti, official_answers, language_pack_admin, official_blueprints, enable_bug_expiration, bug_reporting_guidelines, reviewer_whiteboard, max_bug_heat, bug_reported_acknowledgement, answers_usage, blueprints_usage, translations_usage, registrant) VALUES (8, 'ubuntutest', 'Ubuntu Test', 'Ubuntu Test', 'ubuntulinux.org', 17, 'ubuntutest', 'Ubuntu Test summary', 17, NULL, 1, NULL, false, false, NULL, NULL, NULL, 17, NULL, NULL, '2006-10-16 18:31:43.422162', NULL, NULL, NULL, NULL, NULL, false, NULL, false, false, NULL, NULL, NULL, NULL, 10, 10, 10, 60);
19291932
19301933
1931ALTER TABLE distribution ENABLE TRIGGER ALL;1934ALTER TABLE distribution ENABLE TRIGGER ALL;
@@ -4406,6 +4409,13 @@
4406ALTER TABLE featureflagchangelogentry ENABLE TRIGGER ALL;4409ALTER TABLE featureflagchangelogentry ENABLE TRIGGER ALL;
44074410
44084411
4412ALTER TABLE featureflagchangelogentry DISABLE TRIGGER ALL;
4413
4414
4415
4416ALTER TABLE featureflagchangelogentry ENABLE TRIGGER ALL;
4417
4418
4409ALTER TABLE flatpackagesetinclusion DISABLE TRIGGER ALL;4419ALTER TABLE flatpackagesetinclusion DISABLE TRIGGER ALL;
44104420
44114421
@@ -9920,6 +9930,13 @@
9920ALTER TABLE projectrelationship ENABLE TRIGGER ALL;9930ALTER TABLE projectrelationship ENABLE TRIGGER ALL;
99219931
99229932
9933ALTER TABLE publisherconfig DISABLE TRIGGER ALL;
9934
9935
9936
9937ALTER TABLE publisherconfig ENABLE TRIGGER ALL;
9938
9939
9923ALTER TABLE pushmirroraccess DISABLE TRIGGER ALL;9940ALTER TABLE pushmirroraccess DISABLE TRIGGER ALL;
99249941
99259942
99269943
=== modified file 'database/schema/comments.sql'
--- database/schema/comments.sql 2011-03-07 22:02:45 +0000
+++ database/schema/comments.sql 2011-03-14 14:59:36 +0000
@@ -1098,7 +1098,7 @@
1098COMMENT ON COLUMN Distribution.reviewer_whiteboard IS 'A whiteboard for Launchpad admins, registry experts and the project owners to capture the state of current issues with the project.';1098COMMENT ON COLUMN Distribution.reviewer_whiteboard IS 'A whiteboard for Launchpad admins, registry experts and the project owners to capture the state of current issues with the project.';
1099COMMENT ON COLUMN Distribution.max_bug_heat IS 'The highest heat value across bugs for this distribution.';1099COMMENT ON COLUMN Distribution.max_bug_heat IS 'The highest heat value across bugs for this distribution.';
1100COMMENT ON COLUMN Distribution.bug_reported_acknowledgement IS 'A message of acknowledgement to display to a bug reporter after they\'ve reported a new bug.';1100COMMENT ON COLUMN Distribution.bug_reported_acknowledgement IS 'A message of acknowledgement to display to a bug reporter after they\'ve reported a new bug.';
11011101COMMENT ON COLUMN Distribution.registrant IS 'The person in launchpad who registered this distribution.';
11021102
1103-- DistroSeries1103-- DistroSeries
11041104
11051105
=== added file 'database/schema/patch-2208-53-0.sql'
--- database/schema/patch-2208-53-0.sql 1970-01-01 00:00:00 +0000
+++ database/schema/patch-2208-53-0.sql 2011-03-14 14:59:36 +0000
@@ -0,0 +1,20 @@
1-- Copyright 2009 Canonical Ltd. This software is licensed under the
2-- GNU Affero General Public License version 3 (see the file LICENSE).
3
4SET client_min_messages=ERROR;
5
6-- Add a registrant column to distributions.
7ALTER TABLE Distribution
8 ADD COLUMN registrant integer REFERENCES Person;
9
10-- Set registrant to owner for existing distros.
11update Distribution
12 SET registrant = owner;
13
14-- Add NOT NULL constraint to registrant column.
15ALTER TABLE Distribution ALTER COLUMN registrant SET NOT NULL;
16
17-- Add index to registrant column.
18CREATE INDEX distribution__registrant__idx ON Distribution(registrant);
19
20INSERT INTO LaunchpadDatabaseRevision VALUES (2208, 53, 0);
021
=== modified file 'lib/lp/app/stories/launchpad-root/site-search.txt'
--- lib/lp/app/stories/launchpad-root/site-search.txt 2011-02-17 17:02:54 +0000
+++ lib/lp/app/stories/launchpad-root/site-search.txt 2011-03-14 14:59:36 +0000
@@ -181,9 +181,11 @@
181 >>> print_search_results()181 >>> print_search_results()
182 Exact matches182 Exact matches
183 Ubuntu183 Ubuntu
184 Ubuntu is a new approach to Linux Distribution that includes regular184 Ubuntu is a new approach to Linux Distribution that includes ...
185 releases, and a simplified single-CD installation system.185 Registered
186 Registered on 2006-10-16186 by
187 Registry Administrators
188 on 2006-10-16
187189
188The user enters the number 1, and he sees a bug and a question in the190The user enters the number 1, and he sees a bug and a question in the
189"Exact matches" section.191"Exact matches" section.
190192
=== modified file 'lib/lp/registry/browser/configure.zcml'
--- lib/lp/registry/browser/configure.zcml 2011-03-08 14:25:42 +0000
+++ lib/lp/registry/browser/configure.zcml 2011-03-14 14:59:36 +0000
@@ -1948,7 +1948,7 @@
1948 for="lp.registry.interfaces.distribution.IDistribution"1948 for="lp.registry.interfaces.distribution.IDistribution"
1949 permission="launchpad.Edit"1949 permission="launchpad.Edit"
1950 facet="overview"1950 facet="overview"
1951 class="canonical.launchpad.browser.ObjectReassignmentView">1951 class="lp.registry.browser.distribution.DistributionReassignmentView">
1952 <browser:page1952 <browser:page
1953 name="+reassign"1953 name="+reassign"
1954 template="../../../canonical/launchpad/templates/object-reassignment.pt"/>1954 template="../../../canonical/launchpad/templates/object-reassignment.pt"/>
19551955
=== modified file 'lib/lp/registry/browser/distribution.py'
--- lib/lp/registry/browser/distribution.py 2011-03-10 15:10:37 +0000
+++ lib/lp/registry/browser/distribution.py 2011-03-14 14:59:36 +0000
@@ -22,6 +22,7 @@
22 'DistributionPackageSearchView',22 'DistributionPackageSearchView',
23 'DistributionPendingReviewMirrorsView',23 'DistributionPendingReviewMirrorsView',
24 'DistributionPublisherConfigView',24 'DistributionPublisherConfigView',
25 'DistributionReassignmentView',
25 'DistributionSeriesView',26 'DistributionSeriesView',
26 'DistributionSeriesMirrorsRSSView',27 'DistributionSeriesMirrorsRSSView',
27 'DistributionSeriesMirrorsView',28 'DistributionSeriesMirrorsView',
@@ -98,6 +99,7 @@
98 RegistryCollectionActionMenuBase,99 RegistryCollectionActionMenuBase,
99 )100 )
100from lp.registry.browser.pillar import PillarBugsMenu101from lp.registry.browser.pillar import PillarBugsMenu
102from lp.registry.browser.objectreassignment import ObjectReassignmentView
101from lp.registry.interfaces.distribution import (103from lp.registry.interfaces.distribution import (
102 IDerivativeDistribution,104 IDerivativeDistribution,
103 IDistribution,105 IDistribution,
@@ -336,7 +338,7 @@
336338
337 @enabled_with_permission('launchpad.Edit')339 @enabled_with_permission('launchpad.Edit')
338 def reassign(self):340 def reassign(self):
339 text = 'Change registrant'341 text = 'Change maintainer'
340 return Link('+reassign', text, icon='edit')342 return Link('+reassign', text, icon='edit')
341343
342 def newmirror(self):344 def newmirror(self):
@@ -781,6 +783,7 @@
781 domainname=data['domainname'],783 domainname=data['domainname'],
782 members=data['members'],784 members=data['members'],
783 owner=self.user,785 owner=self.user,
786 registrant=self.user,
784 )787 )
785 notify(ObjectCreatedEvent(distribution))788 notify(ObjectCreatedEvent(distribution))
786 self.next_url = canonical_url(distribution)789 self.next_url = canonical_url(distribution)
@@ -1094,6 +1097,11 @@
1094 return self.context.disabled_mirrors1097 return self.context.disabled_mirrors
10951098
10961099
1100class DistributionReassignmentView(ObjectReassignmentView):
1101 """View class for changing distribution maintainer."""
1102 ownerOrMaintainerName = 'maintainer'
1103
1104
1097class DistributionPublisherConfigView(LaunchpadFormView):1105class DistributionPublisherConfigView(LaunchpadFormView):
1098 """View class for configuring publisher options for a DistroSeries.1106 """View class for configuring publisher options for a DistroSeries.
10991107
11001108
=== renamed file 'lib/lp/registry/browser/tests/test_distribution.py' => 'lib/lp/registry/browser/tests/test_distribution_views.py'
--- lib/lp/registry/browser/tests/test_distribution.py 2011-03-10 10:59:11 +0000
+++ lib/lp/registry/browser/tests/test_distribution_views.py 2011-03-14 14:59:36 +0000
@@ -3,15 +3,21 @@
33
4__metaclass__ = type4__metaclass__ = type
55
6import soupmatchers
6from zope.component import getUtility7from zope.component import getUtility
78
8from canonical.testing.layers import DatabaseFunctionalLayer
9from canonical.launchpad.ftests import login9from canonical.launchpad.ftests import login
10from canonical.launchpad.webapp.servers import LaunchpadTestRequest10from canonical.launchpad.webapp.servers import LaunchpadTestRequest
11from canonical.testing.layers import DatabaseFunctionalLayer
11from lp.archivepublisher.interfaces.publisherconfig import IPublisherConfigSet12from lp.archivepublisher.interfaces.publisherconfig import IPublisherConfigSet
12from lp.registry.browser.distribution import DistributionPublisherConfigView13from lp.registry.browser.distribution import DistributionPublisherConfigView
13from lp.testing import TestCaseWithFactory14from lp.registry.interfaces.distribution import IDistributionSet
15from lp.testing import (
16 login_celebrity,
17 TestCaseWithFactory,
18 )
14from lp.testing.sampledata import LAUNCHPAD_ADMIN19from lp.testing.sampledata import LAUNCHPAD_ADMIN
20from lp.testing.views import create_initialized_view
1521
1622
17class TestDistributionPublisherConfigView(TestCaseWithFactory):23class TestDistributionPublisherConfigView(TestCaseWithFactory):
@@ -84,3 +90,78 @@
84 copy_base_url=u"foo",90 copy_base_url=u"foo",
85 )91 )
86 self._change_and_test_config()92 self._change_and_test_config()
93
94
95class TestDistroAddView(TestCaseWithFactory):
96 """Test the +add page for a new distribution."""
97
98 layer = DatabaseFunctionalLayer
99
100 def setUp(self):
101 super(TestDistroAddView, self).setUp()
102 self.owner = self.factory.makePerson()
103 self.registrant = self.factory.makePerson()
104 self.simple_user = self.factory.makePerson()
105
106 def test_registrant_set_by_creation(self):
107 # The registrant field should be set to the Person creating
108 # the distribution.
109 admin = login_celebrity('admin')
110 distributionset = getUtility(IDistributionSet)
111 creation_form = {
112 'field.name': 'newbuntu',
113 'field.displayname': 'newbuntu',
114 'field.title': 'newbuntu',
115 'field.summary': 'newbuntu',
116 'field.description': 'newbuntu',
117 'field.domainname': 'newbuntu',
118 'field.members': self.simple_user.name,
119 'field.actions.save': 'Save',
120 }
121 view = create_initialized_view(
122 distributionset, '+add', principal=admin,
123 method='POST', form=creation_form)
124 distribution = distributionset.getByName('newbuntu')
125 self.assertEqual(distribution.owner, admin)
126 self.assertEqual(distribution.registrant, admin)
127
128
129class TestDistroReassignView(TestCaseWithFactory):
130 """Test the +reassign page for a new distribution."""
131
132 layer = DatabaseFunctionalLayer
133
134 def setUp(self):
135 super(TestDistroReassignView, self).setUp()
136 self.owner = self.factory.makePerson()
137 self.registrant = self.factory.makePerson()
138 self.simple_user = self.factory.makePerson()
139
140 def test_reassign_distro_change_owner_not_registrant(self):
141 # Reassigning a distribution should not change the registrant.
142 admin = login_celebrity('admin')
143 distribution = self.factory.makeDistribution(
144 name="boobuntu", owner=self.owner, registrant=self.registrant)
145 reassign_form = {
146 'field.owner': self.simple_user.name,
147 'field.existing': 'existing',
148 'field.actions.change': 'Change',
149 }
150 view = create_initialized_view(
151 distribution, '+reassign', principal=admin,
152 method='POST', form=reassign_form)
153 self.assertEqual(distribution.owner, self.simple_user)
154 self.assertEqual(distribution.registrant, self.registrant)
155
156 def test_reassign_distro_page_title(self):
157 # Reassign should say maintainer instead of owner.
158 admin = login_celebrity('admin')
159 distribution = self.factory.makeDistribution(
160 name="boobuntu", owner=self.owner, registrant=self.registrant)
161 view = create_initialized_view(
162 distribution, '+reassign', principal=admin, method='GET')
163 header_match = soupmatchers.HTMLContains(
164 soupmatchers.Tag(
165 'Header should say maintainer (not owner)', 'h1',
166 text='Change the maintainer of Boobuntu'))
167 self.assertThat(view.render(), header_match)
87168
=== modified file 'lib/lp/registry/interfaces/distribution.py'
--- lib/lp/registry/interfaces/distribution.py 2011-02-24 15:30:54 +0000
+++ lib/lp/registry/interfaces/distribution.py 2011-03-14 14:59:36 +0000
@@ -209,6 +209,11 @@
209 PublicPersonChoice(209 PublicPersonChoice(
210 title=_("Owner"), vocabulary='ValidOwner',210 title=_("Owner"), vocabulary='ValidOwner',
211 description=_("The distro's owner."), required=True))211 description=_("The distro's owner."), required=True))
212 registrant = exported(
213 PublicPersonChoice(
214 title=_("Registrant"), vocabulary='ValidPersonOrTeam',
215 description=_("The distro's registrant."), required=True,
216 readonly=True))
212 date_created = exported(217 date_created = exported(
213 Datetime(title=_('Date created'),218 Datetime(title=_('Date created'),
214 description=_("The date this distribution was registered.")))219 description=_("The date this distribution was registered.")))
@@ -689,7 +694,7 @@
689 """Return the IDistribution with the given name or None."""694 """Return the IDistribution with the given name or None."""
690695
691 def new(name, displayname, title, description, summary, domainname,696 def new(name, displayname, title, description, summary, domainname,
692 members, owner, mugshot=None, logo=None, icon=None):697 members, owner, registrant, mugshot=None, logo=None, icon=None):
693 """Create a new distribution."""698 """Create a new distribution."""
694699
695 def getCurrentSourceReleases(distro_to_source_packagenames):700 def getCurrentSourceReleases(distro_to_source_packagenames):
696701
=== modified file 'lib/lp/registry/model/distribution.py'
--- lib/lp/registry/model/distribution.py 2011-03-01 05:05:26 +0000
+++ lib/lp/registry/model/distribution.py 2011-03-14 14:59:36 +0000
@@ -243,6 +243,9 @@
243 owner = ForeignKey(243 owner = ForeignKey(
244 dbName='owner', foreignKey='Person',244 dbName='owner', foreignKey='Person',
245 storm_validator=validate_public_person, notNull=True)245 storm_validator=validate_public_person, notNull=True)
246 registrant = ForeignKey(
247 dbName='registrant', foreignKey='Person',
248 storm_validator=validate_public_person, notNull=True)
246 bug_supervisor = ForeignKey(249 bug_supervisor = ForeignKey(
247 dbName='bug_supervisor', foreignKey='Person',250 dbName='bug_supervisor', foreignKey='Person',
248 storm_validator=validate_person,251 storm_validator=validate_person,
@@ -1882,7 +1885,7 @@
1882 return pillar1885 return pillar
18831886
1884 def new(self, name, displayname, title, description, summary, domainname,1887 def new(self, name, displayname, title, description, summary, domainname,
1885 members, owner, mugshot=None, logo=None, icon=None):1888 members, owner, registrant, mugshot=None, logo=None, icon=None):
1886 """See `IDistributionSet`."""1889 """See `IDistributionSet`."""
1887 distro = Distribution(1890 distro = Distribution(
1888 name=name,1891 name=name,
@@ -1894,6 +1897,7 @@
1894 members=members,1897 members=members,
1895 mirror_admin=owner,1898 mirror_admin=owner,
1896 owner=owner,1899 owner=owner,
1900 registrant=registrant,
1897 mugshot=mugshot,1901 mugshot=mugshot,
1898 logo=logo,1902 logo=logo,
1899 icon=icon)1903 icon=icon)
19001904
=== modified file 'lib/lp/registry/stories/distribution/xx-distribution-overview.txt'
--- lib/lp/registry/stories/distribution/xx-distribution-overview.txt 2010-05-17 20:09:03 +0000
+++ lib/lp/registry/stories/distribution/xx-distribution-overview.txt 2011-03-14 14:59:36 +0000
@@ -89,7 +89,9 @@
8989
90 >>> print extract_text(90 >>> print extract_text(
91 ... find_tag_by_id(anon_browser.contents, 'registration'))91 ... find_tag_by_id(anon_browser.contents, 'registration'))
92 registered by Ubuntu Team on 2006-10-1692 Registered by
93 Registry Administrators
94 on 2006-10-16
9395
94 >>> print extract_text(find_main_content(anon_browser.contents))96 >>> print extract_text(find_main_content(anon_browser.contents))
95 Ubuntu Linux97 Ubuntu Linux
9698
=== modified file 'lib/lp/registry/stories/webservice/xx-distribution.txt'
--- lib/lp/registry/stories/webservice/xx-distribution.txt 2011-02-13 22:54:48 +0000
+++ lib/lp/registry/stories/webservice/xx-distribution.txt 2011-03-14 14:59:36 +0000
@@ -43,6 +43,7 @@
43 name: u'ubuntu'43 name: u'ubuntu'
44 official_bug_tags: []44 official_bug_tags: []
45 owner_link: u'http://.../~ubuntu-team'45 owner_link: u'http://.../~ubuntu-team'
46 registrant_link: u'http://.../~registry'
46 resource_type_link: u'http://.../#distribution'47 resource_type_link: u'http://.../#distribution'
47 security_contact_link: None48 security_contact_link: None
48 self_link: u'http://.../ubuntu'49 self_link: u'http://.../ubuntu'
4950
=== modified file 'lib/lp/registry/templates/distribution-index.pt'
--- lib/lp/registry/templates/distribution-index.pt 2010-10-10 21:54:16 +0000
+++ lib/lp/registry/templates/distribution-index.pt 2011-03-14 14:59:36 +0000
@@ -11,8 +11,8 @@
11 </tal:heading>11 </tal:heading>
1212
13 <tal:registering metal:fill-slot="registering">13 <tal:registering metal:fill-slot="registering">
14 registered by14 Registered by
15 <a tal:replace="structure context/owner/fmt:link" />15 <a tal:replace="structure context/registrant/fmt:link" />
16 <span tal:content="context/date_created/fmt:displaydate"16 <span tal:content="context/date_created/fmt:displaydate"
17 tal:attributes="title context/date_created/fmt:datetime"17 tal:attributes="title context/date_created/fmt:datetime"
18 >on 2005-01-01</span>18 >on 2005-01-01</span>
1919
=== modified file 'lib/lp/registry/tests/test_distribution.py'
--- lib/lp/registry/tests/test_distribution.py 2011-03-03 15:45:58 +0000
+++ lib/lp/registry/tests/test_distribution.py 2011-03-14 14:59:36 +0000
@@ -5,14 +5,20 @@
55
6__metaclass__ = type6__metaclass__ = type
77
8from lazr.lifecycle.snapshot import Snapshot
9import soupmatchers
10from testtools.matchers import (
11 MatchesAny,
12 Not,
13 )
14from zope.component import getUtility
15from zope.security.proxy import removeSecurityProxy
16
8from canonical.launchpad.webapp import canonical_url17from canonical.launchpad.webapp import canonical_url
9from canonical.testing.layers import (18from canonical.testing.layers import (
10 DatabaseFunctionalLayer,19 DatabaseFunctionalLayer,
11 LaunchpadFunctionalLayer,20 LaunchpadFunctionalLayer,
12 )21 )
13
14from lazr.lifecycle.snapshot import Snapshot
15
16from lp.registry.errors import NoSuchDistroSeries22from lp.registry.errors import NoSuchDistroSeries
17from lp.registry.interfaces.distribution import IDistribution23from lp.registry.interfaces.distribution import IDistribution
18from lp.registry.interfaces.person import IPersonSet24from lp.registry.interfaces.person import IPersonSet
@@ -24,18 +30,12 @@
24from lp.soyuz.interfaces.distributionsourcepackagerelease import (30from lp.soyuz.interfaces.distributionsourcepackagerelease import (
25 IDistributionSourcePackageRelease,31 IDistributionSourcePackageRelease,
26 )32 )
27from lp.testing import TestCaseWithFactory33from lp.testing import (
28from lp.testing import login_person34 login_person,
35 TestCaseWithFactory,
36 )
29from lp.testing.views import create_initialized_view37from lp.testing.views import create_initialized_view
3038
31from testtools.matchers import MatchesAny
32from testtools.matchers import Not
33
34import soupmatchers
35
36from zope.component import getUtility
37from zope.security.proxy import removeSecurityProxy
38
3939
40class TestDistribution(TestCaseWithFactory):40class TestDistribution(TestCaseWithFactory):
4141
@@ -260,3 +260,25 @@
260 text='Series and milestones'))260 text='Series and milestones'))
261 self.assertThat(view.render(), series_header_match)261 self.assertThat(view.render(), series_header_match)
262 self.assertThat(view.render(), Not(add_series_match))262 self.assertThat(view.render(), Not(add_series_match))
263
264
265class DistroRegistrantTestCase(TestCaseWithFactory):
266 """A TestCase for registrants and owners of a distribution.
267
268 The registrant is the creator of the distribution (read-only field).
269 The owner is really the maintainer.
270 """
271
272 layer = DatabaseFunctionalLayer
273
274 def setUp(self):
275 super(DistroRegistrantTestCase, self).setUp()
276 self.owner = self.factory.makePerson()
277 self.registrant = self.factory.makePerson()
278
279 def test_distro_registrant_owner_differ(self):
280 distribution = self.factory.makeDistribution(
281 name="boobuntu", owner=self.owner, registrant=self.registrant)
282 self.assertNotEqual(distribution.owner, distribution.registrant)
283 self.assertEqual(distribution.owner, self.owner)
284 self.assertEqual(distribution.registrant, self.registrant)
263285
=== modified file 'lib/lp/registry/tests/test_distributionsourcepackage.py'
--- lib/lp/registry/tests/test_distributionsourcepackage.py 2010-10-04 19:50:45 +0000
+++ lib/lp/registry/tests/test_distributionsourcepackage.py 2011-03-14 14:59:36 +0000
@@ -32,7 +32,8 @@
32 distribution = distribution_set.new(name='wart',32 distribution = distribution_set.new(name='wart',
33 displayname='wart', title='wart', description='lots of warts',33 displayname='wart', title='wart', description='lots of warts',
34 summary='lots of warts', domainname='wart.dumb',34 summary='lots of warts', domainname='wart.dumb',
35 members=self.factory.makeTeam(), owner=self.factory.makePerson())35 members=self.factory.makeTeam(), owner=self.factory.makePerson(),
36 registrant=self.factory.makePerson())
36 naked_distribution = removeSecurityProxy(distribution)37 naked_distribution = removeSecurityProxy(distribution)
37 self.factory.makeSourcePackage(distroseries=distribution)38 self.factory.makeSourcePackage(distroseries=distribution)
38 dsp = naked_distribution.getSourcePackage(name='pmount')39 dsp = naked_distribution.getSourcePackage(name='pmount')
3940
=== modified file 'lib/lp/registry/tests/test_pillarname_triggers.py'
--- lib/lp/registry/tests/test_pillarname_triggers.py 2010-10-04 19:50:45 +0000
+++ lib/lp/registry/tests/test_pillarname_triggers.py 2011-03-14 14:59:36 +0000
@@ -46,12 +46,12 @@
46 # Inserting a new Distribution will populate PillarName46 # Inserting a new Distribution will populate PillarName
47 cur.execute("""47 cur.execute("""
48 INSERT INTO Distribution (48 INSERT INTO Distribution (
49 name, description, domainname, owner, displayname,49 name, description, domainname, owner, registrant,
50 summary, title, members, mirror_admin50 displayname, summary, title, members, mirror_admin
51 )51 )
52 VALUES (52 VALUES (
53 'whatever', 'whatever', 'whatever', 1, 'whatever',53 'whatever', 'whatever', 'whatever', 1, 1,
54 'whatever', 'whatever', 1, 154 'whatever', 'whatever', 'whatever', 1, 1
55 )55 )
56 """)56 """)
57 self.failUnless(is_in_sync('whatever'))57 self.failUnless(is_in_sync('whatever'))
@@ -69,7 +69,8 @@
69 """)69 """)
70 self.failUnless(is_in_sync('whatever2'))70 self.failUnless(is_in_sync('whatever2'))
7171
72 # Deleting a Distribution removes the corresponding entry in PillarName72 # Deleting a Distribution removes the corresponding entry in
73 # PillarName
73 cur.execute("DELETE FROM Distribution WHERE name='whatever2'")74 cur.execute("DELETE FROM Distribution WHERE name='whatever2'")
74 cur.execute("SELECT COUNT(*) FROM PillarName WHERE name='whatever2'")75 cur.execute("SELECT COUNT(*) FROM PillarName WHERE name='whatever2'")
75 self.failUnlessEqual(cur.fetchone()[0], 0)76 self.failUnlessEqual(cur.fetchone()[0], 0)
@@ -101,7 +102,8 @@
101102
102 # Inserting a new Product will populate PillarName103 # Inserting a new Product will populate PillarName
103 cur.execute("""104 cur.execute("""
104 INSERT INTO Product (owner, registrant, name, displayname, title, summary)105 INSERT INTO Product (
106 owner, registrant, name, displayname, title, summary)
105 VALUES (107 VALUES (
106 1, 1, 'whatever', 'whatever', 'whatever', 'whatever'108 1, 1, 'whatever', 'whatever', 'whatever', 'whatever'
107 )109 )
@@ -154,7 +156,8 @@
154 # Inserting a new ProjectGroup will populate PillarName156 # Inserting a new ProjectGroup will populate PillarName
155 cur.execute("""157 cur.execute("""
156 INSERT INTO Project (158 INSERT INTO Project (
157 name, owner, registrant, displayname, title, summary, description159 name, owner, registrant, displayname, title, summary,
160 description
158 )161 )
159 VALUES (162 VALUES (
160 'whatever', 1, 1, 'whatever', 'whatever',163 'whatever', 1, 1, 'whatever', 'whatever',
161164
=== modified file 'lib/lp/soyuz/doc/archive.txt'
--- lib/lp/soyuz/doc/archive.txt 2011-03-03 00:43:44 +0000
+++ lib/lp/soyuz/doc/archive.txt 2011-03-14 14:59:36 +0000
@@ -2460,7 +2460,7 @@
2460 >>> uber = getUtility(IDistributionSet).new(2460 >>> uber = getUtility(IDistributionSet).new(
2461 ... 'uberdistro', 'The uberdistro', 'The mother of all distros',2461 ... 'uberdistro', 'The uberdistro', 'The mother of all distros',
2462 ... 'All you would want from a distro', 'zero', 'uberdistro.org',2462 ... 'All you would want from a distro', 'zero', 'uberdistro.org',
2463 ... mark, cprov)2463 ... mark, cprov, cprov)
24642464
2465The primary archive for the Überdistro was created by the2465The primary archive for the Überdistro was created by the
2466IDistributionSet.new() method. Let's check its publish flag.2466IDistributionSet.new() method. Let's check its publish flag.
24672467
=== modified file 'lib/lp/testing/factory.py'
--- lib/lp/testing/factory.py 2011-03-11 12:34:18 +0000
+++ lib/lp/testing/factory.py 2011-03-14 14:59:36 +0000
@@ -2199,8 +2199,8 @@
2199 return library_file_alias2199 return library_file_alias
22002200
2201 def makeDistribution(self, name=None, displayname=None, owner=None,2201 def makeDistribution(self, name=None, displayname=None, owner=None,
2202 members=None, title=None, aliases=None,2202 registrant=None, members=None, title=None,
2203 bug_supervisor=None):2203 aliases=None, bug_supervisor=None):
2204 """Make a new distribution."""2204 """Make a new distribution."""
2205 if name is None:2205 if name is None:
2206 name = self.getUniqueString(prefix="distribution")2206 name = self.getUniqueString(prefix="distribution")
@@ -2211,13 +2211,15 @@
2211 description = self.getUniqueString()2211 description = self.getUniqueString()
2212 summary = self.getUniqueString()2212 summary = self.getUniqueString()
2213 domainname = self.getUniqueString()2213 domainname = self.getUniqueString()
2214 if registrant is None:
2215 registrant = self.makePerson()
2214 if owner is None:2216 if owner is None:
2215 owner = self.makePerson()2217 owner = self.makePerson()
2216 if members is None:2218 if members is None:
2217 members = self.makeTeam(owner)2219 members = self.makeTeam(owner)
2218 distro = getUtility(IDistributionSet).new(2220 distro = getUtility(IDistributionSet).new(
2219 name, displayname, title, description, summary, domainname,2221 name, displayname, title, description, summary, domainname,
2220 members, owner)2222 members, owner, registrant)
2221 if aliases is not None:2223 if aliases is not None:
2222 removeSecurityProxy(distro).setAliases(aliases)2224 removeSecurityProxy(distro).setAliases(aliases)
2223 if bug_supervisor is not None:2225 if bug_supervisor is not None:

Subscribers

People subscribed via source and target branches

to status/vote changes: