← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~deryck/launchpad/bug-activity-do-not-snapshot-680131 into lp:launchpad

 

Deryck Hodge has proposed merging lp:~deryck/launchpad/bug-activity-do-not-snapshot-680131 into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #680131 in Launchpad itself: "Bug:EntryResource:markUserAffected OOPSing during snapshot due to shortlist error."
  https://bugs.launchpad.net/launchpad/+bug/680131

For more details, see:
https://code.launchpad.net/~deryck/launchpad/bug-activity-do-not-snapshot-680131/+merge/62035

This makes sure bug activity is not snapshotted to keep from OOPSing when a bug is marked as affecting a user.  This happens on bug 1 as noted in bug 680131.  I chatted with Curtis about how to fix this long term, so we don't have to continually doNotSnapshot CollectionFields. But I spotted the offending attribute on IBug while working today and thought it an easy enough fix to land right away.
-- 
https://code.launchpad.net/~deryck/launchpad/bug-activity-do-not-snapshot-680131/+merge/62035
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~deryck/launchpad/bug-activity-do-not-snapshot-680131 into lp:launchpad.
=== modified file 'lib/lp/bugs/interfaces/bug.py'
--- lib/lp/bugs/interfaces/bug.py	2011-05-12 21:33:10 +0000
+++ lib/lp/bugs/interfaces/bug.py	2011-05-23 20:57:30 +0000
@@ -248,10 +248,10 @@
     displayname = TextLine(title=_("Text of the form 'Bug #X"),
         readonly=True)
     activity = exported(
-        CollectionField(
+        doNotSnapshot(CollectionField(
             title=_('Log of activity that has occurred on this bug.'),
             value_type=Reference(schema=IBugActivity),
-            readonly=True))
+            readonly=True)))
     initial_message = Attribute(
         "The message that was specified when creating the bug")
     bugtasks = exported(

=== modified file 'lib/lp/bugs/tests/test_bug.py'
--- lib/lp/bugs/tests/test_bug.py	2011-05-10 14:19:24 +0000
+++ lib/lp/bugs/tests/test_bug.py	2011-05-23 20:57:30 +0000
@@ -151,6 +151,10 @@
                 [token for token in sql_tokens
                  if token.startswith('message')],
                 [])
+            self.assertEqual(
+                [token for token in sql_tokens
+                 if token.startswith('bugactivity')],
+                [])
 
 
 class TestBugCreation(TestCaseWithFactory):

=== modified file 'lib/lp/bugs/tests/test_bugs_webservice.py'
--- lib/lp/bugs/tests/test_bugs_webservice.py	2011-05-17 20:16:47 +0000
+++ lib/lp/bugs/tests/test_bugs_webservice.py	2011-05-23 20:57:30 +0000
@@ -305,7 +305,8 @@
         # bug subscriptions and (un)affected users.
         for field_name in (
             'subscriptions', 'users_affected', 'users_unaffected',
-            'users_affected_with_dupes', 'messages'):
+            'users_affected_with_dupes', 'messages', 'attachments',
+            'activity'):
             self.failUnless(
                 IDoNotSnapshot.providedBy(IBug[field_name]),
                 'IBug.%s should not be included in snapshots, see bug 507642.'


Follow ups