Hi, we are implementing a bi-directional contract ...
# pactflow
m
Hi, we are implementing a bi-directional contract testing system and we use
can-i-deploy
in our CI/CD system to check the compatibility of our Provider with our Consumer contracts. We would like detailed information about the contract validation failure (i.e. what specific request properties don't match etc), but unfortunately it seems like the default response from
can-i-deploy
lacks that information and links to the
/contracts/bi-directional/provider/<provider>/version/<version>/consumer/<consumer>/version/<version>/cross-contract-verification-results
page in the pactflow ui. There is documentation that implies that this information can be retrieved programmatically via the pactflow API https://docs.pactflow.io/docs/bi-directional-contract-testing/compatibility-checks/#api-resources
crossContractVerificationResults
contains the information we want We have tried various ways to make requests to that url, but couldn't get it to work. We always receive
{"title":"404 Not Found","type":"<https://problems-registry.smartbear.com/not-found>","detail":"The requested document was not found on this server.","status":404}
How can we retrieve the contract verification results programmatically?
m
@phanindra srungavarapu I believe we’re making a related API to this public, correct?
👌 1
@Marlin Dalpozzo can you please elaborate a little further on what you’re trying to achieve and why the UI is not serving your needs? (I think I know why, but would love to hear it from you - this will help validate some assumptions on our side)
m
hey thanks for getting back to me! I would like to be able to programmatically retrieve (pact-broker cli or rest API) the details of what incompatibilities exist between a Consumer contract and Provider OAS if they are incompatible.
for example
Copy code
Response body is incompatible with the response body schema in the spec file: must NOT have additional properties - new
interactions[0].response.body.layout_data.taskbar_content.1.items.0 = {"display_name":"Work Order","id":"buffered_work_order","new":null,"source":"legacy_app","target":"_blank","url":"/buffered_reports/work_order?customize=true"}
i can see this information in the ui at
Copy code
contracts/bi-directional/provider/<provider-name>/version/<provider-version>/consumer/<consumer-name>/version/<consumer-version>/cross-contract-verification-results
but need this to be returned from
can-i-deploy
or be able to retrieve this info from some other API
this documentation seems to imply this information is available somehow, but we haven't been able to find anything conclusive https://docs.pactflow.io/docs/bi-directional-contract-testing/compatibility-checks/#failure-result
To give you more context. Relying on the PactFlow UI is not going to be viable for our team given the limit on seats/users and the potential pricing. We are a decently size company, and so a programmatic API solution is a must.
m
I understand. I believe you’re in conversation with Rosemary? We are actually making a change to the
/can-i-deploy
endpoint this week that will include links to public APIs to fetch this info.
yes party 1
🎉 1
thankyou 1
j
Awesome thank you! Please let us know when it’s available
👍 1