Skip to content

Commit

Permalink
fix: fix bug identifying latest verification for tagged pact
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed Sep 14, 2021
1 parent 7f72291 commit 43ac4b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/pact_broker/index/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,11 @@ def self.latest_verification_for_pseudo_branch(pact_publication, is_overall_late
elsif tags_option == true
latest_verifications_for_cv_tags
.select{ | v | v.consumer_id == pact_publication.consumer_id && v.provider_id == pact_publication.provider_id && pact_publication.head_pact_tags.collect(&:name).include?(v.consumer_version_tag_name) }
.sort{ |v1, v2| v1.id <=> v2.id }.last || (is_overall_latest && pact_publication.integration.latest_verification)
.sort{ |v1, v2| v1.id <=> v2.id }.last || (is_overall_latest ? pact_publication.integration.latest_verification : nil)
elsif tags_option.is_a?(Array)
latest_verifications_for_cv_tags
.select{ | v | v.consumer_id == pact_publication.consumer_id && v.provider_id == pact_publication.provider_id && pact_publication.head_pact_tags.collect(&:name).include?(v.consumer_version_tag_name) && tags_option.include?(v.consumer_version_tag_name) }
.sort{ |v1, v2| v1.id <=> v2.id }.last || (is_overall_latest && pact_publication.integration.latest_verification)
.sort{ |v1, v2| v1.id <=> v2.id }.last || (is_overall_latest ? pact_publication.integration.latest_verification : nil)
else
pact_publication.integration.latest_verification
end
Expand Down

0 comments on commit 43ac4b0

Please sign in to comment.