Merge lp:~jtv/launchpad/more-820456 into lp:launchpad

Proposed by Jeroen T. Vermeulen
Status: Merged
Approved by: Graham Binns
Approved revision: no longer in the source branch.
Merged at revision: 13703
Proposed branch: lp:~jtv/launchpad/more-820456
Merge into: lp:launchpad
Diff against target: 85 lines (+3/-43)
3 files modified
lib/lp/registry/browser/distroseries.py (+0/-21)
lib/lp/registry/browser/tests/test_distroseries.py (+1/-17)
lib/lp/registry/templates/distroseries-localdifferences.pt (+2/-5)
To merge this branch: bzr merge lp:~jtv/launchpad/more-820456
Reviewer Review Type Date Requested Status
Graham Binns (community) code Approve
Review via email: mp+71689@code.launchpad.net

Commit message

[r=gmb][bug=820456] Never hide the search box on +localpackagediffs.

Description of the change

= Summary =

If a distroseries shares packages with its parents, and any of those packages has a version difference between the series and its parent that needs attention, the series page will link to DistroSeries:+localpackagediffs. That page shows a search box that lets you, for instance, show resolved differences, show deliberately hidden differences, and so on. The default (naturally) is to show differences that need attention.

This search box tries to stay hidden if there are no interesting differences. But that happens when there are no differences except ones that are resolved or permanently-blacklisted: circumstances under which the link to the page isn't shown in the first place! Except in the case of resolved differences, you could see the differences if only the search box would appear. You _can_ see them as long as there's just one non-resolved difference to make the search box come out.

== Proposed fix ==

Don't hide the search box. There's no point.

== Pre-implementation notes ==

There are other problems: this still won't make the link to the +localpackagediffs appear in cases where there are no differences that need attention. We filed that as bug 827347; it can be done separately and requires a bit of UI design.

== Implementation details ==

Of all my Launchpad branches, this one's been the most fun ever.

== Tests ==

{{{
./bin/test -vvc lp.registry.browser.tests.test_distroseries
}}}

== Demo and Q/A ==

Hack your way into a DistroSeries:+localpackagediffs page when there are no differences. The search box will appear.

Or: initialize a distroseries from a parent, run ISDJs/PCJs/DSDJs, and hack your way to the +localpackagediffs page. You'll be able to show resolved differences.

= Launchpad lint =

Checking for conflicts and issues in changed files.

Linting changed files:
  lib/lp/registry/templates/distroseries-localdifferences.pt
  lib/lp/registry/browser/tests/test_distroseries.py
  lib/lp/registry/browser/distroseries.py

To post a comment you must log in.
Revision history for this message
Graham Binns (gmb) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/registry/browser/distroseries.py'
2--- lib/lp/registry/browser/distroseries.py 2011-08-10 17:00:16 +0000
3+++ lib/lp/registry/browser/distroseries.py 2011-08-16 13:38:27 +0000
4@@ -1117,27 +1117,6 @@
5
6 return BatchNavigator(differences, self.request)
7
8- @cachedproperty
9- def has_differences(self):
10- """Whether or not differences between this derived series and
11- its parent exist.
12- """
13- # Performance optimisation: save a query if we have differences
14- # to show in the batch.
15- if self.cached_differences.batch.total() > 0:
16- return True
17- else:
18- # Here we check the whole dataset since the empty batch
19- # might be filtered.
20- differences = getUtility(
21- IDistroSeriesDifferenceSource).getForDistroSeries(
22- self.context,
23- difference_type=self.differences_type,
24- status=(
25- DistroSeriesDifferenceStatus.NEEDS_ATTENTION,
26- DistroSeriesDifferenceStatus.BLACKLISTED_CURRENT))
27- return not differences.is_empty()
28-
29 def parent_changelog_url(self, distroseriesdifference):
30 """The URL to the /parent/series/+source/package/+changelog """
31 distro = distroseriesdifference.parent_series.distribution
32
33=== modified file 'lib/lp/registry/browser/tests/test_distroseries.py'
34--- lib/lp/registry/browser/tests/test_distroseries.py 2011-08-10 15:40:17 +0000
35+++ lib/lp/registry/browser/tests/test_distroseries.py 2011-08-16 13:38:27 +0000
36@@ -1042,22 +1042,6 @@
37 find_tag_by_id(view(), 'distroseries-localdiff-search-filter'),
38 "Form filter should be shown when there are differences.")
39
40- def test_filter_noform_if_nodifferences(self):
41- # Test that the page doesn't includes the filter form if no
42- # differences are present
43- simple_user = self.factory.makePerson()
44- login_person(simple_user)
45- derived_series, parent_series = self._createChildAndParent()
46-
47- set_derived_series_ui_feature_flag(self)
48- view = create_initialized_view(
49- derived_series, '+localpackagediffs', principal=simple_user)
50-
51- self.assertIs(
52- None,
53- find_tag_by_id(view(), 'distroseries-localdiff-search-filter'),
54- "Form filter should not be shown when there are no differences.")
55-
56 def test_parent_packagesets_localpackagediffs(self):
57 # +localpackagediffs displays the packagesets.
58 ds_diff = self.factory.makeDistroSeriesDifference()
59@@ -1938,7 +1922,7 @@
60 pu = self.factory.makePackageUpload(distroseries=dsd.derived_series)
61 # A copy job with an attached packageupload means the job is
62 # waiting in the queues.
63- removeSecurityProxy(pu).package_copy_job=pcj.id
64+ removeSecurityProxy(pu).package_copy_job = pcj.id
65 view.pending_syncs = {dsd.source_package_name.name: pcj}
66 expected = (
67 'waiting in <a href="%s/+queue?queue_state=%s">%s</a>&hellip;'
68
69=== modified file 'lib/lp/registry/templates/distroseries-localdifferences.pt'
70--- lib/lp/registry/templates/distroseries-localdifferences.pt 2011-08-11 11:11:54 +0000
71+++ lib/lp/registry/templates/distroseries-localdifferences.pt 2011-08-16 13:38:27 +0000
72@@ -29,11 +29,8 @@
73 can_perform_sync view/canPerformSync;">
74 <p><tal:replace replace="structure view/explanation/escapedtext" /></p>
75
76- <tal:distroseries_localdiff_search_form
77- tal:condition="view/has_differences">
78- <metal:package_filter_form
79- use-macro="context/@@+macros/distroseries-localdiff-search-form" />
80- </tal:distroseries_localdiff_search_form>
81+ <metal:package_filter_form
82+ use-macro="context/@@+macros/distroseries-localdiff-search-form" />
83
84
85 <div metal:use-macro="context/@@launchpad_form/form">