launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #03061
[Merge] lp:~julian-edwards/launchpad/resolved-diff-search into lp:launchpad/db-devel
Julian Edwards has proposed merging lp:~julian-edwards/launchpad/resolved-diff-search into lp:launchpad/db-devel.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
Related bugs:
Bug #741113 in Launchpad itself: "+localpackagediffs needs an option to search for resolved packages"
https://bugs.launchpad.net/launchpad/+bug/741113
For more details, see:
https://code.launchpad.net/~julian-edwards/launchpad/resolved-diff-search/+merge/54687
= Summary =
Allow the +localpackagediffs page to search for resolved differences.
== Implementation details ==
Very trivial change to add an extra option to the radio selection which
passes a different DistroSeriesDifferenceStatus to the search function.
== Tests ==
bin/test -cvv test_series_views
== Demo and Q/A ==
Will all be QA'ed later since the code that generates the differences is not
ready yet.
= Launchpad lint =
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/registry/browser/distroseries.py
lib/lp/registry/browser/tests/test_series_views.py
--
https://code.launchpad.net/~julian-edwards/launchpad/resolved-diff-search/+merge/54687
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~julian-edwards/launchpad/resolved-diff-search into lp:launchpad/db-devel.
=== modified file 'lib/lp/registry/browser/distroseries.py'
--- lib/lp/registry/browser/distroseries.py 2011-03-22 08:43:17 +0000
+++ lib/lp/registry/browser/distroseries.py 2011-03-24 12:04:17 +0000
@@ -532,6 +532,7 @@
NON_BLACKLISTED = 'non-blacklisted'
BLACKLISTED = 'blacklisted'
HIGHER_VERSION_THAN_PARENT = 'higher-than-parent'
+RESOLVED = 'resolved'
DEFAULT_PACKAGE_TYPE = NON_BLACKLISTED
@@ -545,7 +546,11 @@
HIGHER_VERSION_THAN_PARENT,
HIGHER_VERSION_THAN_PARENT,
"Blacklisted packages with a higher version than in '%s'"
- % parent_name)))
+ % parent_name),
+ SimpleTerm(
+ RESOLVED,
+ RESOLVED,
+ "Resolved packages")))
class DistroSeriesNeedsPackagesView(LaunchpadView):
@@ -714,6 +719,9 @@
status=(
DistroSeriesDifferenceStatus.BLACKLISTED_CURRENT)
child_version_higher = True
+ elif self.specified_package_type == RESOLVED:
+ status=DistroSeriesDifferenceStatus.RESOLVED
+ child_version_higher = False
else:
raise AssertionError('specified_package_type unknown')
=== modified file 'lib/lp/registry/browser/tests/test_series_views.py'
--- lib/lp/registry/browser/tests/test_series_views.py 2011-03-22 08:43:17 +0000
+++ lib/lp/registry/browser/tests/test_series_views.py 2011-03-24 12:04:17 +0000
@@ -25,6 +25,7 @@
BLACKLISTED,
HIGHER_VERSION_THAN_PARENT,
NON_BLACKLISTED,
+ RESOLVED,
)
from lp.registry.enum import (
DistroSeriesDifferenceStatus,
@@ -404,6 +405,32 @@
self.assertContentEqual(
[], unblacklisted_view.cached_differences.batch)
+ def test_batch_resolved_differences(self):
+ # Test that we can search for differences that we marked
+ # resolved.
+ set_derived_series_ui_feature_flag(self)
+ derived_series = self.factory.makeDistroSeries(
+ name='derilucid', parent_series=self.factory.makeDistroSeries(
+ name='lucid'))
+
+ diff1 = self.factory.makeDistroSeriesDifference(
+ derived_series=derived_series,
+ source_package_name_str="my-src-package")
+ diff2 = self.factory.makeDistroSeriesDifference(
+ derived_series=derived_series,
+ source_package_name_str="my-second-src-package")
+ resolved_diff = self.factory.makeDistroSeriesDifference(
+ derived_series=derived_series,
+ status=DistroSeriesDifferenceStatus.RESOLVED)
+
+ filtered_view = create_initialized_view(
+ derived_series,
+ '+localpackagediffs',
+ query_string='field.package_type=%s' % RESOLVED)
+
+ self.assertContentEqual(
+ [resolved_diff], filtered_view.cached_differences.batch)
+
def test_canPerformSync_non_editor(self):
# Non-editors do not see options to sync.
derived_series = self.factory.makeDistroSeries(