Merge lp://staging/~thumper/launchpad/person-branch-page-private-team into lp://staging/launchpad

Proposed by Tim Penhey
Status: Merged
Merge reported by: Tim Penhey
Merged at revision: not available
Proposed branch: lp://staging/~thumper/launchpad/person-branch-page-private-team
Merge into: lp://staging/launchpad
Diff against target: 11341 lines (+3913/-1611)
161 files modified
cronscripts/update-database-stats.py (+43/-0)
database/replication/helpers.py (+3/-0)
database/sampledata/current-dev.sql (+191/-109)
database/sampledata/current.sql (+188/-106)
database/schema/comments.sql (+40/-19)
database/schema/patch-2207-51-0.sql (+69/-0)
database/schema/patch-2207-55-0.sql (+16/-0)
database/schema/patch-2207-57-0.sql (+210/-0)
database/schema/patch-2207-58-0.sql (+12/-0)
database/schema/patch-2207-59-0.sql (+10/-0)
database/schema/security.cfg (+40/-8)
database/schema/trusted.sql (+83/-1)
lib/canonical/config/schema-lazr.conf (+1/-1)
lib/canonical/launchpad/doc/tales.txt (+3/-2)
lib/canonical/launchpad/interfaces/_schema_circular_imports.py (+7/-0)
lib/canonical/launchpad/mailnotification.py (+4/-1)
lib/canonical/launchpad/offline-staging-code-update.html (+28/-0)
lib/canonical/launchpad/offline-staging-db-update.html (+28/-0)
lib/canonical/launchpad/security.py (+36/-20)
lib/canonical/launchpad/webapp/configure.zcml (+1/-1)
lib/canonical/launchpad/webapp/tales.py (+4/-4)
lib/lp/archivepublisher/domination.py (+6/-5)
lib/lp/archiveuploader/nascentupload.py (+2/-2)
lib/lp/archiveuploader/nascentuploadfile.py (+4/-4)
lib/lp/archiveuploader/tests/test_buildduploads.py (+2/-2)
lib/lp/archiveuploader/tests/test_ppauploadprocessor.py (+4/-4)
lib/lp/archiveuploader/tests/test_recipeuploads.py (+3/-3)
lib/lp/archiveuploader/tests/test_securityuploads.py (+5/-5)
lib/lp/archiveuploader/tests/test_uploadprocessor.py (+1/-1)
lib/lp/bugs/doc/security-teams.txt (+28/-4)
lib/lp/buildmaster/browser/configure.zcml (+15/-0)
lib/lp/buildmaster/configure.zcml (+38/-2)
lib/lp/buildmaster/doc/buildfarmjob.txt (+8/-16)
lib/lp/buildmaster/doc/buildqueue.txt (+4/-4)
lib/lp/buildmaster/interfaces/buildbase.py (+12/-3)
lib/lp/buildmaster/interfaces/buildfarmjob.py (+146/-35)
lib/lp/buildmaster/interfaces/packagebuild.py (+171/-0)
lib/lp/buildmaster/model/buildbase.py (+130/-110)
lib/lp/buildmaster/model/builder.py (+9/-3)
lib/lp/buildmaster/model/buildfarmjob.py (+220/-47)
lib/lp/buildmaster/model/buildfarmjobbehavior.py (+2/-2)
lib/lp/buildmaster/model/packagebuild.py (+203/-45)
lib/lp/buildmaster/tests/test_buildbase.py (+38/-23)
lib/lp/buildmaster/tests/test_builder.py (+6/-6)
lib/lp/buildmaster/tests/test_buildfarmjob.py (+173/-0)
lib/lp/buildmaster/tests/test_buildqueue.py (+50/-40)
lib/lp/buildmaster/tests/test_manager.py (+4/-4)
lib/lp/buildmaster/tests/test_packagebuild.py (+180/-0)
lib/lp/code/browser/branchlisting.py (+2/-1)
lib/lp/code/browser/sourcepackagerecipe.py (+8/-4)
lib/lp/code/browser/tests/test_branchlisting.py (+47/-2)
lib/lp/code/browser/tests/test_sourcepackagerecipe.py (+34/-16)
lib/lp/code/configure.zcml (+0/-1)
lib/lp/code/interfaces/sourcepackagerecipe.py (+4/-9)
lib/lp/code/interfaces/sourcepackagerecipebuild.py (+6/-8)
lib/lp/code/model/recipebuilder.py (+9/-10)
lib/lp/code/model/sourcepackagerecipe.py (+18/-13)
lib/lp/code/model/sourcepackagerecipebuild.py (+14/-13)
lib/lp/code/model/tests/test_recipebuilder.py (+9/-9)
lib/lp/code/model/tests/test_sourcepackagerecipe.py (+19/-15)
lib/lp/code/model/tests/test_sourcepackagerecipebuild.py (+2/-3)
lib/lp/code/templates/branch-index.pt (+3/-1)
lib/lp/registry/browser/person.py (+4/-4)
lib/lp/registry/browser/sourcepackage.py (+1/-1)
lib/lp/registry/doc/distroseries.txt (+1/-1)
lib/lp/registry/interfaces/person.py (+1/-4)
lib/lp/registry/model/distribution.py (+5/-5)
lib/lp/registry/model/distroseries.py (+5/-4)
lib/lp/registry/model/person.py (+2/-4)
lib/lp/registry/model/sourcepackage.py (+10/-7)
lib/lp/registry/model/sourcepackagename.py (+5/-4)
lib/lp/registry/templates/person-macros.pt (+1/-1)
lib/lp/services/scripts/base.py (+6/-1)
lib/lp/soyuz/adapters/archivedependencies.py (+2/-2)
lib/lp/soyuz/browser/binarypackagerelease.py (+1/-1)
lib/lp/soyuz/browser/build.py (+3/-3)
lib/lp/soyuz/browser/configure.zcml (+1/-1)
lib/lp/soyuz/browser/distributionsourcepackagerelease.py (+2/-2)
lib/lp/soyuz/browser/publishing.py (+1/-1)
lib/lp/soyuz/browser/tests/archive-views.txt (+6/-6)
lib/lp/soyuz/browser/tests/build-views.txt (+5/-5)
lib/lp/soyuz/configure.zcml (+2/-4)
lib/lp/soyuz/doc/archive-dependencies.txt (+9/-8)
lib/lp/soyuz/doc/archive-files.txt (+1/-1)
lib/lp/soyuz/doc/archive.txt (+2/-2)
lib/lp/soyuz/doc/binarypackagebuild.txt (+56/-109)
lib/lp/soyuz/doc/build-estimated-dispatch-time.txt (+4/-4)
lib/lp/soyuz/doc/build-failedtoupload-workflow.txt (+4/-4)
lib/lp/soyuz/doc/build-notification.txt (+17/-17)
lib/lp/soyuz/doc/buildd-dispatching.txt (+15/-11)
lib/lp/soyuz/doc/buildd-mass-retry.txt (+1/-1)
lib/lp/soyuz/doc/buildd-scoring.txt (+4/-2)
lib/lp/soyuz/doc/buildd-slavescanner.txt (+63/-62)
lib/lp/soyuz/doc/distroarchseries.txt (+1/-1)
lib/lp/soyuz/doc/distroseriesqueue-translations.txt (+2/-2)
lib/lp/soyuz/doc/distroseriesqueue.txt (+1/-1)
lib/lp/soyuz/doc/gina-multiple-arch.txt (+3/-3)
lib/lp/soyuz/doc/gina.txt (+8/-8)
lib/lp/soyuz/doc/initialise-from-parent.txt (+2/-2)
lib/lp/soyuz/doc/nascentupload.txt (+4/-4)
lib/lp/soyuz/doc/package-meta-classes.txt (+1/-1)
lib/lp/soyuz/doc/publishing.txt (+10/-9)
lib/lp/soyuz/doc/queuebuilder.txt (+2/-2)
lib/lp/soyuz/doc/sourcepackagerelease-build-lookup.txt (+5/-5)
lib/lp/soyuz/doc/sourcepackagerelease.txt (+7/-2)
lib/lp/soyuz/doc/soyuz-set-of-uploads.txt (+4/-4)
lib/lp/soyuz/interfaces/binarypackagebuild.py (+29/-11)
lib/lp/soyuz/interfaces/buildfarmbuildjob.py (+2/-2)
lib/lp/soyuz/model/archive.py (+39/-21)
lib/lp/soyuz/model/binarypackagebuild.py (+200/-148)
lib/lp/soyuz/model/binarypackagebuildbehavior.py (+19/-18)
lib/lp/soyuz/model/binarypackagerelease.py (+3/-3)
lib/lp/soyuz/model/buildfarmbuildjob.py (+51/-0)
lib/lp/soyuz/model/buildpackagejob.py (+42/-26)
lib/lp/soyuz/model/distributionsourcepackagerelease.py (+16/-13)
lib/lp/soyuz/model/distroarchseriesbinarypackagerelease.py (+1/-1)
lib/lp/soyuz/model/distroseriesbinarypackage.py (+1/-1)
lib/lp/soyuz/model/distroseriessourcepackagerelease.py (+8/-7)
lib/lp/soyuz/model/files.py (+4/-4)
lib/lp/soyuz/model/publishing.py (+25/-17)
lib/lp/soyuz/model/queue.py (+6/-6)
lib/lp/soyuz/model/sourcepackagerelease.py (+34/-23)
lib/lp/soyuz/pas.py (+1/-1)
lib/lp/soyuz/scripts/buildd.py (+4/-4)
lib/lp/soyuz/scripts/gina/handlers.py (+16/-17)
lib/lp/soyuz/scripts/packagecopier.py (+4/-4)
lib/lp/soyuz/scripts/queue.py (+2/-2)
lib/lp/soyuz/scripts/tests/test_buildd_cronscripts.py (+13/-3)
lib/lp/soyuz/scripts/tests/test_copypackage.py (+10/-10)
lib/lp/soyuz/scripts/tests/test_populatearchive.py (+1/-1)
lib/lp/soyuz/stories/ppa/xx-copy-packages.txt (+1/-1)
lib/lp/soyuz/stories/ppa/xx-ppa-files.txt (+4/-4)
lib/lp/soyuz/stories/ppa/xx-ubuntu-ppas.txt (+1/-1)
lib/lp/soyuz/stories/soyuz/xx-binarypackagerelease-index.txt (+1/-1)
lib/lp/soyuz/stories/soyuz/xx-build-record.txt (+17/-9)
lib/lp/soyuz/stories/soyuz/xx-private-builds.txt (+7/-6)
lib/lp/soyuz/stories/soyuz/xx-queue-pages-delayed-copies.txt (+1/-1)
lib/lp/soyuz/stories/webservice/xx-builds.txt (+28/-4)
lib/lp/soyuz/stories/webservice/xx-hasbuildrecords.txt (+6/-5)
lib/lp/soyuz/templates/build-index.pt (+19/-19)
lib/lp/soyuz/templates/build-retry.pt (+1/-1)
lib/lp/soyuz/templates/builds-list.pt (+10/-10)
lib/lp/soyuz/templates/distributionsourcepackagerelease-index.pt (+1/-1)
lib/lp/soyuz/templates/packagepublishing-details.pt (+1/-1)
lib/lp/soyuz/templates/sourcepackagepublishinghistory-listing-archive-detailed.pt (+1/-1)
lib/lp/soyuz/templates/sourcepackagepublishinghistory-listing-archive-extra.pt (+1/-1)
lib/lp/soyuz/templates/sourcepackagerelease-portlet-builds.pt (+3/-3)
lib/lp/soyuz/tests/test_archive.py (+12/-8)
lib/lp/soyuz/tests/test_binarypackagebuild.py (+86/-35)
lib/lp/soyuz/tests/test_buildpackagejob.py (+14/-8)
lib/lp/soyuz/tests/test_hasbuildrecords.py (+12/-6)
lib/lp/soyuz/tests/test_packageupload.py (+2/-2)
lib/lp/soyuz/tests/test_publishing.py (+27/-24)
lib/lp/soyuz/tests/test_publishing_models.py (+5/-4)
lib/lp/testing/__init__.py (+1/-0)
lib/lp/testing/factory.py (+16/-27)
lib/lp/translations/configure.zcml (+1/-3)
lib/lp/translations/model/translationtemplatesbuildjob.py (+11/-3)
lib/lp/translations/tests/test_translationtemplatesbuildjob.py (+4/-5)
scripts/copy-translations-from-parent.py (+1/-1)
utilities/report-database-stats.py (+141/-0)
To merge this branch: bzr merge lp://staging/~thumper/launchpad/person-branch-page-private-team
Reviewer Review Type Date Requested Status
Curtis Hovey (community) code release-critical Approve
Canonical Launchpad Engineering Pending
Review via email: mp+26262@code.staging.launchpad.net

Commit message

Don't try to show private teams on the person branches page if the user can't see the team.

Description of the change

Check for private teams in the view class before attempting to render them for unauthorized users.

tests:
  TestPersonBranchesPage

pre-impl: sinzui

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

Thanks for teaching me the art of setup with a logged in user. YOu have my RC to land this after you fix some trivial issues.

> === modified file 'lib/lp/code/browser/tests/test_branchlisting.py'
> --- lib/lp/code/browser/tests/test_branchlisting.py 2010-04-08 02:09:16 +0000
> +++ lib/lp/code/browser/tests/test_branchlisting.py 2010-05-28 01:50:44 +0000
...
> @@ -355,6 +359,47 @@
> self.assertEqual('launchpad.dev', URI(link.url).host)
>
>
> +class TestPersonBranchesPage(BrowserTestCase):
> + """Tests for the person branches page.
> +
> + This is the default page shown for a person on the code subdomain.
> + """
> +
> + layer = DatabaseFunctionalLayer # may need to change this

You do not need to change this, you can drop the comment.

> + def _make_branch_for_private_team(self):
> + private_team = self.factory.makeTeam(
> + name='shh', displayname='Shh',
> + visibility=PersonVisibility.PRIVATE)
> + member = self.factory.makePerson(
> + <email address hidden>', password='test')
> + with person_logged_in(private_team.teamowner):
> + private_team.addMember(member, private_team.teamowner)

That is beautiful.

> + branch = self.factory.makeProductBranch(owner=private_team)
> + return private_team, member, branch
> +
> + def test_private_team_membership_for_team_member(self):
> + # If the logged in user can see the private teams, they are shown in
> + # the releated 'Branches owned by' section at the bottom of the page.

grammar: s/releated/related/

review: Approve (code release-critical)
Revision history for this message
Tim Penhey (thumper) wrote :

On Fri, 28 May 2010 15:00:47 you wrote:
> Review: Approve code release-critical
> Thanks for teaching me the art of setup with a logged in user. YOu have my
> RC to land this after you fix some trivial issues.

Thanks.

> > === modified file 'lib/lp/code/browser/tests/test_branchlisting.py'
> > --- lib/lp/code/browser/tests/test_branchlisting.py 2010-04-08 02:09:16
> > +0000 +++ lib/lp/code/browser/tests/test_branchlisting.py 2010-05-28
> > 01:50:44 +0000
>
> ...
>
> > @@ -355,6 +359,47 @@
> >
> > self.assertEqual('launchpad.dev', URI(link.url).host)
> >
> > +class TestPersonBranchesPage(BrowserTestCase):
> > + """Tests for the person branches page.
> > +
> > + This is the default page shown for a person on the code subdomain.
> > + """
> > +
> > + layer = DatabaseFunctionalLayer # may need to change this
>
> You do not need to change this, you can drop the comment.

Done.

> > + def _make_branch_for_private_team(self):
> > + private_team = self.factory.makeTeam(
> > + name='shh', displayname='Shh',
> > + visibility=PersonVisibility.PRIVATE)
> > + member = self.factory.makePerson(
> > + <email address hidden>', password='test')
> > + with person_logged_in(private_team.teamowner):
> > + private_team.addMember(member, private_team.teamowner)
>
> That is beautiful.

Yes it is. You can thank abentley for writing these context managers. There
is also a function decorator to run an entire test as a specific user.

> > + branch = self.factory.makeProductBranch(owner=private_team)
> > + return private_team, member, branch
> > +
> > + def test_private_team_membership_for_team_member(self):
> > + # If the logged in user can see the private teams, they are
> > shown in + # the releated 'Branches owned by' section at the
> > bottom of the page.
>
> grammar: s/releated/related/

Fixed.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.