I'm getting an error in our pipelines this morning...
# pactflow
d
I'm getting an error in our pipelines this morning that is new. I can't see how it is caused by changes our end. Any changes made recently to pactflow? Our pactflow /matrix endpoint is returning 404 😞
Copy code
FAILED integration_tests/pact/v3/test_can_i_merge.py::test_can_i_merge - RuntimeError: can-i-merge failed: Error retrieving matrix. PactBroker::Client::Hal::ErrorResponseReturned - Error making request to <https://xxx-xxx.pactflow.io/matrix> status=404 Not Found. The requested document was not found on this server.
Using pact-cli to run can-i-merge (unchanged):
docker run --rm pactfoundation/pact-cli:latest pact-broker can-i-merge --broker-base-url={pact_broker_base_url} --broker-token={pact_broker_token} --pacticipant a --pacticipant b
looks like it should have made a url like
/matrix/provider/{provider}/consumer/{consumer}?
but for some reason didn't
y
i’ll take a look, we deployed a new docker image but it shouldn’t have affected that command
m
Any chance you could please provide it with a
--verbose
command? (redacted as necessary)
y
I would expect this command to fail
Copy code
docker run -e PACT_BROKER_BASE_URL -e PACT_BROKER_TOKEN --rm pactfoundation/pact-cli:latest pact-broker can-i-merge --pacticipant "Example API" --pacticipant "Example App"
with this message
Copy code
The version must be specified using `--version VERSION`, `--branch BRANCH` `--latest`, `--latest TAG`, or `--all TAG` for pacticipant Example API, Example App
You should have two version numbers here, one after each pacticipant, assume you are checking in this command that 2 applications, are both safe to merge their respective versions.
Copy code
-a, --pacticipant=PACTICIPANT                      # The pacticipant name. Use once for each pacticipant being checked.
  -e, [--version=VERSION]                            # The pacticipant version. Must be entered after the --pacticipant that it relates to.
two applications, with versions, they both relate to the same integration pair - note 1 entry in matrix
Copy code
docker run -e PACT_BROKER_BASE_URL -e PACT_BROKER_TOKEN --rm pactfoundation/pact-cli:latest pact-broker can-i-merge --pacticipant "Example API" --version 4fdf20082263d4c5038355a3b734be1c0054d1e1 --pacticipant "Example App" --version 5556b8149bf8bac76bc30f50a8a2dd4c22c85f30
Computer says yes \o/

CONSUMER    | C.VERSION  | PROVIDER    | P.VERSION  | SUCCESS? | RESULT#
------------|------------|-------------|------------|----------|--------
Example App | 5556b81... | Example API | 4fdf200... | true     | 1

VERIFICATION RESULTS
--------------------
1. <https://smartbear-api-hub.pactflow.io/pacts/provider/Example%20API/consumer/Example%20App/pact-version/cc79bbc141aa53a4fd45d155d705cbb243dec4b6/metadata/Y3ZuPTU1NTZiODE0OWJmOGJhYzc2YmMzMGY1MGE4YTJkZDRjMjJjODVmMzA/verification-results/1> (success)

All required verification results are published and successful
and with two applications which belong to different integrations. note 2 entries in matrix
Copy code
docker run -e PACT_BROKER_BASE_URL -e PACT_BROKER_TOKEN --rm pactfoundation/pact-cli:latest pact-broker can-i-merge --pacticipant "Example API" --version 4fdf20082263d4c5038355a3b734be1c0054d1e1 --pacticipant "pactflow-example-consumer-js-kafka" --version 1d015de190faec9c19f33531204bc41c804bd5da
Computer says yes \o/

CONSUMER                           | C.VERSION  | PROVIDER                             | P.VERSION  | SUCCESS? | RESULT#
-----------------------------------|------------|--------------------------------------|------------|----------|--------
Example App                        | 5556b81... | Example API                          | 4fdf200... | true     | 1
pactflow-example-consumer-js-kafka | 1d015de... | pactflow-example-provider-java-kafka | 3f21e6d... | true     | 2

VERIFICATION RESULTS
--------------------
1. <https://smartbear-api-hub.pactflow.io/pacts/provider/Example%20API/consumer/Example%20App/pact-version/cc79bbc141aa53a4fd45d155d705cbb243dec4b6/metadata/Y3ZuPTU1NTZiODE0OWJmOGJhYzc2YmMzMGY1MGE4YTJkZDRjMjJjODVmMzA/verification-results/1> (success)
2. <https://smartbear-api-hub.pactflow.io/pacts/provider/pactflow-example-provider-java-kafka/consumer/pactflow-example-consumer-js-kafka/pact-version/ebb65a4dd6311149553fce62d501a70850d1be9f/metadata/Y3ZuPTFkMDE1ZGUxOTBmYWVjOWMxOWYzMzUzMTIwNGJjNDFjODA0YmQ1ZGE/verification-results/200> (success)

All required verification results are published and successful
looks like it should have made a url like
/matrix/provider/{provider}/consumer/{consumer}?
but for some reason didn’t
That is incorrect, the matrix is not aware of consumer/provider when providing participant. It is just checking where each specification application is safe to deploy, given the particular version This is the path that would be accessed
Copy code
<- "GET /matrix?q[][pacticipant]=Example+API&q[][version]=4fdf20082263d4c5038355a3b734be1c0054d1e1&q[][pacticipant]=pactflow-example-consumer-js-kafka&q[][version]=1d015de190faec9c19f33531204bc41c804bd5da&latestby=cvpv&latest=true&mainBranch=true
d
Hello both, you seem to be correct, I missed some parts of the command in my haste to get a message out. For wahtever reason this no longer reproduces. I guess it was a blip and fixed itself. In the meantime I decided to skip the test and now can-i-merge fails :S I hope this doesn't happen too often!
with a
--verbose
command
Copy code
opening connection to <http://xxx.pactflow.io:443|xxx.pactflow.io:443>...
E           opened
E           starting SSL for <http://xxx.pactflow.io:443|xxx.pactflow.io:443>...
E           SSL established, protocol: TLSv1.3, cipher: TLS_AES_128_GCM_SHA256
E           <- "GET /matrix?q[][pacticipant]=A&q[][version]=4e0faf164c777fc8f30eebd4d3f0d3abaa72e832&q[][pacticipant]=Bc&q[][version]=4e0faf164c777fc8f30eebd4d3f0d3abaa72e832&latestby=cvpv&latest=true&mainBranch=true HTTP/1.1\r\nAccept: application/hal+json\r\nUser-Agent: Ruby\r\nAuthorization: [redacted]\r\n"
Yup that looks like expected. Time to see if I can push some verifications and get things green again
👍 1
Thank you for your help, sorry it turned out to be something weird on my end
👍 1
OK, we're all good with our can-i-merge. We'd just merged something and it takes a little time for it to publish
y
no worries David, thanks for reaching out and coming back to us to confirm
m
No probs - glad you’re back on track!