← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~stevenk/launchpad/queued-dsp into lp:launchpad

 

Steve Kowalik has proposed merging lp:~stevenk/launchpad/queued-dsp into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~stevenk/launchpad/queued-dsp/+merge/64113

The 'queued' DB user is unable to query the distroseriesparent table to see if the distroseries is a derived series so that it can create a DSDJ to update the relevant DSDs.

The existing test was insufficient, since it only checks that the DB user can *create* the job, but not if the DB user can query what the derived series are.
-- 
https://code.launchpad.net/~stevenk/launchpad/queued-dsp/+merge/64113
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~stevenk/launchpad/queued-dsp into lp:launchpad.
=== modified file 'database/schema/security.cfg'
--- database/schema/security.cfg	2011-06-06 15:19:37 +0000
+++ database/schema/security.cfg	2011-06-10 03:52:30 +0000
@@ -1393,6 +1393,7 @@
 public.distrocomponentuploader          = SELECT
 public.distroseries                     = SELECT
 public.distroseriesdifference           = SELECT
+public.distroseriesparent               = SELECT
 public.emailaddress                     = SELECT, INSERT, UPDATE
 public.flatpackagesetinclusion          = SELECT
 public.gpgkey                           = SELECT

=== modified file 'lib/lp/soyuz/tests/test_distroseriesdifferencejob.py'
--- lib/lp/soyuz/tests/test_distroseriesdifferencejob.py	2011-05-30 04:06:52 +0000
+++ lib/lp/soyuz/tests/test_distroseriesdifferencejob.py	2011-06-10 03:52:30 +0000
@@ -704,3 +704,17 @@
 
         # The test is that we get here without exceptions.
         pass
+
+    def test_getDerivedSeries(self):
+        script_users = ['queued']
+        dsp = self.factory.makeDistroSeriesParent()
+        transaction.commit()
+        for user in script_users:
+            self.layer.switchDbUser(user)
+            try:
+                children = list(dsp.parent_series.getDerivedSeries())
+            except ProgrammingError, e:
+                self.assertTrue(
+                    False, "Database role %s is unable to query DSP. "
+                    "Erorr was: %s." % (user, e))
+