Skip to content

Commit 2523982

Browse files
committed
feat(index): sort verifications by execution date
Have found a lot of provider versions with nil order, need to investigate why
1 parent 117c89b commit 2523982

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/pact_broker/index/service.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ def self.find_index_items options = {}
6161
tag_names.collect do | tag_name |
6262
verification_repository.find_latest_verification_for row.consumer_name, row.provider_name, tag_name
6363
end.compact.sort do | v1, v2 |
64-
v1.provider_version.order <=> v2.provider_version.order
64+
# Some provider versions have nil orders, not sure why
65+
# Sort by execution_date instead of order
66+
v1.execution_date <=> v2.execution_date
6567
end.last
6668
end
6769

0 commit comments

Comments
 (0)