Merge lp:~michael.nelson/launchpad/distro-series-difference-browser2 into lp:launchpad/db-devel
- distro-series-difference-browser2
- Merge into db-devel
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 | ||||
Related bugs: |
|
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 UI mockup:
https:/
Details
=======
The view is behind a feature flag, so the url will redirect back to the distro series when the soyuz.derived-
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_distroseri
To demo locally
===============
Run the following in bin/iharness:
http://
Michael Nelson (michael.nelson) wrote : | # |
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:/
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
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.
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:/
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.
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.
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://
Now onto the UI tweaks... thanks Leonard!
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://
> - 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:/
FYI: I wasn't putting the hyphen in, it's part of
SourcePackageRe
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!
Henning Eggers (henninge) wrote : | # |
Am 08.09.2010 11:19, schrieb Michael Nelson:
> http://
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
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:/
> 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:/
> You are the owner of lp:~michael.nelson/launchpad/distro-series-difference-browser2.
>
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
1 | === modified file 'lib/lp/registry/browser/configure.zcml' |
2 | --- lib/lp/registry/browser/configure.zcml 2010-08-27 04:33:52 +0000 |
3 | +++ lib/lp/registry/browser/configure.zcml 2010-09-08 09:21:00 +0000 |
4 | @@ -143,6 +143,12 @@ |
5 | for="lp.registry.interfaces.distroseries.IDistroSeries" |
6 | class="canonical.launchpad.browser.AskAQuestionButtonView" |
7 | permission="zope.Public"/> |
8 | + <browser:page |
9 | + name="+localpackagediffs" |
10 | + for="lp.registry.interfaces.distroseries.IDistroSeries" |
11 | + class="lp.registry.browser.distroseries.DistroSeriesLocalDifferences" |
12 | + template="../templates/distroseries-localdifferences.pt" |
13 | + permission="zope.Public"/> |
14 | <browser:menus |
15 | classes=" |
16 | DistroSeriesFacets |
17 | |
18 | === modified file 'lib/lp/registry/browser/distroseries.py' |
19 | --- lib/lp/registry/browser/distroseries.py 2010-09-03 15:02:39 +0000 |
20 | +++ lib/lp/registry/browser/distroseries.py 2010-09-08 09:21:00 +0000 |
21 | @@ -11,6 +11,7 @@ |
22 | 'DistroSeriesBreadcrumb', |
23 | 'DistroSeriesEditView', |
24 | 'DistroSeriesFacets', |
25 | + 'DistroSeriesLocalDifferences', |
26 | 'DistroSeriesPackageSearchView', |
27 | 'DistroSeriesPackagesView', |
28 | 'DistroSeriesNavigation', |
29 | @@ -70,7 +71,10 @@ |
30 | StructuralSubscriptionTargetTraversalMixin, |
31 | ) |
32 | from lp.registry.interfaces.distroseries import IDistroSeries |
33 | +from lp.registry.interfaces.distroseriesdifference import ( |
34 | + IDistroSeriesDifferenceSource) |
35 | from lp.registry.interfaces.series import SeriesStatus |
36 | +from lp.services.features.flags import FeatureController |
37 | from lp.services.propertycache import cachedproperty |
38 | from lp.services.worlddata.interfaces.country import ICountry |
39 | from lp.services.worlddata.interfaces.language import ILanguageSet |
40 | @@ -525,3 +529,36 @@ |
41 | navigator = BatchNavigator(packages, self.request, size=20) |
42 | navigator.setHeadings('package', 'packages') |
43 | return navigator |
44 | + |
45 | + |
46 | +class DistroSeriesLocalDifferences(LaunchpadView): |
47 | + """Present differences between a derived series and its parent.""" |
48 | + |
49 | + page_title = 'Local package differences' |
50 | + |
51 | + def initialize(self): |
52 | + """Redirect to the derived series if the feature is not enabled.""" |
53 | + def in_scope(value): |
54 | + return True |
55 | + |
56 | + feature_controller = FeatureController(in_scope) |
57 | + if feature_controller.getFlag('soyuz.derived-series-ui.enabled') != 'on': |
58 | + self.request.response.redirect(canonical_url(self.context)) |
59 | + return |
60 | + super(DistroSeriesLocalDifferences, self).initialize() |
61 | + |
62 | + @property |
63 | + def label(self): |
64 | + return ( |
65 | + "Source package differences between '%s' and " |
66 | + "parent series '%s'" % ( |
67 | + self.context.displayname, |
68 | + self.context.parent_series.displayname, |
69 | + )) |
70 | + |
71 | + @cachedproperty |
72 | + def cached_differences(self): |
73 | + """Return a batch navigator of potentially filtered results.""" |
74 | + differences = getUtility(IDistroSeriesDifferenceSource).getForDistroSeries( |
75 | + self.context) |
76 | + return BatchNavigator(differences, self.request) |
77 | |
78 | === modified file 'lib/lp/registry/browser/tests/test_series_views.py' |
79 | --- lib/lp/registry/browser/tests/test_series_views.py 2010-08-31 15:14:01 +0000 |
80 | +++ lib/lp/registry/browser/tests/test_series_views.py 2010-09-08 09:21:00 +0000 |
81 | @@ -3,14 +3,24 @@ |
82 | |
83 | __metaclass__ = type |
84 | |
85 | +from BeautifulSoup import BeautifulSoup |
86 | from storm.zope.interfaces import IResultSet |
87 | from zope.component import getUtility |
88 | from zope.security.proxy import removeSecurityProxy |
89 | |
90 | +import unittest |
91 | + |
92 | from canonical.config import config |
93 | from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities |
94 | from canonical.launchpad.webapp.batching import BatchNavigator |
95 | +from canonical.launchpad.webapp.publisher import canonical_url |
96 | from canonical.testing import LaunchpadZopelessLayer |
97 | +from lp.registry.enum import ( |
98 | + DistroSeriesDifferenceStatus, |
99 | + DistroSeriesDifferenceType, |
100 | + ) |
101 | +from lp.services.features.flags import FeatureController |
102 | +from lp.services.features.model import FeatureFlag, getFeatureStore |
103 | from lp.testing import TestCaseWithFactory |
104 | from lp.testing.views import create_initialized_view |
105 | |
106 | @@ -44,6 +54,134 @@ |
107 | self.assertEqual(view.needs_linking, None) |
108 | |
109 | |
110 | +class DistroSeriesLocalPackageDiffsTestCase(TestCaseWithFactory): |
111 | + """Test the distroseries +localpackagediffs view.""" |
112 | + |
113 | + layer = LaunchpadZopelessLayer |
114 | + |
115 | + def makeDerivedSeries(self, derived_name=None, parent_name=None): |
116 | + # Helper that creates a derived distro series. |
117 | + parent = self.factory.makeDistroSeries(name=parent_name) |
118 | + derived_series = self.factory.makeDistroSeries( |
119 | + name=derived_name, parent_series=parent) |
120 | + return derived_series |
121 | + |
122 | + def setDerivedSeriesUIFeatureFlag(self): |
123 | + # Helper to set the feature flag enabling the derived series ui. |
124 | + ignore = getFeatureStore().add(FeatureFlag( |
125 | + scope=u'default', flag=u'soyuz.derived-series-ui.enabled', |
126 | + value=u'on', priority=1)) |
127 | + |
128 | + def getDerivedSeriesUIFeatureFlag(self, flag): |
129 | + """Helper to return the given flag leaving tests more readable.""" |
130 | + def in_scope(value): |
131 | + return True |
132 | + |
133 | + feature_controller = FeatureController(in_scope) |
134 | + return feature_controller.getFlag(flag) |
135 | + |
136 | + def test_view_redirects_without_feature_flag(self): |
137 | + # If the feature flag soyuz.derived-series-ui.enabled is not set the |
138 | + # view simply redirects to the derived series. |
139 | + derived_series = self.makeDerivedSeries( |
140 | + parent_name='lucid', derived_name='derilucid') |
141 | + |
142 | + self.assertIs( |
143 | + None, self.getDerivedSeriesUIFeatureFlag( |
144 | + 'soyuz.derived-series-ui.enabled')) |
145 | + view = create_initialized_view( |
146 | + derived_series, '+localpackagediffs') |
147 | + |
148 | + response = view.request.response |
149 | + self.assertEqual(302, response.getStatus()) |
150 | + self.assertEqual( |
151 | + canonical_url(derived_series), response.getHeader('location')) |
152 | + |
153 | + def test_label(self): |
154 | + # The view label includes the names of both series. |
155 | + derived_series = self.makeDerivedSeries( |
156 | + parent_name='lucid', derived_name='derilucid') |
157 | + |
158 | + view = create_initialized_view( |
159 | + derived_series, '+localpackagediffs') |
160 | + |
161 | + self.assertEqual( |
162 | + "Source package differences between 'Derilucid' and " |
163 | + "parent series 'Lucid'", |
164 | + view.label) |
165 | + |
166 | + def test_batch_includes_needing_attention_only(self): |
167 | + # The differences attribute includes differences needing |
168 | + # attention only. |
169 | + derived_series = self.makeDerivedSeries( |
170 | + parent_name='lucid', derived_name='derilucid') |
171 | + current_difference = self.factory.makeDistroSeriesDifference( |
172 | + derived_series=derived_series) |
173 | + old_difference = self.factory.makeDistroSeriesDifference( |
174 | + derived_series=derived_series, |
175 | + status=DistroSeriesDifferenceStatus.RESOLVED) |
176 | + |
177 | + view = create_initialized_view( |
178 | + derived_series, '+localpackagediffs') |
179 | + |
180 | + self.assertContentEqual( |
181 | + [current_difference], view.cached_differences.batch) |
182 | + |
183 | + def test_batch_includes_different_versions_only(self): |
184 | + # The view contains differences of type DIFFERENT_VERSIONS only. |
185 | + derived_series = self.makeDerivedSeries( |
186 | + parent_name='lucid', derived_name='derilucid') |
187 | + different_versions_diff = self.factory.makeDistroSeriesDifference( |
188 | + derived_series=derived_series) |
189 | + unique_diff = self.factory.makeDistroSeriesDifference( |
190 | + derived_series=derived_series, |
191 | + difference_type=( |
192 | + DistroSeriesDifferenceType.UNIQUE_TO_DERIVED_SERIES)) |
193 | + |
194 | + view = create_initialized_view( |
195 | + derived_series, '+localpackagediffs') |
196 | + |
197 | + self.assertContentEqual( |
198 | + [different_versions_diff], view.cached_differences.batch) |
199 | + |
200 | + def test_template_includes_help_link(self): |
201 | + # The help link for popup help is included. |
202 | + derived_series = self.makeDerivedSeries( |
203 | + parent_name='lucid', derived_name='derilucid') |
204 | + |
205 | + self.setDerivedSeriesUIFeatureFlag() |
206 | + view = create_initialized_view( |
207 | + derived_series, '+localpackagediffs') |
208 | + |
209 | + soup = BeautifulSoup(view()) |
210 | + help_links = soup.findAll( |
211 | + 'a', href='/+help/soyuz/derived-series-syncing.html') |
212 | + self.assertEqual(1, len(help_links)) |
213 | + |
214 | + def test_diff_row_includes_last_comment_only(self): |
215 | + # The most recent comment is rendered for each difference. |
216 | + derived_series = self.makeDerivedSeries( |
217 | + parent_name='lucid', derived_name='derilucid') |
218 | + difference = self.factory.makeDistroSeriesDifference( |
219 | + derived_series=derived_series) |
220 | + difference.addComment(difference.owner, "Earlier comment") |
221 | + difference.addComment(difference.owner, "Latest comment") |
222 | + |
223 | + self.setDerivedSeriesUIFeatureFlag() |
224 | + view = create_initialized_view( |
225 | + derived_series, '+localpackagediffs') |
226 | + |
227 | + # Find all the rows within the body of the table |
228 | + # listing the differences. |
229 | + soup = BeautifulSoup(view()) |
230 | + diff_table = soup.find('table', {'class': 'listing'}) |
231 | + rows = diff_table.tbody.findAll('tr') |
232 | + |
233 | + self.assertEqual(1, len(rows)) |
234 | + self.assertIn("Latest comment", unicode(rows[0])) |
235 | + self.assertNotIn("Earlier comment", unicode(rows[0])) |
236 | + |
237 | + |
238 | class TestMilestoneBatchNavigatorAttribute(TestCaseWithFactory): |
239 | """Test the series.milestone_batch_navigator attribute.""" |
240 | |
241 | @@ -61,6 +199,7 @@ |
242 | product = self.factory.makeProduct() |
243 | for name in ('a', 'b', 'c', 'd'): |
244 | product.development_focus.newMilestone(name) |
245 | + |
246 | view = create_initialized_view( |
247 | product.development_focus, name='+index') |
248 | self._check_milestone_batch_navigator(view) |
249 | @@ -84,3 +223,7 @@ |
250 | for item in view.milestone_batch_navigator.currentBatch()] |
251 | self.assertEqual(expected, milestone_names) |
252 | config.pop('default-batch-size') |
253 | + |
254 | + |
255 | +def test_suite(): |
256 | + return unittest.TestLoader().loadTestsFromName(__name__) |
257 | |
258 | === modified file 'lib/lp/registry/model/distroseriesdifference.py' |
259 | --- lib/lp/registry/model/distroseriesdifference.py 2010-09-01 12:23:01 +0000 |
260 | +++ lib/lp/registry/model/distroseriesdifference.py 2010-09-08 09:21:00 +0000 |
261 | @@ -10,6 +10,7 @@ |
262 | ] |
263 | |
264 | from lazr.enum import DBItem |
265 | +from storm.expr import Desc |
266 | from storm.locals import ( |
267 | Int, |
268 | Reference, |
269 | @@ -200,4 +201,4 @@ |
270 | comments = IStore(DSDComment).find( |
271 | DistroSeriesDifferenceComment, |
272 | DSDComment.distro_series_difference == self) |
273 | - return comments.order_by(DSDComment.id) |
274 | + return comments.order_by(Desc(DSDComment.id)) |
275 | |
276 | === added file 'lib/lp/registry/templates/distroseries-localdifferences.pt' |
277 | --- lib/lp/registry/templates/distroseries-localdifferences.pt 1970-01-01 00:00:00 +0000 |
278 | +++ lib/lp/registry/templates/distroseries-localdifferences.pt 2010-09-08 09:21:00 +0000 |
279 | @@ -0,0 +1,86 @@ |
280 | +<html |
281 | + xmlns="http://www.w3.org/1999/xhtml" |
282 | + xmlns:tal="http://xml.zope.org/namespaces/tal" |
283 | + xmlns:metal="http://xml.zope.org/namespaces/metal" |
284 | + xmlns:i18n="http://xml.zope.org/namespaces/i18n" |
285 | + metal:use-macro="view/macro:page/main_only" |
286 | + i18n:domain="launchpad"> |
287 | + <body> |
288 | + <tal:heading metal:fill-slot="heading"> |
289 | + <h1 tal:content="view/label">Package differences between ...</h1> |
290 | + </tal:heading> |
291 | + |
292 | + <div class="top-portlet" metal:fill-slot="main" |
293 | + tal:define="differences view/cached_differences; |
294 | + series_name context/displayname; |
295 | + parent_name context/parent_series/displayname;"> |
296 | + <p>Source packages shown here are present in both |
297 | + <tal:replace replace="series_name">Derilucid</tal:replace> |
298 | + and the parent series, |
299 | + <tal:replace replace="context/parent_series/fullseriesname">Ubuntu Lucid |
300 | + </tal:replace>, but are different somehow. Changes could be in |
301 | + either or both series so check the versions (and the diff if |
302 | + necessary) before syncing the |
303 | + <tal:replace replace="parent_name">Lucid |
304 | + </tal:replace> version |
305 | + (<a href="/+help/soyuz/derived-series-syncing.html" target="help">Read |
306 | + more about syncing from the parent series</a>). |
307 | + </p> |
308 | + |
309 | + <div tal:condition="differences/batch"> |
310 | + <tal:navigation_top |
311 | + replace="structure differences/@@+navigation-links-upper" /> |
312 | + <table class="listing"> |
313 | + <thead> |
314 | + <tr> |
315 | + <th>Source</th> |
316 | + <th><tal:replace replace="parent_name" /> version</th> |
317 | + <th><tal:replace replace="series_name" /> version</th> |
318 | + <th>Last uploaded</th> |
319 | + <th>Latest comment</th> |
320 | + </tr> |
321 | + </thead> |
322 | + <tbody> |
323 | + <tal:difference repeat="difference differences/batch"> |
324 | + <tr tal:define="parent_source_pub difference/parent_source_pub; |
325 | + source_pub difference/source_pub; |
326 | + signer source_pub/sourcepackagerelease/uploader/fmt:link|nothing;"> |
327 | + <td><span |
328 | + tal:replace="parent_source_pub/source_package_name">Foo</span> |
329 | + </td> |
330 | + <td><a tal:attributes="href parent_source_pub/sourcepackagerelease/fmt:url"> |
331 | + <tal:replace |
332 | + replace="parent_source_pub/sourcepackagerelease/version"/></a> |
333 | + </td> |
334 | + <td><a tal:attributes="href source_pub/sourcepackagerelease/fmt:url"> |
335 | + <tal:replace |
336 | + replace="source_pub/sourcepackagerelease/version"/></a> |
337 | + </td> |
338 | + <td> |
339 | + <span tal:attributes="title difference/source_pub/datepublished/fmt:datetime" |
340 | + tal:content="difference/source_pub/datepublished/fmt:approximatedate">2005-09-16</span> |
341 | + <tal:signer condition="signer"> |
342 | + by <a tal:replace="structure signer">Steph Smith</a> |
343 | + </tal:signer> |
344 | + </td> |
345 | + <td> |
346 | + <tal:comment tal:define="comment python:difference.getComments().first();" |
347 | + tal:condition="comment"> |
348 | + <span tal:replace="comment/comment/fmt:shorten/50">I'm on this.</span> |
349 | + <br /><span class="greyed-out greylink"><span |
350 | + tal:replace="comment/message/datecreated/fmt:approximatedate">2005-09-16</span> |
351 | + by <a tal:replace="structure |
352 | + comment/message/owner/fmt:link">joesmith</a></span> |
353 | + </tal:comment> |
354 | + </td> |
355 | + </tr> |
356 | + |
357 | + </tal:difference> |
358 | + </tbody> |
359 | + </table> |
360 | + </div> |
361 | + |
362 | + </div> |
363 | + |
364 | + </body> |
365 | +</html> |
366 | |
367 | === modified file 'lib/lp/registry/tests/test_distroseriesdifference.py' |
368 | --- lib/lp/registry/tests/test_distroseriesdifference.py 2010-09-01 12:23:01 +0000 |
369 | +++ lib/lp/registry/tests/test_distroseriesdifference.py 2010-09-08 09:21:00 +0000 |
370 | @@ -254,7 +254,8 @@ |
371 | self.assertEqual(ds_diff, dsd_comment.distro_series_difference) |
372 | |
373 | def test_getComments(self): |
374 | - # All comments for this difference are returned. |
375 | + # All comments for this difference are returned with the |
376 | + # most recent comment first. |
377 | ds_diff = self.factory.makeDistroSeriesDifference() |
378 | |
379 | with person_logged_in(ds_diff.owner): |
380 | @@ -264,7 +265,7 @@ |
381 | ds_diff.owner, "Wait until version 2.1") |
382 | |
383 | self.assertEqual( |
384 | - [dsd_comment, dsd_comment_2], list(ds_diff.getComments())) |
385 | + [dsd_comment_2, dsd_comment], list(ds_diff.getComments())) |
386 | |
387 | def test_addComment_not_public(self): |
388 | # Comments cannot be added with launchpad.View. |
389 | |
390 | === added file 'lib/lp/soyuz/help/derived-series-syncing.html' |
391 | --- lib/lp/soyuz/help/derived-series-syncing.html 1970-01-01 00:00:00 +0000 |
392 | +++ lib/lp/soyuz/help/derived-series-syncing.html 2010-09-08 09:21:00 +0000 |
393 | @@ -0,0 +1,46 @@ |
394 | +<html> |
395 | + <head> |
396 | + <title>Syncing software from a parent series</title> |
397 | + <link rel="stylesheet" type="text/css" |
398 | + href="/+icing/yui/cssreset/reset.css" /> |
399 | + <link rel="stylesheet" type="text/css" |
400 | + href="/+icing/yui/cssfonts/fonts.css" /> |
401 | + <link rel="stylesheet" type="text/css" |
402 | + href="/+icing/yui/cssbase/base.css" /> |
403 | + </head> |
404 | + <body> |
405 | + <h1>Syncing software from a parent series</h1> |
406 | + |
407 | + <p> |
408 | + A nice introduction text written by the great |
409 | + </p> |
410 | + |
411 | + <p> |
412 | + <strong>Important:</strong> Syncing a package from the parent |
413 | + series will overwrite .... |
414 | + </p> |
415 | + |
416 | + <h2>Checking the differences</h2> |
417 | + |
418 | + <p> |
419 | + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do |
420 | + eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim |
421 | + ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut |
422 | + aliquip ex ea commodo consequat. Duis aute irure dolor in |
423 | + reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla |
424 | + pariatur. Excepteur sint occaecat cupidatat non proident, sunt in |
425 | + culpa qui officia deserunt mollit anim id est laborum. |
426 | + </p> |
427 | + |
428 | + <p> |
429 | + <strong>Step 1:</strong> |
430 | + Sed ut perspiciatis unde omnis iste natus error sit voluptatem |
431 | + accusantium doloremque laudantium, totam rem aperiam, eaque ipsa |
432 | + quae ab illo inventore veritatis et quasi architecto beatae vitae |
433 | + dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit |
434 | + aspernatur aut odit aut fugit, sed quia consequuntur magni dolores |
435 | + eos qui ratione voluptatem sequi nesciunt. |
436 | + </p> |
437 | + |
438 | + </body> |
439 | +</html> |
440 | |
441 | === modified file 'lib/lp/testing/factory.py' |
442 | --- lib/lp/testing/factory.py 2010-09-03 16:43:11 +0000 |
443 | +++ lib/lp/testing/factory.py 2010-09-08 09:21:00 +0000 |
444 | @@ -1873,7 +1873,8 @@ |
445 | source_pub = self.makeSourcePackagePublishingHistory( |
446 | distroseries=derived_series, |
447 | version=versions.get('derived'), |
448 | - sourcepackagename=source_package_name) |
449 | + sourcepackagename=source_package_name, |
450 | + status = PackagePublishingStatus.PUBLISHED) |
451 | |
452 | if difference_type is not ( |
453 | DistroSeriesDifferenceType.UNIQUE_TO_DERIVED_SERIES): |
454 | @@ -1881,7 +1882,8 @@ |
455 | source_pub = self.makeSourcePackagePublishingHistory( |
456 | distroseries=derived_series.parent_series, |
457 | version=versions.get('parent'), |
458 | - sourcepackagename=source_package_name) |
459 | + sourcepackagename=source_package_name, |
460 | + status = PackagePublishingStatus.PUBLISHED) |
461 | |
462 | return getUtility(IDistroSeriesDifferenceSource).new( |
463 | derived_series, source_package_name, difference_type, |
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 :)