Hi! I’m trying to publish non-pact contracts to th...
# pact-broker
t
Hi! I’m trying to publish non-pact contracts to the broker - but the broker CLI is exploding instead of succeeding:
Copy code
$ npx pact-broker publish case-contracts --consumer-app-version=0.0.2 --broker-base-url=<https://timothyjones.pactflow.io/> --broker-token=$CASE_PACTFLOW_CI_TOKEN

/Users/home/office/maintainer/case/node_modules/@pact-foundation/pact-core/standalone/darwin-1.91.0/pact/lib/vendor/ruby/2.4.0/gems/pact_broker-client-1.65.0/lib/pact_broker/client/pact_hash.rb:11:in `consumer_name': undefined method `[]' for nil:NilClass (NoMethodError)
	from /Users/home/office/maintainer/case/node_modules/@pact-foundation/pact-core/standalone/darwin-1.91.0/pact/lib/vendor/ruby/2.4.0/gems/pact_broker-client-1.65.0/lib/pact_broker/client/pact_file.rb:20:in `consumer_name'
	from /Users/home/office/maintainer/case/node_modules/@pact-foundation/pact-core/standalone/darwin-1.91.0/pact/lib/vendor/ruby/2.4.0/gems/rake-13.0.6/lib/rake/file_list.rb:70:in `collect'
	from /Users/home/office/maintainer/case/node_modules/@pact-foundation/pact-core/standalone/darwin-1.91.0/pact/lib/vendor/ruby/2.4.0/gems/rake-13.0.6/lib/rake/file_list.rb:70:in `collect'
I was able to work around this by adding
consumer: { name: "consumer name here" }
and
provider: { name: "provider name here" }
to the contract - what other assumptions does the broker make?
m
I think that is just the CLI but not the broker that makes that assumption
I'm pretty sure, mostly sure, that's true
t
Awesome!
b
yup - that CLI is specifically for publishing pacts.
not generic contracts
t
Aha! Cool. I’ll make a generic client