From a9b3fef0bc4429c1592c249c82312db4e904f228 Mon Sep 17 00:00:00 2001 From: Beth Skurrie Date: Tue, 24 Nov 2020 20:12:32 +1100 Subject: [PATCH] feat(wip): keep pacts as WIP when verified via the pactUrl passed though the webhook template parameters - experimental. To enable this feature set env var PACT_BROKER_FEATURES=experimental_webhook_wip --- lib/pact_broker/pacts/metadata.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/pact_broker/pacts/metadata.rb b/lib/pact_broker/pacts/metadata.rb index a5f469249..5fb6017a0 100644 --- a/lib/pact_broker/pacts/metadata.rb +++ b/lib/pact_broker/pacts/metadata.rb @@ -1,3 +1,5 @@ +require 'pact_broker/feature_toggle' + module PactBroker module Pacts module Metadata @@ -27,10 +29,12 @@ def build_metadata_for_latest_pact(pact, selection_parameters) # parameters. This is part of ensuring that verification results webhooks # go back to the correct consumer version number (eg for git statuses) def build_metadata_for_webhook_triggered_by_pact_publication(pact) - { + metadata = { consumer_version_number: pact.consumer_version_number, consumer_version_tags: pact.consumer_version_tag_names } + metadata[:wip] = "true" if PactBroker.feature_enabled?(:experimental_webhook_wip) + metadata end end end