Hi. So, I'm finally able to try and test the fix f...
# pact-broker
p
Hi. So, I'm finally able to try and test the fix for github.com/pact-foundation/pact_broker/issues/903 . It is hopefully fixed in github.com/pact-foundation/pact_broker/…/v2.120.0 . However, the latest docker version available looks to be 2.119 hub.docker.com/r/pactfoundation/pact-broker/tags Is this right, or should there be a 2.120 release available in docker hub?
y
yes looks like a race condition between publishing gem, triggering gem update in docker repo and it not having the new gem in its index yet. have triggered again
thankyou 1
p
Thank you!
Ace,
x-pact-broker-version: 2.120.0
. Will re-perform my test first thing in the morning.
thankyou 1
m
Ah, thanks Yousaf
p
So, unfortunately, it still doesn't seem to be working correctly. I have this matrix that states that 0.0.1 consumer + provider are released to prod. and 0.0.2 provider is also released to prod. Finally, it states that 0.0.2 consumer is compatible only with 0.0.1 provider, and as 0.0.1 provider is still released to deploy, can I release should state no.
However...
Copy code
xxx@localhost broker % ./can_i_deploy_consumer_0.0.2.sh
Computer says yes \o/

CONSUMER | C.VERSION      | PROVIDER | P.VERSION      | SUCCESS? | RESULT#
---------|----------------|----------|----------------|----------|--------
consumer | 0.0.2-SNAPSHOT | provider | 0.0.2-SNAPSHOT | true     | 1

VERIFICATION RESULTS
--------------------
1. <http://host.containers.internal:9292/pacts/provider/provider/consumer/consumer/pact-version/a3bb2b57270f3b8c13e7ad81d8b03d9189bdc5a5/metadata/Y3ZuPTAuMC4yLVNOQVBTSE9U/verification-results/132> (success)
It seems to ignore that 0.0.1 provider is still deployed
y
what version of the cli are you running? can you capture the matrix call in verbose mode which will show what was sent to the broker in the query, and the arguments passed in the command. Feel free to omit anything else Is it possible to create a reproducer in the pact-broker-docker repo at some point?
p
Copy code
./version.sh
1.5.0
verbose mode? This is the actual command issued.
Copy code
xxx@xxxx broker % podman run --rm \
    -e PACT_BROKER_BASE_URL=<http://host.containers.internal:9292> \
    pactfoundation/pact-cli:latest pact-broker can-i-deploy \
    --pacticipant provider \
    --version 0.0.2-SNAPSHOT \
    --to-environment production
Computer says yes \o/

CONSUMER | C.VERSION      | PROVIDER | P.VERSION      | SUCCESS? | RESULT#
---------|----------------|----------|----------------|----------|--------
consumer | 0.0.1-SNAPSHOT | provider | 0.0.2-SNAPSHOT | true     | 1

VERIFICATION RESULTS
--------------------
1. <http://host.containers.internal:9292/pacts/provider/provider/consumer/consumer/pact-version/fd46ac6802baf0518c615b484c11a0d5bf8754a7/metadata/Y3ZuPTAuMC4xLVNOQVBTSE9U/verification-results/131> (success)

All required verification results are published and successful
Is there a verbose flag, just looking at docs
y
ahh that is the old docker image with the legacy pact-broker_client the fix went into the rust rewrite docs.pact.io/implementation_guides/cli#… The fix is in the pact-broker-cli from v0.8.2 github.com/pact-foundation/pact-broker-cli/pull/102 Latest release is 0.8.6 github.com/pact-foundation/pact-broker-cli/…/v0.8.6 it is bundled into the main pact rust cli github.com/pact-foundation/pact-cli/releases#…
tl;dr update the docker run command for
pactfoundation/pact-cli
to be just
pactfoundation/pact
πŸ™ 1
p
ooh..
y
it should be flag compatible or thereabouts. I tried to be as faithful as I could
we should probably consider a back port considering the nature of the bug, shouldn’t be too difficult
p
Ignore my previous messages.
It does seem to work....
Copy code
xxx@xxx broker % ./can_i_deploy_consumer_0.0.2.sh
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ CONSUMER ┆ C.VERSION      ┆ PROVIDER ┆ P.VERSION      ┆ SUCCESS? ┆ RESULT β”‚
β•žβ•β•β•β•β•β•β•β•β•β•β•ͺ════════════════β•ͺ══════════β•ͺ════════════════β•ͺ══════════β•ͺ════════║
β”‚ consumer ┆ 0.0.2-SNAPSHOT ┆ provider ┆ 0.0.2-SNAPSHOT ┆ true     ┆ 1      β”‚
β”œβ•Œβ•Œβ•Œβ•Œβ•Œβ•Œβ•Œβ•Œβ•Œβ•Œβ”Όβ•Œβ•Œβ•Œβ•Œβ•Œβ•Œβ•Œβ•Œβ•Œβ•Œβ•Œβ•Œβ•Œβ•Œβ•Œβ•Œβ”Όβ•Œβ•Œβ•Œβ•Œβ•Œβ•Œβ•Œβ•Œβ•Œβ•Œβ”Όβ•Œβ•Œβ•Œβ•Œβ•Œβ•Œβ•Œβ•Œβ•Œβ•Œβ•Œβ•Œβ•Œβ•Œβ•Œβ•Œβ”Όβ•Œβ•Œβ•Œβ•Œβ•Œβ•Œβ•Œβ•Œβ•Œβ•Œβ”Όβ•Œβ•Œβ•Œβ•Œβ•Œβ•Œβ•Œβ•Œβ”€
β”‚ consumer ┆ 0.0.2-SNAPSHOT ┆ provider ┆ 0.0.1-SNAPSHOT ┆ false    ┆ 1      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”˜

VERIFICATION RESULTS
--------------------
1. <http://host.containers.internal:9292/pacts/provider/provider/consumer/consumer/pact-version/a3bb2b57270f3b8c13e7ad81d8b03d9189bdc5a5/metadata/Y3ZuPTAuMC4yLVNOQVBTSE9U/verification-results/132> (success)
2. <http://host.containers.internal:9292/pacts/provider/provider/consumer/consumer/pact-version/a3bb2b57270f3b8c13e7ad81d8b03d9189bdc5a5/metadata/Y3ZuPTAuMC4yLVNOQVBTSE9U/verification-results/130> (failure)


The verification for the pact between version 0.0.2-SNAPSHOT of consumer and one of the versions of provider currently in production (0.0.1-SNAPSHOT) failed


❌ Computer says no Β―\_(ツ)_/Β―
❌ No deployable version found
And when I retire version 0.0.1 of the producer, it then saids releasing 0.0.2 of the consumer is safe. Which is correct.
Copy code
xxx@xxx broker % ./3_retire_provider_0.0.1_from_production.sh
Recorded support ended for provider version 0.0.1-SNAPSHOT in production environment in the Pact Broker.
xxx@xxx broker % ./can_i_deploy_consumer_0.0.2.sh
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ CONSUMER ┆ C.VERSION      ┆ PROVIDER ┆ P.VERSION      ┆ SUCCESS? ┆ RESULT β”‚
β•žβ•β•β•β•β•β•β•β•β•β•β•ͺ════════════════β•ͺ══════════β•ͺ════════════════β•ͺ══════════β•ͺ════════║
β”‚ consumer ┆ 0.0.2-SNAPSHOT ┆ provider ┆ 0.0.2-SNAPSHOT ┆ true     ┆ 1      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”˜

VERIFICATION RESULTS
--------------------
1. <http://host.containers.internal:9292/pacts/provider/provider/consumer/consumer/pact-version/a3bb2b57270f3b8c13e7ad81d8b03d9189bdc5a5/metadata/Y3ZuPTAuMC4yLVNOQVBTSE9U/verification-results/132> (success)


All required verification results are published and successful


βœ… Computer says yes \o/
Thanks for the assistance. So, I'm going to repoint all my scripts at the new cli docker image and retest. Further, I wanted to test breaking changes from consumer and producer. I've now done the producer, so will test consumer later today hopefully.
Hopefully that means that I don't have to add a reproducer which is tough as I've not touched ruby in a decade.
y
Glad all is working as appropriate! Even your scripts above are helpful, something is bash is probably more appropriate that works the broker into an appropriate state, that having to mess about with Ruby, thankfully we still have some experts on the team, who can get the fixes in the right place. Just glad to have people willing to raise issues and help us try and solve them πŸ™‚
p
Gotcha. Yeah, well, it's helping you to help me. as mentioned before, I've got a presentation next Tuesday to 'sell' CDCTs internally for a microservices project I'm leading. I deferred running this presentation a few months ago as the team are so busy, and haven't the capacity to learn CDCTing. Further, at the time, I thought that Spring Cloud Contract might be an easier sell as we had an entirely Spring Java codebase until Christmas. But now 4 of the 5 systems that make up the wider project are python so Pact makes more sense. And SCC hasn't go the equivalent of the pact broker which for me in the big sell, that and the can i deploy too.. However, seeing issues with that later caused me issues. Hopefully I can close them down today or at least this week.
So... The results are in. And it all works great. Thank you. I've tested that the
can-i-deploy
tool checks that only compatible versions of collaborators are in <env>. I've tried from provider and consumer, and they both fail until I retire the old incompatible versions. Great work. I'll respond accordingly on the Github issue.
πŸ™Œ 1
m
we should probably consider a back port considering the nature of the bug, shouldn’t be too difficult
yes, good point Yousaf. I’ll raise an issue now. Paul - thanks for your hard work confirming this, and sorry about the faffing about here. good luck with your presentation, and do reach out if we can help!
p
Cheers. Ironically, I actually think my specific testing of
can_i_deploy
around 'are only compatible collaborators deployed to prod' has actually improved my presentation. I spent a lot of time looking at the matrix, and figured that less code samples and more presenting that and explaining how useful it is for our release process would be far more interesting to our SREs and delivery manager. Annoyingly that means I'll have to spend more time editing the slidedeck, but I think it will be worth it.
πŸ˜† 1
m
That’s fantastic! It is worth wrapping your head around it (perhaps with a glass of beer/wine/poison of choice), as it will pay off later. Thanks again for pushing through, the product is better for it πŸ™Œ