Thomas
10/12/2023, 6:06 AMusers-service) which is both an API provider and a API consumer.
The provider test works
CONSUMER | C.VERSION | PROVIDER | P.VERSION | SUCCESS? | RESULT#
-------------------|--------------------------------------------|---------------|-----------------------------------------------|----------|--------
gdprexport-service | C-5cf6a5f1b2e171382a3f0dee4e8696d8a0c34685 | users-service | P-v2-f1e31679d8f7a7c144ca63d80a5ebf69ac92719d | true | 1
But for some reason an the gdprexport-service , which is the API consumer, is also tested against the users-service consumer pact 🤯
CONSUMER | C.VERSION | PROVIDER | P.VERSION | SUCCESS? | RESULT#
-------------------|--------------------------------------------|---------------|-----------|----------|--------
gdprexport-service | C-5cf6a5f1b2e171382a3f0dee4e8696d8a0c34685 | users-service | ??? | ??? |
users-service | C-f1e31679d8f7a7c144ca63d80a5ebf69ac92719d | accounts-api | 6.5.2 | true | 1
There is no verified pact between the latest version of gdprexport-service (C-5cf6a5f1b2e171382a3f0dee4e8696d8a0c34685) and version C-f1e31679d8f7a7c144ca63d80a5ebf69ac92719d of users-service
We prefix the consumer version with C- and the provider version with P-<api-version>.
Actually pactflow should only test
gdprexport-service | C-5cf6a5f1b2e171382a3f0dee4e8696d8a0c34685 | users-service | P-v2-f1e31679d8f7a7c144ca63d80a5ebf69ac92719d
users-service | C-f1e31679d8f7a7c144ca63d80a5ebf69ac92719d | accounts-api | 6.5.2
and not
gdprexport-service | C-5cf6a5f1b2e171382a3f0dee4e8696d8a0c34685 | users-service | ???
How can I fix this?Bas Dijkstra
10/12/2023, 6:11 AMusers-service-consumer when it is a consumer and users-service-provider when it is a provider?Thomas
10/12/2023, 6:15 AMThomas
10/12/2023, 6:16 AMThomas
10/12/2023, 6:17 AMC- and P- confusing the system?Bas Dijkstra
10/12/2023, 6:39 AMc- and p- versions should not be the problem, you can use pretty much whatever you want as a provider or consumer version identifier (although there are some good practices)Boris
10/12/2023, 6:51 AMBoris
10/12/2023, 6:53 AMBoris
10/12/2023, 6:54 AMMatt (pactflow.io / pact-js / pact-go)
You shouldn’t need to identify different parts of the same app as consumer vs provider. That would make some things hard to reconcile (like the pacticipants dependency graph, and maybe preverification). (edited)yes, why are you doing this? It doesn’t make sense (at least without further explanation) for a version of the software to be a consumer and another version of the software to be a provider. Either it is both, or it isn’t, and the version is orthogonal to that
Thomas
10/12/2023, 9:05 AMMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
can-i-deploy outputs, it would be helpful to see how you are invoking that commandMatt (pactflow.io / pact-js / pact-go)
So far I didn’t change the pacticipant-name.what do you mean by this?
Thomas
10/12/2023, 9:08 AMMatt (pactflow.io / pact-js / pact-go)
rt- prexfies on the apps - did you manually modify the output from above to drop that?Thomas
10/12/2023, 9:09 AMwhat do you mean by this?@Matt (pactflow.io / pact-js / pact-go) I referred to the first suggestion from @Bas Dijkstra
Thomas
10/12/2023, 9:10 AMdid you manually modify the output from above to drop that?Yes, because the prefix doesn't matter for the example.
Matt (pactflow.io / pact-js / pact-go)
Thomas
10/12/2023, 9:14 AMif [ "$(params.publish-consumer-contract)" = "true" ] ; then
if [ -n "$(params.pact_deploy_to_environment)" ] ; then
pact-broker can-i-deploy\
--broker-base-url=$(params.pact_broker_base_url)\
--broker-token=$PACT_BROKER_TOKEN\
--pacticipant=$(params.pact_pacticipant)\
--version=C-$(params.git_sha)\
--to-environment=$(params.pact_deploy_to_environment)\
--retry-while-unknown=2\
--retry-interval=10
else
pact-broker can-i-deploy\
--broker-base-url=$(params.pact_broker_base_url)\
--broker-token=$PACT_BROKER_TOKEN\
--pacticipant=$(params.pact_pacticipant)\
--version=C-$(params.git_sha)\
--retry-while-unknown=2\
--retry-interval=10
fi
else
Currently we are not setting the to-environment (we are on it).Matt (pactflow.io / pact-js / pact-go)
gdprexport-service can’t be deployed (to wherever the target you specified is) because the users-service is required for it to operate.
CONSUMER | C.VERSION | PROVIDER | P.VERSION | SUCCESS? | RESULT#
-------------------|--------------------------------------------|---------------|-----------|----------|--------
gdprexport-service | C-5cf6a5f1b2e171382a3f0dee4e8696d8a0c34685 | users-service | ??? | ??? |
It goes on to say:
There is no verified pact between the latest version of gdprexport-service (C-5cf6a5f1b2e171382a3f0dee4e8696d8a0c34685) and version C-f1e31679d8f7a7c144ca63d80a5ebf69ac92719d of users-service
I think you are confused by versioning. The version is the piece of software you’re releasing (e.g. git sha a1b2c3). If users-service is both a consumer and a provider, then it should only have one version. Because when you deploy it, you only deploy one version of it.
I suspect this is why it’s picking up the C- version. The last time users-service is deployed to <target>, it was the version with C-. I think that is causing some confusion about how all of this works.Matt (pactflow.io / pact-js / pact-go)
users-service is C- then that would also explain itMatt (pactflow.io / pact-js / pact-go)
Thomas
10/12/2023, 9:24 AMP-V2-<git-sha> .
I think using only the <git-sha> as version lead pactflow test the consumer against all APIs, where of course only one test succeeded, but I can't remember exactly.
Is your recommendation to use the <git-sha> without prefix for both consumer and provider and for all API versions?Matt (pactflow.io / pact-js / pact-go)
releases to model that two concurrent released versions in the wild (see https://docs.pact.io/pact_broker/recording_deployments_and_releases#releases)
2. Create a new name of the API to indicate it’s a separately deployed thing (e.g. users-service-v2 )
It sounds like it’s the same deployable unit that supports multiple interfaces (API versions), so I don’t think these actually make sense for you.Thomas
10/12/2023, 9:28 AMThomas
10/19/2023, 5:57 AMversion in combination with releases and deployments worked so far.Thomas
10/19/2023, 12:15 PMversion.
We have a micro service with 2 API versions (v1 and v2).
Those two API versions are documented in 2 separate OAS files.
Error making request to <https://adidascdc.pactflow.io/provider-contracts/provider/rt-consents-service/publish> status=409 {"title":"Conflict","type":"<https://adidascdc.pactflow.io/problems/conflict>","detail":"A provider contract for rt-consents-service version 64d9021bfcc4df13014b52384290c270da92b089 already exists with different content and may not be modified. You will need to delete this resource and re-publish it. You can delete the resource by opening <https://adidascdc.pactflow.io/hal-browser/browser.html#https://adidascdc.pactflow.io/contracts/provider/rt-consents-service/version/64d9021bfcc4df13014b52384290c270da92b089> in your browser, clicking on the `NON-GET` button for the `self` relation, and sending a `DELETE` request to it.","status":409,"instance":"/","errors":[{"type":"<https://adidascdc.pactflow.io/problems/invalid-body-property-value>","title":"Invalid body parameter","detail":"conflicts with existing value","pointer":"/contract/content"}]}Thomas
10/19/2023, 12:18 PMYousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
You would need to merge them into a single documentNot sure if this would actually be possible, based on your content but just spit balling
Yousaf Nabi (pactflow.io)
Thomas
10/19/2023, 1:42 PMYou would need to merge them into a single documentOh, boy. Didn't know that only one file is supported. I was aware, that it should not include references etc, but I thought we can upload multiple files.
Thomas
10/19/2023, 1:42 PM