← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~stevenk/launchpad/xmlexport-all-specs into lp:launchpad

 

Steve Kowalik has proposed merging lp:~stevenk/launchpad/xmlexport-all-specs into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~stevenk/launchpad/xmlexport-all-specs/+merge/159061

This MP builds on work started by Steve Langasek in https://code.launchpad.net/~vorlon/launchpad/lp.994110/+merge/105078. I disagree with Curtis, in that sometimes you do want to discuss a spec at a sprint, no matter the definition status because you're not sure if it is going to worked on that series at all -- you have no idea at that point, so the filtering is actively harmful. I have also fixed tests.

I have also done a drive-by cleaning up the render() method to look cleaner, and have cleaned up the comments I saw to fit our guidelines.
-- 
https://code.launchpad.net/~stevenk/launchpad/xmlexport-all-specs/+merge/159061
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~stevenk/launchpad/xmlexport-all-specs into lp:launchpad.
=== modified file 'lib/lp/blueprints/browser/sprint.py'
--- lib/lp/blueprints/browser/sprint.py	2013-04-10 08:09:05 +0000
+++ lib/lp/blueprints/browser/sprint.py	2013-04-16 01:35:32 +0000
@@ -1,4 +1,4 @@
-# Copyright 2009-2011 Canonical Ltd.  This software is licensed under the
+# Copyright 2009-2013 Canonical Ltd.  This software is licensed under the
 # GNU Affero General Public License version 3 (see the file LICENSE).
 
 """Sprint views."""
@@ -47,7 +47,6 @@
     HasSpecificationsView,
     )
 from lp.blueprints.enums import (
-    SpecificationDefinitionStatus,
     SpecificationFilter,
     SpecificationPriority,
     SpecificationSort,
@@ -466,19 +465,13 @@
         for spec in self.context.specifications(
             self.user, filter=[SpecificationFilter.ACCEPTED]):
 
-            # skip sprints with no priority or less than low:
+            # Skip sprints with no priority or less than LOW.
             if spec.priority < SpecificationPriority.UNDEFINED:
                 continue
-
-            if (spec.definition_status not in
-                [SpecificationDefinitionStatus.NEW,
-                 SpecificationDefinitionStatus.DISCUSSION,
-                 SpecificationDefinitionStatus.DRAFT]):
-                continue
             model_specs.append(spec)
 
         people = defaultdict(dict)
-        # Attendees per specification
+        # Attendees per specification.
         for subscription in load_referencing(SpecificationSubscription,
                 model_specs, ['specificationID']):
             if subscription.personID not in attendee_set:
@@ -507,9 +500,9 @@
                 ) for spec in model_specs]
 
     def render(self):
-        self.request.response.setHeader('content-type',
-                                        'application/xml;charset=utf-8')
-        body = LaunchpadView.render(self)
+        self.request.response.setHeader(
+            'content-type', 'application/xml;charset=utf-8')
+        body = super(SprintMeetingExportView, self).render()
         return body.encode('utf-8')
 
 

=== modified file 'lib/lp/blueprints/doc/sprint-meeting-export.txt'
--- lib/lp/blueprints/doc/sprint-meeting-export.txt	2011-12-24 17:49:30 +0000
+++ lib/lp/blueprints/doc/sprint-meeting-export.txt	2013-04-16 01:35:32 +0000
@@ -45,16 +45,18 @@
     >>> view.attendees
     []
 
-While there are three sprints registered for the ubz sprint, only one
-has been accepted.  So that is the only one that is exposed by the view:
+While there are three sprints registered for the ubz sprint, only two
+have a priority above LOW, so they are the only ones exposed by the view:
 
     >>> ubz.specificationLinks().count()
     3
 
     >>> len(view.specifications)
-    1
+    2
 
-    >>> print view.specifications[0]['spec'].name
+    >>> for spec in view.specifications:
+    ...     print spec['spec'].name
+    svg-support
     extension-manager-upgrades
 
 We now subscribe Sample Person to the Extension Manager Upgrades spec
@@ -72,7 +74,7 @@
 assigned).
 
     >>> sorted(person['name']
-    ...     for person in view.specifications[0]['interested'])
+    ...     for person in view.specifications[1]['interested'])
     [u'carlos']
 
 This is because sample person has not registered as an attendee of the
@@ -86,7 +88,7 @@
     >>> view = getMultiAdapter((ubz, request), name='+temp-meeting-export')
     >>> view.initialize()
     >>> sorted(person['name']
-    ...     for person in view.specifications[0]['interested'])
+    ...     for person in view.specifications[1]['interested'])
     [u'carlos', u'name12']
 
 The person is also included in the list of attendees:
@@ -141,7 +143,5 @@
 
     >>> view = getMultiAdapter((ubz, request), name='+temp-meeting-export')
     >>> view.initialize()
-    >>> view.specifications
-    []
-
-
+    >>> len(view.specifications)
+    1

=== modified file 'lib/lp/blueprints/stories/sprints/xx-sprint-meeting-export.txt'
--- lib/lp/blueprints/stories/sprints/xx-sprint-meeting-export.txt	2012-05-16 08:59:53 +0000
+++ lib/lp/blueprints/stories/sprints/xx-sprint-meeting-export.txt	2013-04-16 01:35:32 +0000
@@ -46,4 +46,5 @@
     >>> meetings = soup.find('unscheduled').findAll('meeting')
     >>> for meeting in meetings:
     ...     print "%(id)s: %(name)s, %(lpurl)s" % meeting
+    3: svg-support, .../+spec/svg-support
     1: extension-manager-upgrades, .../+spec/extension-manager-upgrades


Follow ups