Édouard Lopez
04/07/2022, 12:54 PMdetails
tab. But I would like to know how to populate the fields?
• Main branch
• Repository URL
Beth (pactflow.io/Pact Broker/pact-ruby)
Édouard Lopez
04/27/2022, 10:50 AMmake publish-contract
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: pact-broker publish was called with invalid arguments ["--repository-url"]
make: *** [Makefile:133: publish-contract] Error 1
Édouard Lopez
04/27/2022, 10:58 AM--repository-url
with the CLI https://github.com/pact-foundation/pact_broker-client/issues/106Matt (pactflow.io / pact-js / pact-go)
publish
command, I think you meant to use create-or-update-pacticipant
Édouard Lopez
04/27/2022, 11:39 AMcurl
despite a 200
curl \
--verbose \
--location \
--request PUT \
--header "Content-Type:application/json" \
--data '{"name": "ms.pact-consumer-example-for-go.b2b", "repositoryUrl": "<https://git.manomano.tech/qraft/contract-testing/pact-consumer-example-for-gofoo>", "mainBranch": "main"}' \
${PACT_BROKER_BASE_URL}/pacticipants/ms.pact-consumer-example-for-go.b2b
* Trying 10.192.103.176:80...
* TCP_NODELAY set
* Connected to <http://infra-pact-broker-web.support.manomano.com|infra-pact-broker-web.support.manomano.com> (10.192.103.176) port 80 (#0)
> PUT /pacticipants/ms.pact-consumer-example-for-go.b2b HTTP/1.1
> Host: <http://infra-pact-broker-web.support.manomano.com|infra-pact-broker-web.support.manomano.com>
> User-Agent: curl/7.68.0
> Accept: */*
> Content-Type:application/json
> Content-Length: 170
>
* upload completely sent off: 170 out of 170 bytes
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Date: Wed, 27 Apr 2022 11:32:35 GMT
< Content-Type: application/hal+json;charset=utf-8
< Content-Length: 1588
< Connection: keep-alive
< Vary: Accept
< X-Pact-Broker-Version: 2.93.2
< X-Content-Type-Options: nosniff
<
Response:
{
"repositoryUrl": "<https://git.manomano.tech/qraft/contract-testing/pact-consumer-example-for-gofoo>",
"mainBranch": "main",
"createdAt": "2022-04-27T11:32:35+00:00",
"_embedded": {
"labels": []
},
"_links": {
"self": {
"href": "<http://infra-pact-broker-web.support.manomano.com/pacticipants/>"
},
"pb:versions": {
"href": "<http://infra-pact-broker-web.support.manomano.com/pacticipants//versions>"
},
"pb:version": {
"title": "Get, create or delete a pacticipant version",
"href": "<http://infra-pact-broker-web.support.manomano.com/pacticipants//versions/{version}>",
"templated": true
},
"pb:version-tag": {
"title": "Get, create or delete a tag for a version of ",
"href": "<http://infra-pact-broker-web.support.manomano.com/pacticipants//versions/{version}/tags/{tag}>",
"templated": true
},
"pb:branch-version": {
"title": "Get or add/create a version for a branch of ",
"href": "<http://infra-pact-broker-web.support.manomano.com/pacticipants//branches/{branch}/versions/{version}>",
"templated": true
},
"pb:label": {
"title": "Get, create or delete a label for ",
"href": "http:/* Connection #0 to host <http://infra-pact-broker-web.support.manomano.com|infra-pact-broker-web.support.manomano.com> left intact /infra-pact-broker-web.support.manomano.com/pacticipants//labels/{label}",
"templated": true
},
"versions": {
"title": "Deprecated - use pb:versions",
"href": "<http://infra-pact-broker-web.support.manomano.com/pacticipants//versions>"
},
"pb:can-i-deploy-badge": {
"title": "Can I Deploy badge",
"href": "<http://infra-pact-broker-web.support.manomano.com/pacticipants//latest-version/{tag}/can-i-deploy/to/{environmentTag}/badge>",
"templated": true
},
"curies": [
{
"name": "pb",
"href": "<http://infra-pact-broker-web.support.manomano.com/doc/{rel}?context=pacticipant>",
"templated": true
}
]
}
}
Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
--verbose
to the CLI, you can see what it actually sent over the wire to compareMatt (pactflow.io / pact-js / pact-go)
PATCH
, it looks like that resource is a bit quirky with PUT
)Matt (pactflow.io / pact-js / pact-go)
POST
and will do the smarts to update if it existsÉdouard Lopez
04/27/2022, 3:35 PMPATCH
is working ✌️ ( POST
and PUT
don't)Beth (pactflow.io/Pact Broker/pact-ruby)
Matt (pactflow.io / pact-js / pact-go)
Beth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
Matt (pactflow.io / pact-js / pact-go)
PUT
Matt (pactflow.io / pact-js / pact-go)
PATCH
worked for him, because the pacticipant was created and then he needed to update itMatt (pactflow.io / pact-js / pact-go)
PATCH
would ultimately create the pacticipant anyway from my memory of looking at the code last night. There was a comment there to the effect of “this was a bad idea / I wish I hadn’t supported this” 😆Beth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)