← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~cjwatson/launchpad/git-update-related-bugs-more-permissions into lp:launchpad

 

Colin Watson has proposed merging lp:~cjwatson/launchpad/git-update-related-bugs-more-permissions into lp:launchpad.

Commit message:
Grant merge-proposal-jobs access to a few more tables it may need to handle structural subscriptions to bugs.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/git-update-related-bugs-more-permissions/+merge/307381

Grant merge-proposal-jobs access to a few more tables it may need to handle structural subscriptions to bugs.

Bugs with tasks on projects that are part of project groups definitely go wrong, but from code inspection I think we might need DistributionSourcePackage and Milestone too, and it won't hurt anything so I threw them in as well.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/git-update-related-bugs-more-permissions into lp:launchpad.
=== modified file 'database/schema/security.cfg'
--- database/schema/security.cfg	2016-09-08 01:46:03 +0000
+++ database/schema/security.cfg	2016-10-02 00:32:26 +0000
@@ -2001,6 +2001,7 @@
 public.codereviewvote                   = SELECT, INSERT
 public.diff                             = SELECT, INSERT
 public.distribution                     = SELECT
+public.distributionsourcepackage        = SELECT
 public.distroseries                     = SELECT
 public.emailaddress                     = SELECT
 public.gitref                           = SELECT
@@ -2014,11 +2015,13 @@
 public.libraryfilecontent               = SELECT, INSERT
 public.message                          = SELECT, INSERT
 public.messagechunk                     = SELECT, INSERT
+public.milestone                        = SELECT
 public.person                           = SELECT
 public.personsettings                   = SELECT
 public.previewdiff                      = SELECT, INSERT
 public.product                          = SELECT
 public.productseries                    = SELECT
+public.project                          = SELECT
 public.revision                         = SELECT
 public.revisionauthor                   = SELECT, INSERT
 public.seriessourcepackagebranch        = SELECT

=== modified file 'lib/lp/code/model/tests/test_branchmergeproposaljobs.py'
--- lib/lp/code/model/tests/test_branchmergeproposaljobs.py	2016-09-08 02:17:30 +0000
+++ lib/lp/code/model/tests/test_branchmergeproposaljobs.py	2016-10-02 00:32:26 +0000
@@ -264,7 +264,9 @@
 
     def test_run_git_updates_related_bugs(self):
         # The merge proposal has its related bugs updated.
-        bug = self.factory.makeBug()
+        projectgroup = self.factory.makeProject()
+        project = self.factory.makeProduct(projectgroup=projectgroup)
+        bug = self.factory.makeBug(target=project)
         # Create a structural subscription to ensure we don't short-circuit
         # in _get_structural_subscription_filter_id_query.
         subscriber = self.factory.makePerson()


Follow ups