From 6552b46505b7b3d018a35778eee3a2b7bb49e70a Mon Sep 17 00:00:00 2001 From: Beth Skurrie Date: Fri, 15 Jun 2018 07:32:51 +1000 Subject: [PATCH] feat: change version ordering to sort by date by default --- lib/pact_broker/configuration.rb | 3 +-- spec/lib/pact_broker/pacts/pact_version_spec.rb | 1 + spec/lib/pact_broker/verifications/repository_spec.rb | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/pact_broker/configuration.rb b/lib/pact_broker/configuration.rb index 759543a4e..a90fd68ea 100644 --- a/lib/pact_broker/configuration.rb +++ b/lib/pact_broker/configuration.rb @@ -73,8 +73,7 @@ def self.default_configuration config.version_parser = PactBroker::Versions::ParseSemanticVersion config.sha_generator = PactBroker::Pacts::GenerateSha config.base_equality_only_on_content_that_affects_verification_results = false - # TODO change this to true - config.order_versions_by_date = false + config.order_versions_by_date = true config.semver_formats = ["%M.%m.%p%s%d", "%M.%m", "%M"] config.webhook_retry_schedule = [10, 60, 120, 300, 600, 1200] #10 sec, 1 min, 2 min, 5 min, 10 min, 20 min => 38 minutes config.check_for_potential_duplicate_pacticipant_names = true diff --git a/spec/lib/pact_broker/pacts/pact_version_spec.rb b/spec/lib/pact_broker/pacts/pact_version_spec.rb index c38d26802..2dd57b797 100644 --- a/spec/lib/pact_broker/pacts/pact_version_spec.rb +++ b/spec/lib/pact_broker/pacts/pact_version_spec.rb @@ -70,6 +70,7 @@ module Pacts describe "#latest_consumer_version_number" do before do + PactBroker.configuration.order_versions_by_date = false builder = TestDataBuilder.new builder .create_consumer diff --git a/spec/lib/pact_broker/verifications/repository_spec.rb b/spec/lib/pact_broker/verifications/repository_spec.rb index 7e0f92dba..f20a02a7c 100644 --- a/spec/lib/pact_broker/verifications/repository_spec.rb +++ b/spec/lib/pact_broker/verifications/repository_spec.rb @@ -93,6 +93,7 @@ module Verifications context "when no tag is specified" do before do + PactBroker.configuration.order_versions_by_date = false TestDataBuilder.new .create_provider("Provider1") .create_consumer("Consumer1")