lib/pact_broker/pacts/selector.rb in pact_broker-2.109.1 vs lib/pact_broker/pacts/selector.rb in pact_broker-2.111.0
- old
+ new
@@ -29,10 +29,12 @@
# verifiable_pact_messages, so don't need the "for_consumer" sub category
# rubocop: disable Metrics/CyclomaticComplexity
def type
if latest_for_main_branch?
:latest_for_main_branch
+ elsif latest_for_each_branch?
+ :latest_for_each_branch
elsif latest_for_branch?
:latest_for_branch
elsif matching_branch?
:matching_branch
elsif currently_deployed?
@@ -263,13 +265,17 @@
end
# Not sure if the fallback_tag logic is needed
def latest_for_branch? potential_branch = nil
if potential_branch
- !!(latest && branch == potential_branch)
+ latest == true && branch == potential_branch
else
- !!(latest && !!branch)
+ latest == true && branch.is_a?(String)
end
+ end
+
+ def latest_for_each_branch?
+ latest == true && branch == true
end
def all_for_tag_and_consumer?
!!(tag && !latest? && consumer)
end