Hi, our main branch name is called 'release', not ...
# pactflow
k
Hi, our main branch name is called 'release', not 'develop, main or master'. We can appearantly set this value in the config of the broker: https://docs.pact.io/pact_broker/configuration/settings#main_branch_candidates However this is the first time I am reading about this config file. At the top of the page it says that it needs to be "placed it in the location
config/pact_broker.yml
, relative to the working directory of the application". However since we use pactflow as a SaaS, how can we set this config?
m
You can set it on each application individually, but it might be possible for us to set it at the tenant level for you
k
I think eventually we could do it on tenant level since to my knowledge 'release' is the main branch for all our company's applications. But until I know for sure: how do we set it per application?
m
OK cool
checking per application and ability to update 🙂
m
Oh perfect, I totally forget that exists
I was about to describe the PATCH request details and the Pact test from the terraform client for it 😆
y
you’ve been in the matrix too long matrixparrot 😅
k
Thanks Yousaf, I am trying that now. But I am wondering: Is it only possible to view the config via terminal? Is there no UI for it? Is that worthy of a feature request?
y
Hmm, possibly via the can-i-deploy UI today, by searching using the main branch, although not intuitive. You could do it through the HAL browser, I can get you the urls if you want? Yeah you can raise on the feature req board for PactFlow. We do have a refreshed UI that is in active development and you can jump in on the preview if you wanted https://github.com/pactflow/roadmap/issues/103 or just add your comments to that
the
main
branch is
master
for this application
k
Hi, I did follow the instructions in this thread, and it worked last week. However, at the end of the day, the commands didnt seem to work anymore. We deleted everything, and came back a week later (now) in the hopes that it would magically restore itself. But it is still not working. Please have a look at this screenshot. I am trying to change the main branch of our "Upa verlof" consumer to "contract-testing-release-do-not-delete-or-merge" (funny name I know, we didnt want to test on our actual main branch called "release", so we created this dummy branch that we designated as main branch purely for learning contract testing.) So what happens in the screenshot: 1: We describe our freshly created consumer to see that there is no main branch set 2: We try to change the main branch 3: We describe again. We see that it has been updated, but no main branch has been set. 4: We try the same with the example app that was provide when we onboarded on pactflow. Here you can see it already has a main branch. 5: We try to change the main branch here too 6: Again, you can see that it has been updated, but the main branch is still the same. Can someone help us?
m
hmm strange
I just tried this against a test account and it seems to work as expected:
Copy code
➜  pact-broker create-or-update-pacticipant --name XYZ --main-branch foo
Pacticipant "XYZ" created in Pactflow
➜  pact-broker describe-pacticipant --name XYZ
Name: XYZ
Display Name: XYZ
Main Branch: foo
Created At: '2023-09-20T12:02:19+00:00'
➜  pact-broker create-or-update-pacticipant --name XYZ --main-branch bar
Pacticipant "XYZ" updated in Pactflow
➜  pact-broker describe-pacticipant --name XYZ
Name: XYZ
Display Name: XYZ
Main Branch: bar
Updated At: '2023-09-20T12:02:32+00:00'
Created At: '2023-09-20T12:02:19+00:00'
You could try adding the
--verbose
flag, to see if you can see what’s happening in the payload
You should see something like this in there:
Copy code
<- "PATCH /pacticipants/XYZ 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\":\"XYZ\",\"mainBranch\":\"bar\"}"
Note the JSON payload
k
Copy code
Kevin@ip-172-23-17-171 ~ % pact-broker describe-pacticipant --name upa-verlof --broker-base-url=<https://tkppensioen.pactflow.io> -k <token>

Name: upa-verlof
Display Name: Upa Verlof
Updated At: '2023-09-20T11:12:04+00:00'
Created At: '2023-09-20T11:12:04+00:00'
Kevin@ip-172-23-17-171 ~ % pact-broker create-or-update-pacticipant --name=upa-verlof --broker-base-url=<https://tkppensioen.pactflow.io> -k <token> -—main-branch=contract-testing-release-do-not-delete-or-merge --verbose

opening connection to <http://tkppensioen.pactflow.io:443|tkppensioen.pactflow.io:443>...
opened
starting SSL for <http://tkppensioen.pactflow.io:443|tkppensioen.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, 20 Sep 2023 12:12:37 GMT\r\n"
-> "Content-Type: application/hal+json;charset=utf-8\r\n"
-> "Transfer-Encoding: chunked\r\n"
-> "Connection: keep-alive\r\n"
-> "Vary: Accept,Accept-Encoding\r\n"
-> "Server: Webmachine-Ruby/2.0.0 Rack/1.3\r\n"
-> "X-Pact-Broker-Version: 2.107.1\r\n"
-> "Content-Encoding: gzip\r\n"
-> "X-Content-Type-Options: nosniff\r\n"
-> "Strict-Transport-Security: max-age=63072000; includeSubDomains; preload\r\n"
-> "X-Pact-Broker-Git-Sha: 55bb62c6\r\n"
-> "X-Pactflow-Git-Sha: d2d1b5a88\r\n"
-> "X-Request-Id: e59bd06c62fe1fc744f715d8c57534b0\r\n"
-> "\r\n"
-> "43b\r\n"
reading 1083 bytes...
-> "\x1F\x8B\b\x00\xB5\xE1\ne\x00\x03\xBCXMo\xE36\x10\xFD+\x84\xCF\xD1j\xD1C\x0F\x06\x8CE\xDA\xA4\x8B\x05z\bv\xB7\xED\xA1-\x16\xB44\x8A\t\xD3\xA4@R\xC9\x06\x86\xFF{\x87\xA2(Q\xB2\xA4\x88^\xA7\x87\xC4\x12\xC5\x99\xF7\xE6\x93#\x1DW\xDF8\x13{\xBDZ\x1FW\x1Axa\x7Fw\n\xF0w\xB53\xA6\xD4\xEB45\xFB\xB2\x04\xA1\x99\x04\xF1\xAE\xA4\x99)\xB8|~\xC7\xE4\xEAfe\x98\xE1\x80;?\x89\x1C\xBE\xDB{8\x94\x9C\x1A\xC8W\xEB\x82r\r\xA7\x9BU\xB9]\x97\xD5\x963\xBDK\xAC\xECr\xF5\xA9\xBD\xD6i\xA9\xE4\x13\xCBA\xA5G\x7FuJ3)tu\xB0k\xFE\xEA\x94>\x81B\x15\xA2[\xBA-K\xCE2jp\xF1O\xF7\xEC\x140~p\x9C\b%5\xAB\x1Eu\xA3\xAA\x01s\xD4i\x94\xA5\x13A\xBF\x95I\e-#\xE8\x9D\xDE)\xDF\xD9\x15mj\xD7%\x8D\x891$\x9C\x0F\x9D\x92\x00\xFF\xF7z\xA16\x9D\xB4Z\xA7(\x18\xFA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2&\x94s\x99E\xBF\xC25\x9C8;03\xCCwr\e\xA8\x1C\xC1>\x9D\xFE\x03\x00\x00\xFF\xFF\x03\x00\b\xB4\x84\xBAE\x17\x00\x00"
read 1083 bytes
reading 2 bytes...
-> "\r\n"
read 2 bytes
-> "0\r\n"
-> "\r\n"
Conn keep-alive
opening connection to <http://tkppensioen.pactflow.io:443|tkppensioen.pactflow.io:443>...
opened
starting SSL for <http://tkppensioen.pactflow.io:443|tkppensioen.pactflow.io:443>...
SSL established, protocol: TLSv1.2, cipher: ECDHE-RSA-AES128-GCM-SHA256
<- "GET /pacticipants/upa-verlof? 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, 20 Sep 2023 12:12:38 GMT\r\n"
-> "Content-Type: application/hal+json;charset=utf-8\r\n"
-> "Transfer-Encoding: chunked\r\n"
-> "Connection: keep-alive\r\n"
-> "Vary: Accept,Accept-Encoding\r\n"
-> "Server: Webmachine-Ruby/2.0.0 Rack/1.3\r\n"
-> "X-Pact-Broker-Version: 2.107.1\r\n"
-> "Content-Encoding: gzip\r\n"
-> "X-Content-Type-Options: nosniff\r\n"
-> "Strict-Transport-Security: max-age=63072000; includeSubDomains; preload\r\n"
-> "X-Pact-Broker-Git-Sha: 55bb62c6\r\n"
-> "X-Pactflow-Git-Sha: d2d1b5a88\r\n"
-> "X-Request-Id: da13a8febf61dec729cdd7f38a1d3d0d\r\n"
-> "\r\n"
-> "251\r\n"
reading 593 bytes...
-> "\x1F\x8B\b\x00\xB6\xE1\ne\x00\x03\xE4U\xD1n\x9B0\x14\xFD\x15\x8B\xD7\xE1\x98\xA4\x9D\xD4\"MS\xD7D\xD3^\xA6i\xCA\xF6RU\x93\xC1\x97\x06\x15l\xCB\x98l\x15\xE2\xDFw\r!5m\xB62\x95\xB7=$\x18\xFB\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\x1Eh\xC2\xC5\x1D\xF8T\xAE\xB9$\x9F\xC8\xBA[\xF5\xAC!}\xE0\f\x06\xF97|_\x99\xCCg\xC4\xACb\r\xC8}n\x94,A\xDA\xAD\v\x18\x92\x9F<\xF2\xB1\x9E\xBE\x9A\xAD\xA2\x1E\xC6t\x95\x99Q\xE5P\xD5V\x11\x0Fc.\x03\x9E\x17\xF7\x13K\x9E\x98\xE1\xEB\x18\x19\xF37W\xD2\xDA\xE4\xE0\xBE\xA9\xCD\xF0\xBD\xD0\xC9t\xEAB\xA5\xAC1X\xBF\xEFS%-\xFC\xB2\xEF<1'\xF2\xDD\xB6\xEDo\x00\x00\x00\xFF\xFF\x03\x00\xD5\x88j\xD5Z\t\x00\x00"
read 593 bytes
reading 2 bytes...
-> "\r\n"
read 2 bytes
-> "0\r\n"
-> "\r\n"
Conn keep-alive
opening connection to <http://tkppensioen.pactflow.io:443|tkppensioen.pactflow.io:443>...
opened
starting SSL for <http://tkppensioen.pactflow.io:443|tkppensioen.pactflow.io:443>...
SSL established, protocol: TLSv1.2, cipher: ECDHE-RSA-AES128-GCM-SHA256
<- "PATCH /pacticipants/upa-verlof 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\":\"upa-verlof\"}"
-> "HTTP/1.1 200 OK\r\n"
-> "Date: Wed, 20 Sep 2023 12:12:39 GMT\r\n"
-> "Content-Type: application/hal+json;charset=utf-8\r\n"
-> "Transfer-Encoding: chunked\r\n"
-> "Connection: keep-alive\r\n"
-> "Vary: Accept,Accept-Encoding\r\n"
-> "Server: Webmachine-Ruby/2.0.0 Rack/1.3\r\n"
-> "X-Pact-Broker-Version: 2.107.1\r\n"
-> "Content-Encoding: gzip\r\n"
-> "X-Content-Type-Options: nosniff\r\n"
-> "Strict-Transport-Security: max-age=63072000; includeSubDomains; preload\r\n"
-> "X-Pact-Broker-Git-Sha: 55bb62c6\r\n"
-> "X-Pactflow-Git-Sha: d2d1b5a88\r\n"
-> "X-Request-Id: 2079b27386bc4db8d90dd3df51cc246d\r\n"
-> "\r\n"
-> "256\r\n"
reading 598 bytes...
-> "\x1F\x8B\b\x00\xB7\xE1\ne\x00\x03\xE4U\xD1n\x9B0\x14\xFD\x15\x8B\xD7\xE1\x98$\x9D\xD4 MS\xD7D\xD3^\xA6i\xCA\xF6RU\x93\xC1\x97\x06\x15l\xCB\x98l\x15\xE2\xDFw\x1D\x025m\xB6f*o\x93B0\xF6\xE5\xDCs\x8E\xEF5M y\tA\x1C\xD4\x9A\xD3=\x98BeA\x18\x88\xBC\xD2\x05\x7F\xF8\xDC-}\xD3\x9C|\xEF\x97J\x9E\xCB\x0F\x86\xCBt\x87+\xEE\x01\xE7j-\xB8\x05qeqj\x11-\x964Z\xD1E\xB4\x9D/b\xFC-Wo\xA2(\x8E\"\x8CK\r\x9C\x8C\x9B\xBB\xB8\xE8b\x88\xFB\x01e\x02B\x80\b\xE2&(\xF0\x95\xCAb\xFE*W\xD2M\xC8\x1AW\rBD\xB39}\xBB\x9A\xD3\x05_^^\xA4\xD1\xE5\x8Af\x88_\e\xA0\x9A\xA7\xD6\xE1\x14\xB9\xBC\xAF\xDC;\x15\x14\x99\xBB\xDB\xDC\x16NR\x0F\x17\xF6\xF2_\xC4\xDA\x19@\x84`g\xAD\xAEb\xC6\xEC\xBD\xD6 \x11\x03\xE4\xCCEd\x85\xFA9\xCB\x15s\xE3<\xCD5\x97\xB6b\x8F\x9E\xB2}\x97\xB0b/$j\xDB6D\xC9\t\x14\xC8\xFB\xE66<\xCA\xA7\xFB\xFFF\x7F8\x90\\o\xBE|\xDD\\_m7kB\x89.\x80W@j\xBC\xC6\x151H8/\xDC%x\xEE\xCB\xEB\xD4\x05\x88\xA9\x93\xB8\xD7\xF8z\xC0\xC1\xAE1\xB2\xBF\x83\x1F\xC1\x86\xA4k(\xA2\f\x11P\x00\x8E8\xF1\x10\xC9~\xB0h\xAA\xDDk\x8E\xA3\x161-\x94\xDAy\x8B]jM\r#\xA6\xD4\xF2\xBBs\xD8b\x18\xC9p\x82\xF7\\\x89\xCA\xC8\xE8(\x9A\x9C9\xC3\x9C\xF8\x88\xFF\x7F\x14\x91\x1C\xCE7z\xDAu\xC7\x9F\v\xC1\x8Ej\x1E\x99w:\xBAw\xA7\x96\xD1\xA1\x02\xF2\xEEF\xED?l\xC9\xE149g3\x0E\x81\a\x19SR\xEF\x0E3\xD6\x1C\xEE\xA7I\xFA\x8D34?h\x03\xA9\v\xC3nvm\xEC7\xD8deq\xEC\xAF\x94K\x9AS\x01\xBAP\x0F4\xE1\xE2\x0E|*\xD7\\\x92Od}X\xF5\xAC!]\xE0\x04\x06\xF9'|W\x99\xCCg\xC4\xACb\r\xC8}n\x94,A\xDA\xAD\v\xE8\x93\x9F\xDC\xF2\xB1\x9E\xAE\x9A\xAD\xA2\x1E\xC6\xF9*3\xA3\xCA\xBE\xAA\xAD\"\x1E\xC6T\x06</\xEE'\x96<1\xC3\xD712\xE6o\xAE\xA4\xB5\xC9\xC1}S\x9B\xFE{\xA1\x93\xF3\xA9\v\x95\xB2\xC6`\xFD\xBEO\x95\xB4\xF0\xCB\xBE\xF3\xC4\x9C\xC8w\xDB\xB6\xBF\x01\x00\x00\xFF\xFF\x03\x00\xF6\r]\x89Z\t\x00\x00"
read 598 bytes
reading 2 bytes...
-> "\r\n"
read 2 bytes
-> "0\r\n"
-> "\r\n"
Conn keep-alive
Pacticipant "upa-verlof" updated in PactFlow
Not sure where I should be looking in all this. Can you make sense of it?
y
the patch request is only sending through the name
which is suspect (probably not at your end)
let me check the broker client code and test it out with a local broker
facepalm no branch in that command 😂
Copy code
pact-broker describe-pacticipant --name upa-verlof --broker-base-url=<https://tkppensioen.pactflow.io> -k <token>
but looking for the
PATCH
command when you try and update the branch will help trace it a bit
oh wait, that was just the first command, the 2nd command is
Copy code
Kevin@ip-172-23-17-171 ~ % pact-broker create-or-update-pacticipant --name=upa-verlof --broker-base-url=<https://tkppensioen.pactflow.io> -k <token> -—main-branch=contract-testing-release-do-not-delete-or-merge --verbose
definitely can’t see that branch being passed through
So that change should be in place for pact broker clients newer than https://github.com/pact-foundation/pact_broker-client/releases/tag/v1.54.0
k
Is this the version you're looking for?
thank you 1
y
super weird - this is with a local broker. Your version is new enough to include the change
You can try our test PactFlow instance out, I’ve just updated one successfully, I’ve added a screenshot of some names you can use
Copy code
🕙13:57:46 ❯ pact-broker describe-pacticipant --name SNSPactEventConsumer --broker-base-url=<https://test.pactflow.io> --broker-token 129cCdfCWhMzcC9pFwb4bw
Name: SNSPactEventConsumer
Display Name: SNS Pact Event Consumer
Main Branch: master
Updated At: '2023-09-05T00:42:55+00:00'
Created At: '2023-09-04T23:58:36+00:00'

~ via 🐳 desktop-linux on ☁️  (eu-west-2) took 3s 
🕙13:59:21 ❯ pact-broker create-or-update-pacticipant --name SNSPactEventConsumer --broker-base-url=<https://test.pactflow.io> --broker-token 129cCdfCWhMzcC9pFwb4bw --main-branch=main
Pacticipant "SNSPactEventConsumer" updated in PactFlow

~ via 🐳 desktop-linux on ☁️  (eu-west-2) took 4s 
🕙13:59:53 ❯ pact-broker describe-pacticipant --name SNSPactEventConsumer --broker-base-url=<https://test.pactflow.io> --broker-token 129cCdfCWhMzcC9pFwb4bw 
Name: SNSPactEventConsumer
Display Name: SNS Pact Event Consumer
Main Branch: main
Updated At: '2023-09-20T12:59:52+00:00'
Created At: '2023-09-04T23:58:36+00:00'
k
Hmm for this instance it works. Does that mean our broker is somehow bugged?
y
most peculiar - if you upload a fresh pact for a new consumer/provider does it exhibit the same behaviour? I assume you have a SaaS broker? Raising a support ticket is probably best at this point https://support.smartbear.com/pactflow/message and someone from the team will be able to look into the specific details, you can link them to this thread for background information. I’m not privy to that information (with good reason)!
k
Hmm we currently only have 1 consumer and provider to play around with. Would a rename of the consumer be enough?
y
Probably best just uploaded any pact file, or just renaming the consumer/provider keys in the json file
then upload that, just allows you to see if there is something up with the application pair, (if you can’t replicate on what would appear to the Broker, to be 2 new applications, and 1 new integration)
you can delete it after you are done testing
k
I have a new pair, but still the same result
sadpepe 1
Ill make a support ticket
y
Thank you Kevin! Appreciate the self triage too
m
Thanks Kevin and Yousaf. I’ve given customer care the heads up this will need to go straight to the dev team for review, peculiar!
k
I have created a ticket with number 00569427
thankyou 2
m
Hmm we currently only have 1 consumer and provider to play around with. Would a rename of the consumer be enough?
FYI you don’t need to upload a contract, you can simply run that same command with a new application name (e.g.
foo
) and see how it works on your broker
thank you 1
b
@Kevin de Boer I’ve got the support ticket, but it’s easier if I just chat to you here.
Can you try the command with the latest version of the pact broker client, because I’ve updated it to NOT use gzip when --verbose is turned on, because it makes it very hard to view the response!
This is the output I get when I run the create-or-update-pacticipant command.
logs.txt
I can’t reproduce the issue with this version of the client and my own test broker.
From the logs you’ve provided, I suspect there is a bug in the version of the client you’re using, because I could set the main branch via the API in the HAL browser no problem, and the latest CLI seems to be working fine too.
k
Hi, I will look into to this as soon as I can! Which will be next wednesday at the latest
thankyou 1
m
Thanks Beth.
k
Hi, I have downloaded version 2.0.7 of the standalone package (which include version 1.72.0 of the pact-broker cli), and I still get the same result:
It dont think the client is the issue, as it did work to change the main branch in Yousaf's instance. To me it looks like the problem is in our broker, as I cant change the main branch (havent tried other settings yet) of any pacticipants, existing or brand new ones. But I could with Yousaf's broker.
m
Thanks for letting us know. I’ll add these notes to the ticket for somebody to review 🙏
b
@Kevin de Boer can you please run the command with --verbose turned on and share the logs
We do want to work out what the issue is with the CLI, but in the meantime, you can just update the mainBranch via the HAL browser.
Open the HAL browser, and go to
<https://tkppensioen.pactflow.io/pacticipants/upa-verlof>
Click the yellow “NON-GET” button for the
self
relation. Change the HTTP method to
PATCH
and then set the body to
{"mainBranch": "your-new-value"}
Then click “Make request”
m
Hi Kevin, just checking in here - were you able to run that command?
k
Hi!, Apologies, I hadnt gotten to it last week. I tried it just now, and it seemed to work! I guess we can rule out that our broker is broken then. Still weird that it doesnt seem to work from the cli, while the cli did work with the broker from Yousaf 🤔
m
No worries and thanks! Can you please try using the CLI again (the latest version) with the verbose flag set?
It makes no sense the API call works but the CLI doesn't which calls the same API!
k
Still the same behaviour with version 1.72.0
m
I think it’s actually a bug! I’ve installed that exact version and it fails for me. The previous version I had (1.66.0) works, but that’s obviously a few versions old
OK, you won’t believe what the bug is - please re-type the command above, beieng careful to type
--main-branch
correctly (note the hyphens - I think you’ve copy/pasted from somewhere that has converted hyphens to another character)
msn lightbulb 1
wow 1
Your one has
—
in it, but it should be
-
Copy code
➜  /tmp printf %x "'—" # <- incorrect one used in your failing command
2014%
➜  /tmp printf %x "'-" # <- correct one
2d%
k
Oh my god 🙈
I blame Slack for this 🙈 Ive been sending commands to colleagues via Slack. We've already noticed it was changing double quotes " to something else, but appearantly hyphens too 😒
this 1
I feel like I owe you a drink or something 😅 Thanks a lot for digging so deep!
😆 1
🙌 1
👆 1
y
Yes! I found slack uses opening double quote and closing double quote, which cli tools don’t tend to like https://practicaltypography.com/straight-and-curly-quotes.html
m
I feel like I owe you a drink or something 😅 Thanks a lot for digging so deep!
haha well if you ever make it to Melbourne (Aus) feel free to buy me one 🙂
Thor is the library used in the CLI. It’s widely used/popular, but has a bunch of quirks (see https://mattbrictson.com/blog/fixing-thor-cli-behavior). I’m currently googling to see if we can make it error if it gets an argument it didn’t expect - in this case, it should (I mean, that argument would probably still be hard to parse in this instance, but it is a problem more generally)
In any case, glad you’re back on track!
b
@Kevin de Boer
🥳 1
😆 1
I almost added a nasty message about Word, but I restrained myself.
m
I'd be happy to have an Easter egg where given a certain combination of parameters the series of issues I've documented about office are presented as a warning to the user about the dangers of that product