Merge lp:~cjwatson/launchpad/fix-ordering into lp:launchpad

Proposed by Colin Watson
Status: Merged
Merged at revision: 18940
Proposed branch: lp:~cjwatson/launchpad/fix-ordering
Merge into: lp:launchpad
Diff against target: 55 lines (+10/-4)
3 files modified
lib/lp/bugs/model/bug.py (+2/-1)
lib/lp/registry/model/distroseries.py (+6/-2)
lib/lp/soyuz/model/publishing.py (+2/-1)
To merge this branch: bzr merge lp:~cjwatson/launchpad/fix-ordering
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+366102@code.launchpad.net

Commit message

Sort the results of various methods to match test assertions.

Description of the change

For some reason I see corresponding test failures locally but not on buildbot.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) :
review: Approve (code)
Revision history for this message
Colin Watson (cjwatson) :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/bugs/model/bug.py'
2--- lib/lp/bugs/model/bug.py 2019-01-10 11:41:30 +0000
3+++ lib/lp/bugs/model/bug.py 2019-04-16 11:18:04 +0000
4@@ -1383,9 +1383,10 @@
5 return EmptyResultSet()
6 else:
7 branch_ids = [branch.id for branch in linked_branches]
8- return Store.of(self).find(
9+ results = Store.of(self).find(
10 BugBranch,
11 BugBranch.bug == self, In(BugBranch.branchID, branch_ids))
12+ return results.order_by(BugBranch.id)
13
14 def linkMergeProposal(self, merge_proposal, user, check_permissions=True):
15 """See `IBug`."""
16
17=== modified file 'lib/lp/registry/model/distroseries.py'
18--- lib/lp/registry/model/distroseries.py 2019-02-13 14:39:18 +0000
19+++ lib/lp/registry/model/distroseries.py 2019-04-16 11:18:04 +0000
20@@ -1110,7 +1110,9 @@
21 SourcePackagePublishingHistory.pocket == pocket,
22 SourcePackagePublishingHistory.component == component,
23 SourcePackagePublishingHistory.status ==
24- PackagePublishingStatus.PUBLISHED)
25+ PackagePublishingStatus.PUBLISHED,
26+ SourcePackagePublishingHistory.sourcepackagename ==
27+ SourcePackageName.id).order_by(SourcePackageName.name)
28
29 def eager_load(spphs):
30 # Preload everything which will be used by archivepublisher's
31@@ -1146,7 +1148,9 @@
32 BinaryPackagePublishingHistory.pocket == pocket,
33 BinaryPackagePublishingHistory.component == component,
34 BinaryPackagePublishingHistory.status ==
35- PackagePublishingStatus.PUBLISHED)
36+ PackagePublishingStatus.PUBLISHED,
37+ BinaryPackagePublishingHistory.binarypackagename ==
38+ BinaryPackageName.id).order_by(BinaryPackageName.name)
39
40 def eager_load(bpphs):
41 # Preload everything which will be used by archivepublisher's
42
43=== modified file 'lib/lp/soyuz/model/publishing.py'
44--- lib/lp/soyuz/model/publishing.py 2018-05-23 13:24:03 +0000
45+++ lib/lp/soyuz/model/publishing.py 2019-04-16 11:18:04 +0000
46@@ -314,7 +314,8 @@
47 BinaryPackageBuild.id == BinaryPackageRelease.buildID,
48 BinaryPackageBuild.source_package_release_id ==
49 self.sourcepackagereleaseID,
50- DistroArchSeries.distroseriesID == self.distroseriesID))
51+ DistroArchSeries.distroseriesID == self.distroseriesID).order_by(
52+ Desc(BinaryPackagePublishingHistory.id)))
53
54 # Preload attached BinaryPackageReleases.
55 bpr_ids = set(