launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #23515
[Merge] lp:~cjwatson/launchpad/fix-ordering into lp:launchpad
Colin Watson has proposed merging lp:~cjwatson/launchpad/fix-ordering into lp:launchpad.
Commit message:
Sort the results of various methods to match test assertions.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/fix-ordering/+merge/366102
--
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/fix-ordering into lp:launchpad.
=== modified file 'lib/lp/bugs/model/bug.py'
--- lib/lp/bugs/model/bug.py 2019-01-10 11:41:30 +0000
+++ lib/lp/bugs/model/bug.py 2019-04-16 11:18:04 +0000
@@ -1383,9 +1383,10 @@
return EmptyResultSet()
else:
branch_ids = [branch.id for branch in linked_branches]
- return Store.of(self).find(
+ results = Store.of(self).find(
BugBranch,
BugBranch.bug == self, In(BugBranch.branchID, branch_ids))
+ return results.order_by(BugBranch.id)
def linkMergeProposal(self, merge_proposal, user, check_permissions=True):
"""See `IBug`."""
=== modified file 'lib/lp/registry/model/distroseries.py'
--- lib/lp/registry/model/distroseries.py 2019-02-13 14:39:18 +0000
+++ lib/lp/registry/model/distroseries.py 2019-04-16 11:18:04 +0000
@@ -1110,7 +1110,9 @@
SourcePackagePublishingHistory.pocket == pocket,
SourcePackagePublishingHistory.component == component,
SourcePackagePublishingHistory.status ==
- PackagePublishingStatus.PUBLISHED)
+ PackagePublishingStatus.PUBLISHED,
+ SourcePackagePublishingHistory.sourcepackagename ==
+ SourcePackageName.id).order_by(SourcePackageName.name)
def eager_load(spphs):
# Preload everything which will be used by archivepublisher's
@@ -1146,7 +1148,9 @@
BinaryPackagePublishingHistory.pocket == pocket,
BinaryPackagePublishingHistory.component == component,
BinaryPackagePublishingHistory.status ==
- PackagePublishingStatus.PUBLISHED)
+ PackagePublishingStatus.PUBLISHED,
+ BinaryPackagePublishingHistory.binarypackagename ==
+ BinaryPackageName.id).order_by(BinaryPackageName.name)
def eager_load(bpphs):
# Preload everything which will be used by archivepublisher's
=== modified file 'lib/lp/soyuz/model/publishing.py'
--- lib/lp/soyuz/model/publishing.py 2018-05-23 13:24:03 +0000
+++ lib/lp/soyuz/model/publishing.py 2019-04-16 11:18:04 +0000
@@ -314,7 +314,8 @@
BinaryPackageBuild.id == BinaryPackageRelease.buildID,
BinaryPackageBuild.source_package_release_id ==
self.sourcepackagereleaseID,
- DistroArchSeries.distroseriesID == self.distroseriesID))
+ DistroArchSeries.distroseriesID == self.distroseriesID).order_by(
+ Desc(BinaryPackagePublishingHistory.id)))
# Preload attached BinaryPackageReleases.
bpr_ids = set(
Follow ups