pact-foundation/pact_broker-client

Setting --repository-url with CLI fails: ERROR: pact-broker publish was called with invalid arguments ["--repository-url"]

Closed this issue · 5 comments

related:: https://pact-foundation.slack.com/archives/C9VPNUJR2/p1649336098638089

env

  • OS: Description: Ubuntu 20.04.4 LTS
  • Docker image: pactfoundation/pact-cli latest 7cd291e43a44

Steps to reproduce

docker run \
	--rm \
	--workdir=${PWD} \
	--volume=${PWD}:${PWD} \
	--env=PACT_BROKER_BASE_URL \
	pactfoundation/pact-cli:latest \
		publish \
		${PWD}/contracts \
		--consumer-app-version da970bb \
		--tag-with-git-branch \
		--repository-url="https://git.foo.tech/qraft/contract-testing/pact-consumer-example-for-go" \
		--main-branch=main

Error

ERROR: pact-broker publish was called with invalid arguments ["--repository-url"]

Did you mean to call pact-broker create-or-update-pacticipant? The repository URL is for the pacticipant, not for the published contract (the pact file).

repository-url and main branch are attributes of the pacticipant, not the pact.

This is how you create a pacticipant with a repository URL and main branch:

docker run \
>   --rm \
>   --env=PACT_BROKER_BASE_URL \
>   --env=PACT_BROKER_TOKEN \
>   pactfoundation/pact-cli:latest \
>     broker create-or-update-pacticipant \
>     --name pact-consumer-example-for-go \
>     --repository-url="https://git.foo.tech/qraft/contract-testing/pact-consumer-example-for-go" \
>     --main-branch=main \
>     --verbose
opening connection to test.pactflow.io:443...
opened
starting SSL for test.pactflow.io:443...
SSL established, protocol: TLSv1.2, cipher: ECDHE-RSA-AES128-GCM-SHA256
<- "GET /? HTTP/1.1\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: application/hal+json\r\nUser-Agent: Ruby\r\nAuthorization: [redacted]\r\n"
-> "HTTP/1.1 200 OK\r\n"
-> "Date: Wed, 27 Apr 2022 23:16:57 GMT\r\n"
-> "Content-Type: application/hal+json;charset=utf-8\r\n"
-> "Content-Length: 5690\r\n"
-> "Connection: keep-alive\r\n"
-> "Vary: Accept\r\n"
-> "Server: Webmachine-Ruby/1.6.0 Rack/1.3\r\n"
-> "X-Pact-Broker-Version: 2.98.0\r\n"
-> "X-Pact-Broker-Git-Sha: e0c525cf\r\n"
-> "X-Pactflow-Git-Sha: 0a836228e\r\n"
-> "X-Content-Type-Options: nosniff\r\n"
-> "Strict-Transport-Security: max-age=63072000; includeSubDomains; preload\r\n"
-> "X-Request-Id: bf75539ab754e2b1648d9cc01eaf5f1f\r\n"
-> "\r\n"
reading 5690 bytes...
-> "{\"_links\":{\"self\":{\"href\":\"https://test.pactflow.io\",\"title\":\"Index\",\"templated\":false},\"pb:publish-pact\":{\"href\":\"https://test.pactflow.io/pacts/provider/{provider}/consumer/{consumer}/version/{consumerApplicationVersion}\",\"title\":\"Publish a pact\",\"templated\":true},\"pb:publish-contracts\":{\"href\":\"https://test.pactflow.io/contracts/publish\",\"title\":\"Publish contracts\",\"templated\":false},\"pb:latest-pact-versions\":{\"href\":\"https://test.pactflow.io/pacts/latest\",\"title\":\"Latest pact versions\",\"templated\":false},\"pb:tagged-pact-versions\":{\"href\":\"https://test.pactflow.io/pacts/provider/{provider}/consumer/{consumer}/tag/{tag}\",\"title\":\"All versions of a pact for a given consumer, provider and consumer version tag\",\"templated\":false},\"pb:pacticipants\":{\"href\":\"https://test.pactflow.io/pacticipants\",\"title\":\"Pacticipants\",\"templated\":false},\"pb:pacticipant\":{\"href\":\"https://test.pactflow.io/pacticipants/{pacticipant}\",\"title\":\"Fetch pacticipant by name\",\"templated\":true},\"pb:latest-provider-pacts\":{\"href\":\"https://test.pactflow.io/pacts/provider/{provider}/latest\",\"title\":\"Latest pacts by provider\",\"templated\":true},\"pb:latest-provider-pacts-with-tag\":{\"href\":\"https://test.pactflow.io/pacts/provider/{provider}/latest/{tag}\",\"title\":\"Latest pacts for provider with the specified tag\",\"templated\":true},\"pb:provider-pacts-with-tag\":{\"href\":\"https://test.pactflow.io/pacts/provider/{provider}/tag/{tag}\",\"title\":\"All pact versions for the provider with the specified consumer version tag\",\"templated\":true},\"pb:provider-pacts\":{\"href\":\"https://test.pactflow.io/pacts/provider/{provider}\",\"title\":\"All pact versions for the specified provider\",\"templated\":true},\"pb:latest-version\":{\"href\":\"https://test.pactflow.io/pacticipants/{pacticipant}/latest-version\",\"title\":\"Latest pacticipant version\",\"templated\":true},\"pb:latest-tagged-version\":{\"href\":\"https://test.pactflow.io/pacticipants/{pacticipant}/latest-version/{tag}\",\"title\":\"Latest pacticipant version with the specified tag\",\"templated\":true},\"pb:webhooks\":{\"href\":\"https://test.pactflow.io/webhooks\",\"title\":\"Webhooks\",\"templated\":false},\"pb:webhook\":{\"href\":\"https://test.pactflow.io/webhooks/{uuid}\",\"title\":\"Webhook\",\"templated\":true},\"pb:integrations\":{\"href\":\"https://test.pactflow.io/integrations\",\"title\":\"Integrations\",\"templated\":false},\"pb:pacticipant-version-tag\":{\"href\":\"https://test.pactflow.io/pacticipants/{pacticipant}/versions/{version}/tags/{tag}\",\"title\":\"Get, create or delete a tag for a pacticipant version\",\"templated\":true},\"pb:pacticipant-branch-version\":{\"href\":\"https://test.pactflow.io/pacticipants/{pacticipant}/branches/{branch}/versions/{version}\",\"title\":\"Get or add/create a pacticipant version for a branch\",\"templated\":true},\"pb:pacticipant-version\":{\"href\":\"https://test.pactflow.io/pacticipants/{pacticipant}/versions/{version}\",\"title\":\"Get, create or delete a pacticipant version\",\"templated\":true},\"pb:metrics\":{\"href\":\"https://test.pactflow.io/metrics\",\"title\":\"Get Pact Broker metrics\"},\"pb:can-i-deploy-pacticipant-version-to-tag\":{\"href\":\"https://test.pactflow.io/can-i-deploy?pacticipant={pacticipant}\\u0026version={version}\\u0026to={tag}\",\"title\":\"Determine if an application version can be safely deployed to an environment identified by the given tag\",\"templated\":true},\"pb:can-i-deploy-pacticipant-version-to-environment\":{\"href\":\"https://test.pactflow.io/can-i-deploy?pacticipant={pacticipant}\\u0026version={version}\\u0026environment={environment}\",\"title\":\"Determine if an application version can be safely deployed to an environment\",\"templated\":true},\"pb:provider-pacts-for-verification\":{\"href\":\"https://test.pactflow.io/pacts/provider/{provider}/for-verification\",\"title\":\"Pact versions to be verified for the specified provider\",\"templated\":true},\"beta:provider-pacts-for-verification\":{\"name\":\"beta\",\"href\":\"https://test.pactflow.io/pacts/provider/{provider}/for-verification\",\"title\":\"DEPRECATED - please use pb:provider-pacts-for-verification\",\"templated\":true},\"curies\":[{\"name\":\"pb\",\"href\":\"https://test.pactflow.io/doc/{rel}?context=index\",\"templated\":true},{\"name\":\"beta\",\"href\":\"https://test.pactflow.io/doc/{rel}?context=index\",\"templated\":true}],\"pb:environments\":{\"title\":\"Environments\",\"href\":\"https://test.pactflow.io/environments\",\"templated\":false},\"pb:environment\":{\"title\":\"Environment\",\"href\":\"https://test.pactflow.io/environments/{uuid}\",\"templated\":true},\"pb:api-tokens\":{\"href\":\"https://test.pactflow.io/settings/tokens\",\"title\":\"API tokens\",\"templated\":false},\"pb:audit\":{\"href\":\"https://test.pactflow.io/audit\",\"title\":\"Audit trail\",\"templated\":false},\"pb:secrets\":{\"href\":\"https://test.pactflow.io/secrets\",\"title\":\"Secrets\",\"templated\":false},\"pf:admin-users\":{\"href\":\"https://test.pactflow.io/admin/users\",\"title\":\"Users\",\"templated\":false},\"pf:admin-teams\":{\"href\":\"https://test.pactflow.io/admin/teams\",\"title\":\"Teams\",\"templated\":false},\"pf:admin-system-accounts\":{\"href\":\"https://test.pactflow.io/admin/system-accounts\",\"title\":\"System accounts\",\"templated\":false},\"pf:admin-roles\":{\"href\":\"https://test.pactflow.io/admin/roles\",\"title\":\"Roles\",\"templated\":false},\"pf:admin-permissions\":{\"href\":\"https://test.pactflow.io/admin/permissions\",\"title\":\"Permissions\",\"templated\":false},\"pf:user-allocations\":{\"href\":\"https://test.pactflow.io/tenant/limits\",\"title\":\"User Allocations\",\"templated\":false}}}"
read 5690 bytes
Conn keep-alive
opening connection to test.pactflow.io:443...
opened
starting SSL for test.pactflow.io:443...
SSL established, protocol: TLSv1.2, cipher: ECDHE-RSA-AES128-GCM-SHA256
<- "GET /pacticipants/pact-consumer-example-for-go? HTTP/1.1\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: application/hal+json\r\nUser-Agent: Ruby\r\nAuthorization: [redacted]\r\n"
-> "HTTP/1.1 404 Not Found\r\n"
-> "Date: Wed, 27 Apr 2022 23:16:57 GMT\r\n"
-> "Content-Type: application/hal+json;charset=utf-8\r\n"
-> "Content-Length: 73\r\n"
-> "Connection: keep-alive\r\n"
-> "Vary: Accept\r\n"
-> "Server: Webmachine-Ruby/1.6.0 Rack/1.3\r\n"
-> "X-Pact-Broker-Version: 2.98.0\r\n"
-> "X-Pact-Broker-Git-Sha: e0c525cf\r\n"
-> "X-Pactflow-Git-Sha: 0a836228e\r\n"
-> "X-Content-Type-Options: nosniff\r\n"
-> "Strict-Transport-Security: max-age=63072000; includeSubDomains; preload\r\n"
-> "X-Request-Id: 83f8db6e73692240158b35e2676b8efa\r\n"
-> "\r\n"
reading 73 bytes...
-> "{\"error\":\"No pacticipant with name 'pact-consumer-example-for-go' found\"}"
read 73 bytes
Conn keep-alive
opening connection to test.pactflow.io:443...
opened
starting SSL for test.pactflow.io:443...
SSL established, protocol: TLSv1.2, cipher: ECDHE-RSA-AES128-GCM-SHA256
<- "POST /pacticipants HTTP/1.1\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: application/hal+json\r\nUser-Agent: Ruby\r\nContent-Type: application/json\r\nAuthorization: [redacted]\r\n"
<- "{\"name\":\"pact-consumer-example-for-go\",\"repositoryUrl\":\"https://git.foo.tech/qraft/contract-testing/pact-consumer-example-for-go\",\"mainBranch\":\"main\"}"
-> "HTTP/1.1 201 Created\r\n"
-> "Date: Wed, 27 Apr 2022 23:16:57 GMT\r\n"
-> "Content-Type: application/hal+json;charset=utf-8\r\n"
-> "Content-Length: 2171\r\n"
-> "Connection: keep-alive\r\n"
-> "Vary: Accept\r\n"
-> "Location: https://test.pactflow.io/pacticpants/pact-consumer-example-for-go\r\n"
-> "Server: Webmachine-Ruby/1.6.0 Rack/1.3\r\n"
-> "X-Pact-Broker-Version: 2.98.0\r\n"
-> "X-Pact-Broker-Git-Sha: e0c525cf\r\n"
-> "X-Pactflow-Git-Sha: 0a836228e\r\n"
-> "X-Content-Type-Options: nosniff\r\n"
-> "Strict-Transport-Security: max-age=63072000; includeSubDomains; preload\r\n"
-> "X-Request-Id: b7e4a935785b3c0507f7543bd7482d30\r\n"
-> "\r\n"
reading 2171 bytes...
-> "{\"name\":\"pact-consumer-example-for-go\",\"displayName\":\"Pact Consumer Example For Go\",\"repositoryUrl\":\"https://git.foo.tech/qraft/contract-testing/pact-consumer-example-for-go\",\"mainBranch\":\"main\",\"createdAt\":\"2022-04-27T23:16:57+00:00\",\"_embedded\":{\"labels\":[]},\"_links\":{\"self\":{\"href\":\"https://test.pactflow.io/pacticipants/pact-consumer-example-for-go\"},\"pb:versions\":{\"href\":\"https://test.pactflow.io/pacticipants/pact-consumer-example-for-go/versions\"},\"pb:version\":{\"title\":\"Get, create or delete a pacticipant version\",\"href\":\"https://test.pactflow.io/pacticipants/pact-consumer-example-for-go/versions/{version}\",\"templated\":true},\"pb:version-tag\":{\"title\":\"Get, create or delete a tag for a version of pact-consumer-example-for-go\",\"href\":\"https://test.pactflow.io/pacticipants/pact-consumer-example-for-go/versions/{version}/tags/{tag}\",\"templated\":true},\"pb:branch-version\":{\"title\":\"Get or add/create a version for a branch of pact-consumer-example-for-go\",\"href\":\"https://test.pactflow.io/pacticipants/pact-consumer-example-for-go/branches/{branch}/versions/{version}\",\"templated\":true},\"pb:label\":{\"title\":\"Get, create or delete a label for pact-consumer-example-for-go\",\"href\":\"https://test.pactflow.io/pacticipants/pact-consumer-example-for-go/labels/{label}\",\"templated\":true},\"versions\":{\"title\":\"Deprecated - use pb:versions\",\"href\":\"https://test.pactflow.io/pacticipants/pact-consumer-example-for-go/versions\"},\"pb:can-i-deploy-badge\":{\"title\":\"Can I Deploy pact-consumer-example-for-go badge\",\"href\":\"https://test.pactflow.io/pacticipants/pact-consumer-example-for-go/latest-version/{tag}/can-i-deploy/to/{environmentTag}/badge\",\"templated\":true},\"pb:can-i-deploy-branch-to-environment-badge\":{\"title\":\"Can I Deploy pact-consumer-example-for-go from branch to environment badge\",\"href\":\"https://test.pactflow.io/pacticipants/pact-consumer-example-for-go/branches/{branch}/latest-version/can-i-deploy/to-environment/{environment}/badge\",\"templated\":true},\"curies\":[{\"name\":\"pb\",\"href\":\"https://test.pactflow.io/doc/{rel}?context=pacticipant\",\"templated\":true}]}}"

And to update:

docker run \
>   --rm \
>   --env=PACT_BROKER_BASE_URL \
>   --env=PACT_BROKER_TOKEN \
>   pactfoundation/pact-cli:latest \
>     broker create-or-update-pacticipant \
>     --name pact-consumer-example-for-go \
>     --repository-url="https://git.foo.tech/qraft/contract-testing/pact-consumer-example-for-go-UPDATED" \
>     --main-branch=main \
>     --verbose

opening connection to test.pactflow.io:443...
opened
starting SSL for test.pactflow.io:443...
SSL established, protocol: TLSv1.2, cipher: ECDHE-RSA-AES128-GCM-SHA256
<- "GET /? HTTP/1.1\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: application/hal+json\r\nUser-Agent: Ruby\r\nAuthorization: [redacted]\r\n"
-> "HTTP/1.1 200 OK\r\n"
-> "Date: Wed, 27 Apr 2022 23:23:45 GMT\r\n"
-> "Content-Type: application/hal+json;charset=utf-8\r\n"
-> "Content-Length: 5690\r\n"
-> "Connection: keep-alive\r\n"
-> "Vary: Accept\r\n"
-> "Server: Webmachine-Ruby/1.6.0 Rack/1.3\r\n"
-> "X-Pact-Broker-Version: 2.98.0\r\n"
-> "X-Pact-Broker-Git-Sha: e0c525cf\r\n"
-> "X-Pactflow-Git-Sha: 0a836228e\r\n"
-> "X-Content-Type-Options: nosniff\r\n"
-> "Strict-Transport-Security: max-age=63072000; includeSubDomains; preload\r\n"
-> "X-Request-Id: 7ca11f9dc00a0c670a1aabd7af2b539d\r\n"
-> "\r\n"
reading 5690 bytes...
-> "{\"_links\":{\"self\":{\"href\":\"https://test.pactflow.io\",\"title\":\"Index\",\"templated\":false},\"pb:publish-pact\":{\"href\":\"https://test.pactflow.io/pacts/provider/{provider}/consumer/{consumer}/version/{consumerApplicationVersion}\",\"title\":\"Publish a pact\",\"templated\":true},\"pb:publish-contracts\":{\"href\":\"https://test.pactflow.io/contracts/publish\",\"title\":\"Publish contracts\",\"templated\":false},\"pb:latest-pact-versions\":{\"href\":\"https://test.pactflow.io/pacts/latest\",\"title\":\"Latest pact versions\",\"templated\":false},\"pb:tagged-pact-versions\":{\"href\":\"https://test.pactflow.io/pacts/provider/{provider}/consumer/{consumer}/tag/{tag}\",\"title\":\"All versions of a pact for a given consumer, provider and consumer version tag\",\"templated\":false},\"pb:pacticipants\":{\"href\":\"https://test.pactflow.io/pacticipants\",\"title\":\"Pacticipants\",\"templated\":false},\"pb:pacticipant\":{\"href\":\"https://test.pactflow.io/pacticipants/{pacticipant}\",\"title\":\"Fetch pacticipant by name\",\"templated\":true},\"pb:latest-provider-pacts\":{\"href\":\"https://test.pactflow.io/pacts/provider/{provider}/latest\",\"title\":\"Latest pacts by provider\",\"templated\":true},\"pb:latest-provider-pacts-with-tag\":{\"href\":\"https://test.pactflow.io/pacts/provider/{provider}/latest/{tag}\",\"title\":\"Latest pacts for provider with the specified tag\",\"templated\":true},\"pb:provider-pacts-with-tag\":{\"href\":\"https://test.pactflow.io/pacts/provider/{provider}/tag/{tag}\",\"title\":\"All pact versions for the provider with the specified consumer version tag\",\"templated\":true},\"pb:provider-pacts\":{\"href\":\"https://test.pactflow.io/pacts/provider/{provider}\",\"title\":\"All pact versions for the specified provider\",\"templated\":true},\"pb:latest-version\":{\"href\":\"https://test.pactflow.io/pacticipants/{pacticipant}/latest-version\",\"title\":\"Latest pacticipant version\",\"templated\":true},\"pb:latest-tagged-version\":{\"href\":\"https://test.pactflow.io/pacticipants/{pacticipant}/latest-version/{tag}\",\"title\":\"Latest pacticipant version with the specified tag\",\"templated\":true},\"pb:webhooks\":{\"href\":\"https://test.pactflow.io/webhooks\",\"title\":\"Webhooks\",\"templated\":false},\"pb:webhook\":{\"href\":\"https://test.pactflow.io/webhooks/{uuid}\",\"title\":\"Webhook\",\"templated\":true},\"pb:integrations\":{\"href\":\"https://test.pactflow.io/integrations\",\"title\":\"Integrations\",\"templated\":false},\"pb:pacticipant-version-tag\":{\"href\":\"https://test.pactflow.io/pacticipants/{pacticipant}/versions/{version}/tags/{tag}\",\"title\":\"Get, create or delete a tag for a pacticipant version\",\"templated\":true},\"pb:pacticipant-branch-version\":{\"href\":\"https://test.pactflow.io/pacticipants/{pacticipant}/branches/{branch}/versions/{version}\",\"title\":\"Get or add/create a pacticipant version for a branch\",\"templated\":true},\"pb:pacticipant-version\":{\"href\":\"https://test.pactflow.io/pacticipants/{pacticipant}/versions/{version}\",\"title\":\"Get, create or delete a pacticipant version\",\"templated\":true},\"pb:metrics\":{\"href\":\"https://test.pactflow.io/metrics\",\"title\":\"Get Pact Broker metrics\"},\"pb:can-i-deploy-pacticipant-version-to-tag\":{\"href\":\"https://test.pactflow.io/can-i-deploy?pacticipant={pacticipant}\\u0026version={version}\\u0026to={tag}\",\"title\":\"Determine if an application version can be safely deployed to an environment identified by the given tag\",\"templated\":true},\"pb:can-i-deploy-pacticipant-version-to-environment\":{\"href\":\"https://test.pactflow.io/can-i-deploy?pacticipant={pacticipant}\\u0026version={version}\\u0026environment={environment}\",\"title\":\"Determine if an application version can be safely deployed to an environment\",\"templated\":true},\"pb:provider-pacts-for-verification\":{\"href\":\"https://test.pactflow.io/pacts/provider/{provider}/for-verification\",\"title\":\"Pact versions to be verified for the specified provider\",\"templated\":true},\"beta:provider-pacts-for-verification\":{\"name\":\"beta\",\"href\":\"https://test.pactflow.io/pacts/provider/{provider}/for-verification\",\"title\":\"DEPRECATED - please use pb:provider-pacts-for-verification\",\"templated\":true},\"curies\":[{\"name\":\"pb\",\"href\":\"https://test.pactflow.io/doc/{rel}?context=index\",\"templated\":true},{\"name\":\"beta\",\"href\":\"https://test.pactflow.io/doc/{rel}?context=index\",\"templated\":true}],\"pb:environments\":{\"title\":\"Environments\",\"href\":\"https://test.pactflow.io/environments\",\"templated\":false},\"pb:environment\":{\"title\":\"Environment\",\"href\":\"https://test.pactflow.io/environments/{uuid}\",\"templated\":true},\"pb:api-tokens\":{\"href\":\"https://test.pactflow.io/settings/tokens\",\"title\":\"API tokens\",\"templated\":false},\"pb:audit\":{\"href\":\"https://test.pactflow.io/audit\",\"title\":\"Audit trail\",\"templated\":false},\"pb:secrets\":{\"href\":\"https://test.pactflow.io/secrets\",\"title\":\"Secrets\",\"templated\":false},\"pf:admin-users\":{\"href\":\"https://test.pactflow.io/admin/users\",\"title\":\"Users\",\"templated\":false},\"pf:admin-teams\":{\"href\":\"https://test.pactflow.io/admin/teams\",\"title\":\"Teams\",\"templated\":false},\"pf:admin-system-accounts\":{\"href\":\"https://test.pactflow.io/admin/system-accounts\",\"title\":\"System accounts\",\"templated\":false},\"pf:admin-roles\":{\"href\":\"https://test.pactflow.io/admin/roles\",\"title\":\"Roles\",\"templated\":false},\"pf:admin-permissions\":{\"href\":\"https://test.pactflow.io/admin/permissions\",\"title\":\"Permissions\",\"templated\":false},\"pf:user-allocations\":{\"href\":\"https://test.pactflow.io/tenant/limits\",\"title\":\"User Allocations\",\"templated\":false}}}"
read 5690 bytes
Conn keep-alive
opening connection to test.pactflow.io:443...
opened
starting SSL for test.pactflow.io:443...
SSL established, protocol: TLSv1.2, cipher: ECDHE-RSA-AES128-GCM-SHA256
<- "GET /pacticipants/pact-consumer-example-for-go? HTTP/1.1\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: application/hal+json\r\nUser-Agent: Ruby\r\nAuthorization: [redacted]\r\n"
-> "HTTP/1.1 200 OK\r\n"
-> "Date: Wed, 27 Apr 2022 23:23:45 GMT\r\n"
-> "Content-Type: application/hal+json;charset=utf-8\r\n"
-> "Content-Length: 2171\r\n"
-> "Connection: keep-alive\r\n"
-> "Vary: Accept\r\n"
-> "Server: Webmachine-Ruby/1.6.0 Rack/1.3\r\n"
-> "X-Pact-Broker-Version: 2.98.0\r\n"
-> "X-Pact-Broker-Git-Sha: e0c525cf\r\n"
-> "X-Pactflow-Git-Sha: 0a836228e\r\n"
-> "X-Content-Type-Options: nosniff\r\n"
-> "Strict-Transport-Security: max-age=63072000; includeSubDomains; preload\r\n"
-> "X-Request-Id: 17b61edd6917f95fd5b7eb11f1dc5909\r\n"
-> "\r\n"
reading 2171 bytes...
-> "{\"name\":\"pact-consumer-example-for-go\",\"displayName\":\"Pact Consumer Example For Go\",\"repositoryUrl\":\"https://git.foo.tech/qraft/contract-testing/pact-consumer-example-for-go\",\"mainBranch\":\"main\",\"createdAt\":\"2022-04-27T23:16:57+00:00\",\"_embedded\":{\"labels\":[]},\"_links\":{\"self\":{\"href\":\"https://test.pactflow.io/pacticipants/pact-consumer-example-for-go\"},\"pb:versions\":{\"href\":\"https://test.pactflow.io/pacticipants/pact-consumer-example-for-go/versions\"},\"pb:version\":{\"title\":\"Get, create or delete a pacticipant version\",\"href\":\"https://test.pactflow.io/pacticipants/pact-consumer-example-for-go/versions/{version}\",\"templated\":true},\"pb:version-tag\":{\"title\":\"Get, create or delete a tag for a version of pact-consumer-example-for-go\",\"href\":\"https://test.pactflow.io/pacticipants/pact-consumer-example-for-go/versions/{version}/tags/{tag}\",\"templated\":true},\"pb:branch-version\":{\"title\":\"Get or add/create a version for a branch of pact-consumer-example-for-go\",\"href\":\"https://test.pactflow.io/pacticipants/pact-consumer-example-for-go/branches/{branch}/versions/{version}\",\"templated\":true},\"pb:label\":{\"title\":\"Get, create or delete a label for pact-consumer-example-for-go\",\"href\":\"https://test.pactflow.io/pacticipants/pact-consumer-example-for-go/labels/{label}\",\"templated\":true},\"versions\":{\"title\":\"Deprecated - use pb:versions\",\"href\":\"https://test.pactflow.io/pacticipants/pact-consumer-example-for-go/versions\"},\"pb:can-i-deploy-badge\":{\"title\":\"Can I Deploy pact-consumer-example-for-go badge\",\"href\":\"https://test.pactflow.io/pacticipants/pact-consumer-example-for-go/latest-version/{tag}/can-i-deploy/to/{environmentTag}/badge\",\"templated\":true},\"pb:can-i-deploy-branch-to-environment-badge\":{\"title\":\"Can I Deploy pact-consumer-example-for-go from branch to environment badge\",\"href\":\"https://test.pactflow.io/pacticipants/pact-consumer-example-for-go/branches/{branch}/latest-version/can-i-deploy/to-environment/{environment}/badge\",\"templated\":true},\"curies\":[{\"name\":\"pb\",\"href\":\"https://test.pactflow.io/doc/{rel}?context=pacticipant\",\"templated\":true}]}}"
read 2171 bytes
Conn keep-alive
opening connection to test.pactflow.io:443...
opened
starting SSL for test.pactflow.io:443...
SSL established, protocol: TLSv1.2, cipher: ECDHE-RSA-AES128-GCM-SHA256
<- "PATCH /pacticipants/pact-consumer-example-for-go HTTP/1.1\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: application/hal+json\r\nUser-Agent: Ruby\r\nContent-Type: application/json\r\nAuthorization: [redacted]\r\n"
<- "{\"name\":\"pact-consumer-example-for-go\",\"repositoryUrl\":\"https://git.foo.tech/qraft/contract-testing/pact-consumer-example-for-go-UPDATED\",\"mainBranch\":\"main\"}"
-> "HTTP/1.1 200 OK\r\n"
-> "Date: Wed, 27 Apr 2022 23:23:46 GMT\r\n"
-> "Content-Type: application/hal+json;charset=utf-8\r\n"
-> "Content-Length: 2219\r\n"
-> "Connection: keep-alive\r\n"
-> "Vary: Accept\r\n"
-> "Server: Webmachine-Ruby/1.6.0 Rack/1.3\r\n"
-> "X-Pact-Broker-Version: 2.98.0\r\n"
-> "X-Pact-Broker-Git-Sha: e0c525cf\r\n"
-> "X-Pactflow-Git-Sha: 0a836228e\r\n"
-> "X-Content-Type-Options: nosniff\r\n"
-> "Strict-Transport-Security: max-age=63072000; includeSubDomains; preload\r\n"
-> "X-Request-Id: 2a4430fdaa72a8ace41509eb7e7e20b3\r\n"
-> "\r\n"
reading 2219 bytes...
-> "{\"name\":\"pact-consumer-example-for-go\",\"displayName\":\"Pact Consumer Example For Go\",\"repositoryUrl\":\"https://git.foo.tech/qraft/contract-testing/pact-consumer-example-for-go-UPDATED\",\"mainBranch\":\"main\",\"updatedAt\":\"2022-04-27T23:23:46+00:00\",\"createdAt\":\"2022-04-27T23:16:57+00:00\",\"_embedded\":{\"labels\":[]},\"_links\":{\"self\":{\"href\":\"https://test.pactflow.io/pacticipants/pact-consumer-example-for-go\"},\"pb:versions\":{\"href\":\"https://test.pactflow.io/pacticipants/pact-consumer-example-for-go/versions\"},\"pb:version\":{\"title\":\"Get, create or delete a pacticipant version\",\"href\":\"https://test.pactflow.io/pacticipants/pact-consumer-example-for-go/versions/{version}\",\"templated\":true},\"pb:version-tag\":{\"title\":\"Get, create or delete a tag for a version of pact-consumer-example-for-go\",\"href\":\"https://test.pactflow.io/pacticipants/pact-consumer-example-for-go/versions/{version}/tags/{tag}\",\"templated\":true},\"pb:branch-version\":{\"title\":\"Get or add/create a version for a branch of pact-consumer-example-for-go\",\"href\":\"https://test.pactflow.io/pacticipants/pact-consumer-example-for-go/branches/{branch}/versions/{version}\",\"templated\":true},\"pb:label\":{\"title\":\"Get, create or delete a label for pact-consumer-example-for-go\",\"href\":\"https://test.pactflow.io/pacticipants/pact-consumer-example-for-go/labels/{label}\",\"templated\":true},\"versions\":{\"title\":\"Deprecated - use pb:versions\",\"href\":\"https://test.pactflow.io/pacticipants/pact-consumer-example-for-go/versions\"},\"pb:can-i-deploy-badge\":{\"title\":\"Can I Deploy pact-consumer-example-for-go badge\",\"href\":\"https://test.pactflow.io/pacticipants/pact-consumer-example-for-go/latest-version/{tag}/can-i-deploy/to/{environmentTag}/badge\",\"templated\":true},\"pb:can-i-deploy-branch-to-environment-badge\":{\"title\":\"Can I Deploy pact-consumer-example-for-go from branch to environment badge\",\"href\":\"https://test.pactflow.io/pacticipants/pact-consumer-example-for-go/branches/{branch}/latest-version/can-i-deploy/to-environment/{environment}/badge\",\"templated\":true},\"curies\":[{\"name\":\"pb\",\"href\":\"https://test.pactflow.io/doc/{rel}?context=pacticipant\",\"templated\":true}]}}"
read 2219 bytes
Conn keep-alive
Pacticipant "pact-consumer-example-for-go" updated in Pactflow

Thanks @bethesque for your feedback on slack,
After exploring with the container approach, I went for a curl request as a more light way solution. Here is the make target I use :

Code

PACT_REPO_URL=https://$(shell git remote get-url origin | sed -e  's/git@//' -e 's/:/\//' -e 's/.git//')
PACT_REPO_MAIN_BRANCH=$(shell git rev-parse --abbrev-ref origin/HEAD | cut -c8-)
set-contract-metadata: 
	curl \
		--verbose \
		--location \
		--request PATCH \
		--header "Content-Type:application/json" \
		--data '{"repositoryUrl": "${PACT_REPO_URL}", "mainBranch": "${PACT_REPO_MAIN_BRANCH}"}' \
		$${PACT_BROKER_BASE_URL}/pacticipants/$${CONSUMER_NAME}

Usage

export CONSUMER_NAME=ms.pact-consumer-example-for-go.b2b
make set-contract-metadata

Nice.