Skip to content

Commit

Permalink
feat: enable use of the new 'all in one' contracts publishing endpoin…
Browse files Browse the repository at this point in the history
…t without a feature toggle
  • Loading branch information
bethesque committed Sep 21, 2021
1 parent 4f311ea commit 6850ace
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
strategy:
fail-fast: false
matrix:
feature: ["", "publish_contracts"]
feature: [""]
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
Expand Down
2 changes: 1 addition & 1 deletion lib/pact_broker/client/publish_pacts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def initialize pact_broker_base_url, pact_file_paths, consumer_version_params, o

def call
validate
if ENV.fetch("PACT_BROKER_FEATURES", "").include?("publish_contracts") && index_resource.can?("pb:publish-contracts")
if index_resource.can?("pb:publish-contracts")
publish_pacts
PactBroker::Client::CommandResult.new(success?, message)
else
Expand Down
2 changes: 1 addition & 1 deletion script/publish-pact.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ bundle exec bin/pact-broker create-or-update-webhook http://localhost:9393 \
# --contract-published


PACT_BROKER_FEATURES=publish_contracts bundle exec bin/pact-broker publish spec/pacts/pact_broker_client-pact_broker.json \
bundle exec bin/pact-broker publish spec/pacts/pact_broker_client-pact_broker.json \
--consumer-app-version 1.2.26 \
--broker-base-url http://localhost:9292 \
--broker-token localhost \
Expand Down
4 changes: 1 addition & 3 deletions spec/service_providers/publish_pacts_spec.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
require 'pact_broker/client/publish_pacts'
require 'service_providers/pact_helper'

publish_contracts_feature_on = ENV.fetch('PACT_BROKER_FEATURES', '').include?("publish_contracts")

RSpec.describe "publishing contracts", pact: true, skip: !publish_contracts_feature_on do
RSpec.describe "publishing contracts", pact: true do
before do
allow_any_instance_of(PactBroker::Client::Hal::HttpClient).to receive(:sleep)
allow_any_instance_of(PactBroker::Client::Hal::HttpClient).to receive(:default_max_tries).and_return(1)
Expand Down

0 comments on commit 6850ace

Please sign in to comment.