<@UELMFD9PG> - I was trying to use `npm run pact:p...
# pact-ruby
d
@Yousaf Nabi (pactflow.io) - I was trying to use
npm run pact:publish --if-present -- --auto-detect-version-properties --broker-base-url ${{ env.PACT_BROKER_BASE_URL }} --broker-token ${{ env.PACT_BROKER_TOKEN }}
, without any
--consumer-app-version
this is actually causing issues when we publish the pacts on
main
and complaining about unique consumer versions
This doesnt happen on the branch, but happens on
main
Copy code
> participant-video-service@0.13.0 pact:publish
> pact-broker publish ./pacts/*.json --auto-detect-version-properties --broker-base-url <https://usertesting.pactflow.io> --broker-token ***

[09:44:04.387] WARN (1874): pact-core@14.3.8: DEPRECATION NOTICE: 
  pact standalone tools will be removed in pact-js-core 15.x. 
  Please update imports to @pact-foundation/pact-cli 
  <https://github.com/pact-foundation/pact-js-core/issues/488>
Cannot change the content of the pact for participant-video-service version 33c1cf77402ca08562c8776f41f2569b718403f0 and provider analytics-video-data-service, as race conditions will cause unreliable results for can-i-deploy. Each pact must be published with a unique consumer version number. Some Pact libraries generate random data when a concrete value for a type matcher is not specified, and this can cause the contract to mutate - ensure you have given example values for all type matchers. For more information see <https://docs.pact.io/go/versioning>
     {
       "contents": {
         "data": {
-          "accountUuid": "33f1c52b-fda6-467e-91df-4e93111a441d",
-          "clipUuid": "ae28abbb-2207-40e8-b9d2-a20d135220da",
-          "participantUuid": "b407e22f-b1d7-4177-bdbb-209918746335",
-          "studyUuid": "10c02fa8-1516-4bcc-9d94-2a2880b57417"
+          "accountUuid": "ffbacb3c-70d9-435a-9776-ef5bae9b2820",
+          "clipUuid": "d4a190b5-c351-4b1c-be80-8afca354d94b",
+          "participantUuid": "b1f0d96d-820c-4f7a-9c36-58ce82bb9ed4",
+          "studyUuid": "8c786aad-c6bb-4ff2-ba93-5b8b7182d7b0"
         },
-        "id": "8bf066f7-27c2-46b6-a56e-7cc9d37f02a6"
+        "id": "8341259d-236c-4761-bdd1-fdf9b2f10a6a"
       }
     }
   ]
Cannot change the content of the pact for participant-video-service version 33c1cf77402ca08562c8776f41f2569b718403f0 and provider participant-test-plan-service, as race conditions will cause unreliable results for can-i-deploy. Each pact must be published with a unique consumer version number. Some Pact libraries generate random data when a concrete value for a type matcher is not specified, and this can cause the contract to mutate - ensure you have given example values for all type matchers. For more information see <https://docs.pact.io/go/versioning>
         "data": {
           "tasks": [
             {
-              "taskUuid": "77bdae78-7ec5-4c4b-992d-cf5f5b49602b"
+              "taskUuid": "808c2e68-041a-423d-9c44-219f69b39651"
             }
           ]
         }
Error: Process completed with exit code 1.
y
use fixed uuids, or uuid matchers with example values which are fixed
the output is telling you that
d
so this is nothing to do with the unique consumer version tag then
y
it is to do with material pact changes being published on the same consumer app version because of random data in the contract. https://docs.pact.io/getting_started/matching#random-data---avoid-it a deterministic contract means that when its verified and a new contract is published with the same contents, its automatically verified
otherwise each pact content ends up being different because of random data, and you lose all benefits of pre verification and it will cause can-i-deploy not to be able to work correctly
d
Yes it make sense, but we are generating the data from the factory, instead hardcoding the object
for example if i want to get the data for the properties, i have to call the factory something like below
const participantTestPlanData = ParticipantTestPlanDataFactory.build();
And passing the values like below
Copy code
accountUuid: uuid(participantTestPlanData.accountUuid),
					studyUuid: uuid(participantTestPlanData.studyUuid),
					participantUuid: uuid(participantTestPlanData.participantUuid),