Merge lp:~michael.nelson/launchpad/distro-series-difference-browser2 into lp:launchpad/db-devel

Proposed by Michael Nelson
Status: Merged
Approved by: Michael Nelson
Approved revision: no longer in the source branch.
Merged at revision: 9766
Proposed branch: lp:~michael.nelson/launchpad/distro-series-difference-browser2
Merge into: lp:launchpad/db-devel
Diff against target: 463 lines (+327/-5)
8 files modified
lib/lp/registry/browser/configure.zcml (+6/-0)
lib/lp/registry/browser/distroseries.py (+37/-0)
lib/lp/registry/browser/tests/test_series_views.py (+143/-0)
lib/lp/registry/model/distroseriesdifference.py (+2/-1)
lib/lp/registry/templates/distroseries-localdifferences.pt (+86/-0)
lib/lp/registry/tests/test_distroseriesdifference.py (+3/-2)
lib/lp/soyuz/help/derived-series-syncing.html (+46/-0)
lib/lp/testing/factory.py (+4/-2)
To merge this branch: bzr merge lp:~michael.nelson/launchpad/distro-series-difference-browser2
Reviewer Review Type Date Requested Status
Leonard Richardson (community) Approve
Curtis Hovey (community) ui Approve
Henning Eggers (community) ui* Approve
Review via email: mp+34739@code.launchpad.net

Commit message

Add basic UI for distroseries differences.

Description of the change

Overview
========

This branch adds the initial UI for displaying differences between a derived series and its parent.

The page:
https://bugs.edge.launchpad.net/soyuz/+bug/627295/+attachment/1553364/+files/distro-series-differences.png

The UI mockup:
https://dev.launchpad.net/LEP/DerivativeDistributions?action=AttachFile&do=get&target=derived-series-diffs_uiround2.png

Details
=======
The view is behind a feature flag, so the url will redirect back to the distro series when the soyuz.derived-series-ui.enabled feature flag is not set.

This branch just does the initial non-js functionality. A following branch will add the remaining non-js functionality (the search bar). I'll also create a bug for the text of the popup help.

To test:
========
bin/test -vv -m test_series_views -m test_distroseriesdifference

To demo locally
===============
Run the following in bin/iharness:
http://pastebin.ubuntu.com/489730/

To post a comment you must log in.
Revision history for this message
Michael Nelson (michael.nelson) wrote :

I requested a UI review for this, but realised afterwards, given that this is behind a feature flag, and there will be further UI work being added, perhaps UI reviews aren't needed until the feature flag is going to be set on edge?

Anyway, if you're already looking Henning, any feedback will be welcome :)

Revision history for this message
Henning Eggers (henninge) wrote :

Hello Michael!
Thank you for pointing me to that ML discussion which I had missed. I see that there is a lot of thought in this page already. That's why I cannot find any big faults with it, I guess ... ;-)

We discussed the following on IRC:
- The comment should be truncated to make sure it does not exceed two lines. Looks like you already did that. ;-)
- "no signer" should be changed to "unknown" which is clearer.
- I am not sure an extra column for the package name would really look bad but I also like the current solution ("Warty package/Hoary version"). If users get it as quickly as I did, you can leave it like that. ;)

Not discussed:
- The "-" sign in "foo - 1.17.1" should go away, I think. Look at a page like this https://edge.launchpad.net/ubuntu/maverick/+package/bash to see that name and version are simply separated by a space. Or provide an extra column ... ;-)

About the mockup (for further consideration):
- It would be really cool if the "Add to blacklist" button was some new control that is a combination of a button and a drop down menu. Opening an extra dialog here seems too distracting to me.

But with the points mentioned above included the screen shot of this stage of the page looks good to me. Thank you for doing such nice work! ;-)

Henning

review: Approve (ui*)
Revision history for this message
Henning Eggers (henninge) wrote :

IRC discussion about the screenshot:
<rockstar> henninge, instead of "no signer" or "unknown" perhaps we shouldn't show it at all.
<henninge> rockstar: I thought the "when" information was still of interest?
<henninge> rockstar: maybe the column should be called "Last uploaded" and the content "18 minutes ago by Foo Bar"
<rockstar> henninge, I was just about to suggest that exact thing.
<henninge> or just "18 minutes ago"
<henninge> do we have similar columns elsewhere on LP?
<rockstar> henninge, basically, if the user can't do anything about it, we shouldn't show "unknown" because the user may think they're doing something wrong.
* rockstar JUST learned that in his UX class.
<henninge> good point
<henninge> ;)
<rockstar> henninge, we have similar date columns, and I think we could/should adopt a similar pattern to what we're proposing here.
<henninge> sounds good
<rockstar> henninge, great.
<henninge> rockstar: Also, I begin to wonder if the Name of the commenter should not be linkified, too, like the uploader.
<henninge> but that would put more stuff in the comment colmun.
<rockstar> henninge, yeah, and we should use a full display name.
<rockstar> henninge, if we still limit it to two lines, that would still be okay.
<henninge> rockstar: for the comment column: I actually think it should be like the upload column:
<henninge> "18 minutes ago by Mark Shuttleworth: I am working on this"
<rockstar> henninge, yup. I think that's a good idea.

Revision history for this message
Curtis Hovey (sinzui) wrote :

This looks really nice. I love this page because it can answer questions I have about the how any distroseries diverges from its parent. I think Henning's review is excellent and I really applaud the work everyone has done on this. I have a few questions about what I cannot see from data and mockups, that may be of concern in the near future.

How will this handle non-intersections, or packages marked as deleted? eg.
    https://edge.launchpad.net/ubuntu/maverick/+source/beagle
Will I see "Deleted" or "Not present"?

Where is that package description coming from? These look like source packages, not binaries. I recently added a summary field to DSPs and SPs that is built from binary summaries--it does not look like the descriptions in the mockup.

review: Approve (ui)
Revision history for this message
Leonard Richardson (leonardr) wrote :

It's been a while since I did anything with TALES, but I think I was able to follow this. I approve with only minor comments:

line 48 "betteen"
Can 58 and 59 fit on one line?
Why are lines 134 and 135 commented out? It seems like an important part of the test.
Is it really OK to have the python: call on line 328? I remember that being discouraged.

review: Approve
Revision history for this message
Michael Nelson (michael.nelson) wrote :

On Tue, Sep 7, 2010 at 9:42 PM, Leonard Richardson
<email address hidden> wrote:
> Review: Approve
> It's been a while since I did anything with TALES, but I think I was able to follow this. I approve with only minor comments:

Thanks Leonard,

>
> line 48 "betteen"

Done

> Can 58 and 59 fit on one line?

Indeed.

> Why are lines 134 and 135 commented out? It seems like an important part of the test.

Indeed - it was a mistake. I've uncommented and reworked that line to
check that the flag is not set.

> Is it really OK to have the python: call on line 328? I remember that being discouraged.

It's OK if it's necessary - I couldn't find a way in TALES to index an
iterable (nor think of a better way to provide this via the view - ie.
construct a dict of first comments for all differences in the batch?
erg)... if you know one, please let me know.

Here's the incremental diff with the changes you recommended:

http://pastebin.ubuntu.com/490231/

Now onto the UI tweaks... thanks Leonard!

Revision history for this message
Michael Nelson (michael.nelson) wrote :

On Tue, Sep 7, 2010 at 6:52 PM, Henning Eggers
<email address hidden> wrote:
> Review: Approve ui*
> Hello Michael!
> Thank you for pointing me to that ML discussion which I had missed. I see that there is a lot of thought in this page already. That's why I cannot find any big faults with it, I guess ... ;-)
>
> We discussed the following on IRC:
> - The comment should be truncated to make sure it does not exceed two lines. Looks like you already did that. ;-)

Yep, done (50 chars).

> - "no signer" should be changed to "unknown" which is clearer.

Based on the discussion you had with Paul, I've removed it when
unknown, and updated the column header.

I also updated the display of the first comment as per your discussion
with Paul, with a minor difference. I moved the "17 hours ago by Joe
Smith" to the end of the comment rather than the start, put it on a
new line, and greyed it out, you can see the differences here:

http://launchpadlibrarian.net/55200786/627295-ui-tweaks.png

> - I am not sure an extra column for the package name would really look bad but I also like the current solution ("Warty package/Hoary version"). If users get it as quickly as I did, you can leave it like that. ;)

I've switched it back and added an extra Source column (we'd only done
the combined column in the first place to save space, but that was
before we later decided on moving info into a drop-down).

>
> Not discussed:
> - The "-" sign in "foo - 1.17.1" should go away, I think. Look at a page like this https://edge.launchpad.net/ubuntu/maverick/+package/bash to see that name and version are simply separated by a space. Or provide an extra column ... ;-)

FYI: I wasn't putting the hyphen in, it's part of
SourcePackageRelease.title - not sure why there is inconsistency. But
anyway, I've switched to an extra column.

>
> About the mockup (for further consideration):
> - It would be really cool if the "Add to blacklist" button was some new control that is a combination of a button and a drop down menu. Opening an extra dialog here seems too distracting to me.

Yes - to me also - it was my main concern with that reworking. I
chatted with Julian about this and we thought it makes sense to simply
provide two buttons "Blacklist Foo", or "Blacklist Foo 1.34-a"

What do you think?

>
> But with the points mentioned above included the screen shot of this stage of the page looks good to me. Thank you for doing such nice work! ;-)

Thanks for the thoughtful review!

Revision history for this message
Henning Eggers (henninge) wrote :

Am 08.09.2010 11:19, schrieb Michael Nelson:
> http://launchpadlibrarian.net/55200786/627295-ui-tweaks.png

That looks very nice, thank you! I like your solution for the comment column.

>
>> - I am not sure an extra column for the package name would really look bad
>
> I've switched it back and added an extra Source column

Yes, that is a bit clearer to read.

You have not yet explained why the version numbers in hoary are lower than in
the parent series warty. Is that just bad sample data or am I reading the
table wrong?

>> About the mockup (for further consideration):
>> - It would be really cool if the "Add to blacklist" button was some new control that is a combination of a button and a drop down menu. Opening an extra dialog here seems too distracting to me.
>
> Yes - to me also - it was my main concern with that reworking. I
> chatted with Julian about this and we thought it makes sense to simply
> provide two buttons "Blacklist Foo", or "Blacklist Foo 1.34-a"
>
> What do you think?

Two buttons would not be my favorite solution because a lot of text might end
up on them. "Blacklist this version" and "Blacklist all versions" makes two
huge buttons next to each other that eat a lot of horizontal space. Putting
them on top of each other would be the obvious answer but that might look odd,
too.
I wonder if a status picker could be used instead although that is closer to
the extra dialog we were trying to avoid in the first place.

> Thanks for the thoughtful review!

I enjoyed it! ;-)

Henning

Revision history for this message
Michael Nelson (michael.nelson) wrote :

On Tue, Sep 7, 2010 at 7:44 PM, Curtis Hovey <email address hidden> wrote:
> Review: Approve ui
> This looks really nice. I love this page because it can answer questions I have about the how any distroseries diverges from its parent. I think Henning's review is excellent and I really applaud the work everyone has done on this. I have a few questions about what I cannot see from data and mockups, that may be of concern in the near future.

Thanks for the feedback Curtis!

>
> How will this handle non-intersections, or packages marked as deleted? eg.
>    https://edge.launchpad.net/ubuntu/maverick/+source/beagle
> Will I see "Deleted" or "Not present"?

If a package is not published in the parent series (because it has
been deleted), but is present in the derived series, then it will be a
different type of difference (UNIQUE_TO_DERIVED) and displayed on a
separate page. This page only displays packages that are present in
both series. (Or did I misunderstand your question?)

>
> Where is that package description coming from? These look like source packages, not binaries. I recently added a summary field to DSPs and SPs that is built from binary summaries--it does not look like the descriptions in the mockup.

Indeed - I think it can only use the new summary attribute that you've
added. Thanks!

> --
> https://code.launchpad.net/~michael.nelson/launchpad/distro-series-difference-browser2/+merge/34739
> You are the owner of lp:~michael.nelson/launchpad/distro-series-difference-browser2.
>

Revision history for this message
Michael Nelson (michael.nelson) wrote :

On Wed, Sep 8, 2010 at 11:51 AM, Henning Eggers
<email address hidden> wrote:
> You have not yet explained why the version numbers in hoary are lower than in
> the parent series warty. Is that just bad sample data or am I reading the
> table wrong?

The sample data that I added was based on the mockup
(Lucid/Derilucid). So if a new version is uploaded to Lucid after
Derilucid was created, the Derilucid version will be lower (until this
difference is dealt with by either syncing the Lucid package or
manually merging and uploading to Derilucid).

Hope that makes sense.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/registry/browser/configure.zcml'
--- lib/lp/registry/browser/configure.zcml 2010-08-27 04:33:52 +0000
+++ lib/lp/registry/browser/configure.zcml 2010-09-08 09:21:00 +0000
@@ -143,6 +143,12 @@
143 for="lp.registry.interfaces.distroseries.IDistroSeries"143 for="lp.registry.interfaces.distroseries.IDistroSeries"
144 class="canonical.launchpad.browser.AskAQuestionButtonView"144 class="canonical.launchpad.browser.AskAQuestionButtonView"
145 permission="zope.Public"/>145 permission="zope.Public"/>
146 <browser:page
147 name="+localpackagediffs"
148 for="lp.registry.interfaces.distroseries.IDistroSeries"
149 class="lp.registry.browser.distroseries.DistroSeriesLocalDifferences"
150 template="../templates/distroseries-localdifferences.pt"
151 permission="zope.Public"/>
146 <browser:menus152 <browser:menus
147 classes="153 classes="
148 DistroSeriesFacets154 DistroSeriesFacets
149155
=== modified file 'lib/lp/registry/browser/distroseries.py'
--- lib/lp/registry/browser/distroseries.py 2010-09-03 15:02:39 +0000
+++ lib/lp/registry/browser/distroseries.py 2010-09-08 09:21:00 +0000
@@ -11,6 +11,7 @@
11 'DistroSeriesBreadcrumb',11 'DistroSeriesBreadcrumb',
12 'DistroSeriesEditView',12 'DistroSeriesEditView',
13 'DistroSeriesFacets',13 'DistroSeriesFacets',
14 'DistroSeriesLocalDifferences',
14 'DistroSeriesPackageSearchView',15 'DistroSeriesPackageSearchView',
15 'DistroSeriesPackagesView',16 'DistroSeriesPackagesView',
16 'DistroSeriesNavigation',17 'DistroSeriesNavigation',
@@ -70,7 +71,10 @@
70 StructuralSubscriptionTargetTraversalMixin,71 StructuralSubscriptionTargetTraversalMixin,
71 )72 )
72from lp.registry.interfaces.distroseries import IDistroSeries73from lp.registry.interfaces.distroseries import IDistroSeries
74from lp.registry.interfaces.distroseriesdifference import (
75 IDistroSeriesDifferenceSource)
73from lp.registry.interfaces.series import SeriesStatus76from lp.registry.interfaces.series import SeriesStatus
77from lp.services.features.flags import FeatureController
74from lp.services.propertycache import cachedproperty78from lp.services.propertycache import cachedproperty
75from lp.services.worlddata.interfaces.country import ICountry79from lp.services.worlddata.interfaces.country import ICountry
76from lp.services.worlddata.interfaces.language import ILanguageSet80from lp.services.worlddata.interfaces.language import ILanguageSet
@@ -525,3 +529,36 @@
525 navigator = BatchNavigator(packages, self.request, size=20)529 navigator = BatchNavigator(packages, self.request, size=20)
526 navigator.setHeadings('package', 'packages')530 navigator.setHeadings('package', 'packages')
527 return navigator531 return navigator
532
533
534class DistroSeriesLocalDifferences(LaunchpadView):
535 """Present differences between a derived series and its parent."""
536
537 page_title = 'Local package differences'
538
539 def initialize(self):
540 """Redirect to the derived series if the feature is not enabled."""
541 def in_scope(value):
542 return True
543
544 feature_controller = FeatureController(in_scope)
545 if feature_controller.getFlag('soyuz.derived-series-ui.enabled') != 'on':
546 self.request.response.redirect(canonical_url(self.context))
547 return
548 super(DistroSeriesLocalDifferences, self).initialize()
549
550 @property
551 def label(self):
552 return (
553 "Source package differences between '%s' and "
554 "parent series '%s'" % (
555 self.context.displayname,
556 self.context.parent_series.displayname,
557 ))
558
559 @cachedproperty
560 def cached_differences(self):
561 """Return a batch navigator of potentially filtered results."""
562 differences = getUtility(IDistroSeriesDifferenceSource).getForDistroSeries(
563 self.context)
564 return BatchNavigator(differences, self.request)
528565
=== modified file 'lib/lp/registry/browser/tests/test_series_views.py'
--- lib/lp/registry/browser/tests/test_series_views.py 2010-08-31 15:14:01 +0000
+++ lib/lp/registry/browser/tests/test_series_views.py 2010-09-08 09:21:00 +0000
@@ -3,14 +3,24 @@
33
4__metaclass__ = type4__metaclass__ = type
55
6from BeautifulSoup import BeautifulSoup
6from storm.zope.interfaces import IResultSet7from storm.zope.interfaces import IResultSet
7from zope.component import getUtility8from zope.component import getUtility
8from zope.security.proxy import removeSecurityProxy9from zope.security.proxy import removeSecurityProxy
910
11import unittest
12
10from canonical.config import config13from canonical.config import config
11from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities14from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities
12from canonical.launchpad.webapp.batching import BatchNavigator15from canonical.launchpad.webapp.batching import BatchNavigator
16from canonical.launchpad.webapp.publisher import canonical_url
13from canonical.testing import LaunchpadZopelessLayer17from canonical.testing import LaunchpadZopelessLayer
18from lp.registry.enum import (
19 DistroSeriesDifferenceStatus,
20 DistroSeriesDifferenceType,
21 )
22from lp.services.features.flags import FeatureController
23from lp.services.features.model import FeatureFlag, getFeatureStore
14from lp.testing import TestCaseWithFactory24from lp.testing import TestCaseWithFactory
15from lp.testing.views import create_initialized_view25from lp.testing.views import create_initialized_view
1626
@@ -44,6 +54,134 @@
44 self.assertEqual(view.needs_linking, None)54 self.assertEqual(view.needs_linking, None)
4555
4656
57class DistroSeriesLocalPackageDiffsTestCase(TestCaseWithFactory):
58 """Test the distroseries +localpackagediffs view."""
59
60 layer = LaunchpadZopelessLayer
61
62 def makeDerivedSeries(self, derived_name=None, parent_name=None):
63 # Helper that creates a derived distro series.
64 parent = self.factory.makeDistroSeries(name=parent_name)
65 derived_series = self.factory.makeDistroSeries(
66 name=derived_name, parent_series=parent)
67 return derived_series
68
69 def setDerivedSeriesUIFeatureFlag(self):
70 # Helper to set the feature flag enabling the derived series ui.
71 ignore = getFeatureStore().add(FeatureFlag(
72 scope=u'default', flag=u'soyuz.derived-series-ui.enabled',
73 value=u'on', priority=1))
74
75 def getDerivedSeriesUIFeatureFlag(self, flag):
76 """Helper to return the given flag leaving tests more readable."""
77 def in_scope(value):
78 return True
79
80 feature_controller = FeatureController(in_scope)
81 return feature_controller.getFlag(flag)
82
83 def test_view_redirects_without_feature_flag(self):
84 # If the feature flag soyuz.derived-series-ui.enabled is not set the
85 # view simply redirects to the derived series.
86 derived_series = self.makeDerivedSeries(
87 parent_name='lucid', derived_name='derilucid')
88
89 self.assertIs(
90 None, self.getDerivedSeriesUIFeatureFlag(
91 'soyuz.derived-series-ui.enabled'))
92 view = create_initialized_view(
93 derived_series, '+localpackagediffs')
94
95 response = view.request.response
96 self.assertEqual(302, response.getStatus())
97 self.assertEqual(
98 canonical_url(derived_series), response.getHeader('location'))
99
100 def test_label(self):
101 # The view label includes the names of both series.
102 derived_series = self.makeDerivedSeries(
103 parent_name='lucid', derived_name='derilucid')
104
105 view = create_initialized_view(
106 derived_series, '+localpackagediffs')
107
108 self.assertEqual(
109 "Source package differences between 'Derilucid' and "
110 "parent series 'Lucid'",
111 view.label)
112
113 def test_batch_includes_needing_attention_only(self):
114 # The differences attribute includes differences needing
115 # attention only.
116 derived_series = self.makeDerivedSeries(
117 parent_name='lucid', derived_name='derilucid')
118 current_difference = self.factory.makeDistroSeriesDifference(
119 derived_series=derived_series)
120 old_difference = self.factory.makeDistroSeriesDifference(
121 derived_series=derived_series,
122 status=DistroSeriesDifferenceStatus.RESOLVED)
123
124 view = create_initialized_view(
125 derived_series, '+localpackagediffs')
126
127 self.assertContentEqual(
128 [current_difference], view.cached_differences.batch)
129
130 def test_batch_includes_different_versions_only(self):
131 # The view contains differences of type DIFFERENT_VERSIONS only.
132 derived_series = self.makeDerivedSeries(
133 parent_name='lucid', derived_name='derilucid')
134 different_versions_diff = self.factory.makeDistroSeriesDifference(
135 derived_series=derived_series)
136 unique_diff = self.factory.makeDistroSeriesDifference(
137 derived_series=derived_series,
138 difference_type=(
139 DistroSeriesDifferenceType.UNIQUE_TO_DERIVED_SERIES))
140
141 view = create_initialized_view(
142 derived_series, '+localpackagediffs')
143
144 self.assertContentEqual(
145 [different_versions_diff], view.cached_differences.batch)
146
147 def test_template_includes_help_link(self):
148 # The help link for popup help is included.
149 derived_series = self.makeDerivedSeries(
150 parent_name='lucid', derived_name='derilucid')
151
152 self.setDerivedSeriesUIFeatureFlag()
153 view = create_initialized_view(
154 derived_series, '+localpackagediffs')
155
156 soup = BeautifulSoup(view())
157 help_links = soup.findAll(
158 'a', href='/+help/soyuz/derived-series-syncing.html')
159 self.assertEqual(1, len(help_links))
160
161 def test_diff_row_includes_last_comment_only(self):
162 # The most recent comment is rendered for each difference.
163 derived_series = self.makeDerivedSeries(
164 parent_name='lucid', derived_name='derilucid')
165 difference = self.factory.makeDistroSeriesDifference(
166 derived_series=derived_series)
167 difference.addComment(difference.owner, "Earlier comment")
168 difference.addComment(difference.owner, "Latest comment")
169
170 self.setDerivedSeriesUIFeatureFlag()
171 view = create_initialized_view(
172 derived_series, '+localpackagediffs')
173
174 # Find all the rows within the body of the table
175 # listing the differences.
176 soup = BeautifulSoup(view())
177 diff_table = soup.find('table', {'class': 'listing'})
178 rows = diff_table.tbody.findAll('tr')
179
180 self.assertEqual(1, len(rows))
181 self.assertIn("Latest comment", unicode(rows[0]))
182 self.assertNotIn("Earlier comment", unicode(rows[0]))
183
184
47class TestMilestoneBatchNavigatorAttribute(TestCaseWithFactory):185class TestMilestoneBatchNavigatorAttribute(TestCaseWithFactory):
48 """Test the series.milestone_batch_navigator attribute."""186 """Test the series.milestone_batch_navigator attribute."""
49187
@@ -61,6 +199,7 @@
61 product = self.factory.makeProduct()199 product = self.factory.makeProduct()
62 for name in ('a', 'b', 'c', 'd'):200 for name in ('a', 'b', 'c', 'd'):
63 product.development_focus.newMilestone(name)201 product.development_focus.newMilestone(name)
202
64 view = create_initialized_view(203 view = create_initialized_view(
65 product.development_focus, name='+index')204 product.development_focus, name='+index')
66 self._check_milestone_batch_navigator(view)205 self._check_milestone_batch_navigator(view)
@@ -84,3 +223,7 @@
84 for item in view.milestone_batch_navigator.currentBatch()]223 for item in view.milestone_batch_navigator.currentBatch()]
85 self.assertEqual(expected, milestone_names)224 self.assertEqual(expected, milestone_names)
86 config.pop('default-batch-size')225 config.pop('default-batch-size')
226
227
228def test_suite():
229 return unittest.TestLoader().loadTestsFromName(__name__)
87230
=== modified file 'lib/lp/registry/model/distroseriesdifference.py'
--- lib/lp/registry/model/distroseriesdifference.py 2010-09-01 12:23:01 +0000
+++ lib/lp/registry/model/distroseriesdifference.py 2010-09-08 09:21:00 +0000
@@ -10,6 +10,7 @@
10 ]10 ]
1111
12from lazr.enum import DBItem12from lazr.enum import DBItem
13from storm.expr import Desc
13from storm.locals import (14from storm.locals import (
14 Int,15 Int,
15 Reference,16 Reference,
@@ -200,4 +201,4 @@
200 comments = IStore(DSDComment).find(201 comments = IStore(DSDComment).find(
201 DistroSeriesDifferenceComment,202 DistroSeriesDifferenceComment,
202 DSDComment.distro_series_difference == self)203 DSDComment.distro_series_difference == self)
203 return comments.order_by(DSDComment.id)204 return comments.order_by(Desc(DSDComment.id))
204205
=== added file 'lib/lp/registry/templates/distroseries-localdifferences.pt'
--- lib/lp/registry/templates/distroseries-localdifferences.pt 1970-01-01 00:00:00 +0000
+++ lib/lp/registry/templates/distroseries-localdifferences.pt 2010-09-08 09:21:00 +0000
@@ -0,0 +1,86 @@
1<html
2 xmlns="http://www.w3.org/1999/xhtml"
3 xmlns:tal="http://xml.zope.org/namespaces/tal"
4 xmlns:metal="http://xml.zope.org/namespaces/metal"
5 xmlns:i18n="http://xml.zope.org/namespaces/i18n"
6 metal:use-macro="view/macro:page/main_only"
7 i18n:domain="launchpad">
8 <body>
9 <tal:heading metal:fill-slot="heading">
10 <h1 tal:content="view/label">Package differences between ...</h1>
11 </tal:heading>
12
13 <div class="top-portlet" metal:fill-slot="main"
14 tal:define="differences view/cached_differences;
15 series_name context/displayname;
16 parent_name context/parent_series/displayname;">
17 <p>Source packages shown here are present in both
18 <tal:replace replace="series_name">Derilucid</tal:replace>
19 and the parent series,
20 <tal:replace replace="context/parent_series/fullseriesname">Ubuntu Lucid
21 </tal:replace>, but are different somehow. Changes could be in
22 either or both series so check the versions (and the diff if
23 necessary) before syncing the
24 <tal:replace replace="parent_name">Lucid
25 </tal:replace> version
26 (<a href="/+help/soyuz/derived-series-syncing.html" target="help">Read
27 more about syncing from the parent series</a>).
28 </p>
29
30 <div tal:condition="differences/batch">
31 <tal:navigation_top
32 replace="structure differences/@@+navigation-links-upper" />
33 <table class="listing">
34 <thead>
35 <tr>
36 <th>Source</th>
37 <th><tal:replace replace="parent_name" /> version</th>
38 <th><tal:replace replace="series_name" /> version</th>
39 <th>Last uploaded</th>
40 <th>Latest comment</th>
41 </tr>
42 </thead>
43 <tbody>
44 <tal:difference repeat="difference differences/batch">
45 <tr tal:define="parent_source_pub difference/parent_source_pub;
46 source_pub difference/source_pub;
47 signer source_pub/sourcepackagerelease/uploader/fmt:link|nothing;">
48 <td><span
49 tal:replace="parent_source_pub/source_package_name">Foo</span>
50 </td>
51 <td><a tal:attributes="href parent_source_pub/sourcepackagerelease/fmt:url">
52 <tal:replace
53 replace="parent_source_pub/sourcepackagerelease/version"/></a>
54 </td>
55 <td><a tal:attributes="href source_pub/sourcepackagerelease/fmt:url">
56 <tal:replace
57 replace="source_pub/sourcepackagerelease/version"/></a>
58 </td>
59 <td>
60 <span tal:attributes="title difference/source_pub/datepublished/fmt:datetime"
61 tal:content="difference/source_pub/datepublished/fmt:approximatedate">2005-09-16</span>
62 <tal:signer condition="signer">
63 by <a tal:replace="structure signer">Steph Smith</a>
64 </tal:signer>
65 </td>
66 <td>
67 <tal:comment tal:define="comment python:difference.getComments().first();"
68 tal:condition="comment">
69 <span tal:replace="comment/comment/fmt:shorten/50">I'm on this.</span>
70 <br /><span class="greyed-out greylink"><span
71 tal:replace="comment/message/datecreated/fmt:approximatedate">2005-09-16</span>
72 by <a tal:replace="structure
73 comment/message/owner/fmt:link">joesmith</a></span>
74 </tal:comment>
75 </td>
76 </tr>
77
78 </tal:difference>
79 </tbody>
80 </table>
81 </div>
82
83 </div>
84
85 </body>
86</html>
087
=== modified file 'lib/lp/registry/tests/test_distroseriesdifference.py'
--- lib/lp/registry/tests/test_distroseriesdifference.py 2010-09-01 12:23:01 +0000
+++ lib/lp/registry/tests/test_distroseriesdifference.py 2010-09-08 09:21:00 +0000
@@ -254,7 +254,8 @@
254 self.assertEqual(ds_diff, dsd_comment.distro_series_difference)254 self.assertEqual(ds_diff, dsd_comment.distro_series_difference)
255255
256 def test_getComments(self):256 def test_getComments(self):
257 # All comments for this difference are returned.257 # All comments for this difference are returned with the
258 # most recent comment first.
258 ds_diff = self.factory.makeDistroSeriesDifference()259 ds_diff = self.factory.makeDistroSeriesDifference()
259260
260 with person_logged_in(ds_diff.owner):261 with person_logged_in(ds_diff.owner):
@@ -264,7 +265,7 @@
264 ds_diff.owner, "Wait until version 2.1")265 ds_diff.owner, "Wait until version 2.1")
265266
266 self.assertEqual(267 self.assertEqual(
267 [dsd_comment, dsd_comment_2], list(ds_diff.getComments()))268 [dsd_comment_2, dsd_comment], list(ds_diff.getComments()))
268269
269 def test_addComment_not_public(self):270 def test_addComment_not_public(self):
270 # Comments cannot be added with launchpad.View.271 # Comments cannot be added with launchpad.View.
271272
=== added file 'lib/lp/soyuz/help/derived-series-syncing.html'
--- lib/lp/soyuz/help/derived-series-syncing.html 1970-01-01 00:00:00 +0000
+++ lib/lp/soyuz/help/derived-series-syncing.html 2010-09-08 09:21:00 +0000
@@ -0,0 +1,46 @@
1<html>
2 <head>
3 <title>Syncing software from a parent series</title>
4 <link rel="stylesheet" type="text/css"
5 href="/+icing/yui/cssreset/reset.css" />
6 <link rel="stylesheet" type="text/css"
7 href="/+icing/yui/cssfonts/fonts.css" />
8 <link rel="stylesheet" type="text/css"
9 href="/+icing/yui/cssbase/base.css" />
10 </head>
11 <body>
12 <h1>Syncing software from a parent series</h1>
13
14 <p>
15 A nice introduction text written by the great
16 </p>
17
18 <p>
19 <strong>Important:</strong> Syncing a package from the parent
20 series will overwrite ....
21 </p>
22
23 <h2>Checking the differences</h2>
24
25 <p>
26 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
27 eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
28 ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
29 aliquip ex ea commodo consequat. Duis aute irure dolor in
30 reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
31 pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
32 culpa qui officia deserunt mollit anim id est laborum.
33 </p>
34
35 <p>
36 <strong>Step 1:</strong>
37 Sed ut perspiciatis unde omnis iste natus error sit voluptatem
38 accusantium doloremque laudantium, totam rem aperiam, eaque ipsa
39 quae ab illo inventore veritatis et quasi architecto beatae vitae
40 dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit
41 aspernatur aut odit aut fugit, sed quia consequuntur magni dolores
42 eos qui ratione voluptatem sequi nesciunt.
43 </p>
44
45 </body>
46</html>
047
=== modified file 'lib/lp/testing/factory.py'
--- lib/lp/testing/factory.py 2010-09-03 16:43:11 +0000
+++ lib/lp/testing/factory.py 2010-09-08 09:21:00 +0000
@@ -1873,7 +1873,8 @@
1873 source_pub = self.makeSourcePackagePublishingHistory(1873 source_pub = self.makeSourcePackagePublishingHistory(
1874 distroseries=derived_series,1874 distroseries=derived_series,
1875 version=versions.get('derived'),1875 version=versions.get('derived'),
1876 sourcepackagename=source_package_name)1876 sourcepackagename=source_package_name,
1877 status = PackagePublishingStatus.PUBLISHED)
18771878
1878 if difference_type is not (1879 if difference_type is not (
1879 DistroSeriesDifferenceType.UNIQUE_TO_DERIVED_SERIES):1880 DistroSeriesDifferenceType.UNIQUE_TO_DERIVED_SERIES):
@@ -1881,7 +1882,8 @@
1881 source_pub = self.makeSourcePackagePublishingHistory(1882 source_pub = self.makeSourcePackagePublishingHistory(
1882 distroseries=derived_series.parent_series,1883 distroseries=derived_series.parent_series,
1883 version=versions.get('parent'),1884 version=versions.get('parent'),
1884 sourcepackagename=source_package_name)1885 sourcepackagename=source_package_name,
1886 status = PackagePublishingStatus.PUBLISHED)
18851887
1886 return getUtility(IDistroSeriesDifferenceSource).new(1888 return getUtility(IDistroSeriesDifferenceSource).new(
1887 derived_series, source_package_name, difference_type,1889 derived_series, source_package_name, difference_type,

Subscribers

People subscribed via source and target branches

to status/vote changes: