Merge lp://staging/~julian-edwards/launchpad/schema-distro-parents into lp://staging/launchpad/db-devel
Status: | Merged |
---|---|
Approved by: | Julian Edwards |
Approved revision: | no longer in the source branch. |
Merged at revision: | 10447 |
Proposed branch: | lp://staging/~julian-edwards/launchpad/schema-distro-parents |
Merge into: | lp://staging/launchpad/db-devel |
Diff against target: |
424 lines (+336/-0) 9 files modified
database/schema/comments.sql (+6/-0) database/schema/patch-2208-61-0.sql (+20/-0) database/schema/security.cfg (+1/-0) lib/canonical/launchpad/security.py (+13/-0) lib/lp/registry/configure.zcml (+16/-0) lib/lp/registry/interfaces/distroseriesparent.py (+62/-0) lib/lp/registry/model/distroseriesparent.py (+74/-0) lib/lp/registry/tests/test_distroseriesparent.py (+132/-0) lib/lp/testing/factory.py (+12/-0) |
To merge this branch: | bzr merge lp://staging/~julian-edwards/launchpad/schema-distro-parents |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Henning Eggers (community) | code | Approve | |
Stuart Bishop (community) | db | Approve | |
Review via email: mp+57898@code.staging.launchpad.net |
Commit message
[r=henninge,stub][bug=754750] [incr] Add DistroSeriesParent table to track multiple parents for a derived distroseries.
Description of the change
Add a new database table, DistroSeriesParent, that will track all of a distroseries' derived distroseries and whether they've been initialized or not (initialized is when the packages get copied from the parent, this needs to be tracked so it can't happen twice).
This will eventually replace DistroSeries.
Most of the changes are boilerplate. The security declarations are set up so the person changing the data must have edit permission on the derived series.
Other than that, a routine and dull branch.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi Julian,
thanks for adding this linking table. You indeed almost had me bored but I did
find a few of my pet issues in your branch ... ;-)
I'd really like to see the tests cleaned up before I approve this.
review needs-fixing
Cheers,
Henning
Am 15.04.2011 18:17, schrieb Julian Edwards: schema/ comments. sql' schema/ patch-2208- 99-0.sql' schema/ security. cfg'
> === modified file 'database/
> === added file 'database/
> === modified file 'database/
Stub will comment on these, if needed. Look ok to me. ;)
> === modified file 'lib/canonical/ launchpad/ security. py' launchpad/ security. py 2011-04-14 15:26:55 +0000 launchpad/ security. py 2011-04-15 16:31:45 +0000 urcePackage, interfaces. distroseries import IDistroSeries interfaces. distroseriespar ent import IDistroSeriesParent interfaces. distroseriesdif ference import ( fferenceEdit, sParent( AuthorizationBa se): Parent can be edited by the same people who can edit distroseries. """ ted(self, user): n(self. permission, self.obj. derived_ series)
> --- lib/canonical/
> +++ lib/canonical/
> @@ -113,6 +113,7 @@
> IDistributionSo
> )
> from lp.registry.
> +from lp.registry.
> from lp.registry.
> IDistroSeriesDi
> )
> @@ -1014,6 +1015,16 @@
> usedfor = IDistroSeries
>
>
> +class EditDistroSerie
> + """DistroSeries
> + the derived_
> + permission = "launchpad.Edit"
> + usedfor = IDistroSeriesParent
> +
> + def checkAuthentica
> + return check_permissio
Using check_permission in security adapters is flawed and needs to be stopped. sByReleaseManag erOrDistroOwner sOrAdmins directly or leave it in
Please see bug 764406 as to why. You can fix this by referencing
EditDistroSerie
to be fixed when that bug is fixed. ;)
> + AnonymousAuthor ization) : registry/ configure. zcml' registry/ interfaces/ distroseriespar ent.py' registry/ model/distroser iesparent. py'
> +
> class ViewCountry(
> """Anyone can view a Country."""
> usedfor = ICountry
>
> === modified file 'lib/lp/
> === added file 'lib/lp/
> === added file 'lib/lp/
Yeah, this is the boring bit ... ;) Thanks for a solid implementation.
> === added file 'lib/lp/ registry/ tests/test_ distroseriespar ent.py' registry/ tests/test_ distroseriespar ent.py 1970-01-01 00:00:00 +0000 registry/ tests/test_ distroseriespar ent.py 2011-04-15 16:31:45 +0000 verify import verifyObject interfaces import Unauthorized launchpad. ftests import login testing. layers import ( nalLayer, eLayer, interfaces. distroseriespar ent import ( rent, rentSet,
> --- lib/lp/
> +++ lib/lp/
> @@ -0,0 +1,145 @@
> +# Copyright 2011 Canonical Ltd. This software is licensed under the
> +# GNU Affero General Public License version 3 (see the file LICENSE).
> +
> +"""Tests for DistroSeriesParent model class."""
> +
> +__metaclass__ = type
> +
> +from testtools.matchers import (
> + Equals,
> + MatchesStructure,
> + )
> +
> +from zope.component import getUtility
> +from zope.interface.
> +from zope.security.
> +
> +from canonical.
> +from canonical.
> + DatabaseFunctio
> + ZopelessDatabas
> + )
> +from lp.registry.
> + IDistroSeriesPa
> + IDistroSeriesPa
> + )
> +from lp.testing import (
> + person_logged_in,
> +...