Dilip Punna
08/21/2024, 10:16 PMprovider_state and defined under pact_helper_message.rb for the event message driven contracts. My config for the pact-helper_message.rb as follows below
require_relative "provider_states_responses_tracker_service"
require_relative "provider_states_participant_study_service"
require_relative "provider_states_participant_test_plan_service"
require_relative "provider_states_permissions_service"
require_relative "provider_states_test_plan_logic_service"
require File.expand_path("../../../../config/environment", __FILE__)
require "pact/provider/rspec"
require "environment_helpers"
# Set verify variables
pact_base_url = ENV["PACT_BROKER_URL"]
token = ENV["PACT_BROKER_TOKEN"]
# Set variables
provider_version = ENV["GIT_SHA"]
provider_branch = ENV["GIT_BRANCH"] || "main"
publish_flag = ENV.boolean("CI", default: false)
CONFIG = [
MyMessageProvider.messages,
StudyServiceProviderMessage.messages,
TestPlanServiceMessageProvider.messages,
PermissionsServiceProviderMessage.messages,
TestPlanLogicServiceMessageProvider.messages
].reduce(&:merge)
# Debugging: Print CONFIG keys
puts "CONFIG keys: #{CONFIG.keys}"
Pact.message_provider "orders-message" do
if ENV["PACT_URL"]
honours_pact_with ENV["CONSUMER_NAME"] do
pact_uri ENV["PACT_URL"], {token: token}
end
else
honours_pacts_from_pact_broker do
pact_broker_base_url pact_base_url, {token: token}
consumer_version_selectors [
{ mainBranch: true }
]
end
end
app_version provider_version
app_version_tags [provider_branch]
publish_verification_results publish_flag
builder do |message_description|
CONFIG[message_description].call
end
endDilip Punna
08/21/2024, 10:20 PMresponses-tracker and participant-test-plan-service too, but it is missing for some reason thinking
INFO: Fetching pacts for orders-message from <https://usertesting.pactflow.io> with the selection criteria: latest from main branch, work in progress pacts created after 2023-01-01
INFO: Reading pact at <https://usertesting.pactflow.io/pacts/provider/orders-message/consumer/participant-study-service/pact-version/0ceb7c9c8077f0631b6b404e3b867949047fdf93/metadata/c1tdW2xdPXRydWUmc1tdW2N2XT00NTIxNCZwPWZhbHNl>
WARN: Ignoring unsupported combine AND for path $['data']['study']['createdByUuid']
WARN: Ignoring unsupported combine AND for path $['data']['study']['productType']['type']
WARN: Ignoring unsupported combine AND for path $['data']['study']['studyContext']['accountUuid']
WARN: Ignoring unsupported combine AND for path $['data']['study']['title']
WARN: Ignoring unsupported combine AND for path $['data']['study']['uuid']
WARN: Ignoring unsupported combine AND for path $['id']
WARN: Ignoring unsupported combine AND for path $['data']['study']['testPlanUuid']
WARN: Ignoring unsupported combine AND for path $['data']['study']['uuid']
WARN: Ignoring unsupported combine AND for path $['id']
INFO: Reading pact at <https://usertesting.pactflow.io/pacts/provider/orders-message/consumer/permissions-service/pact-version/e37c088721e1b5b2e468fca3993fe6a95a557b91/metadata/c1tdW2xdPXRydWUmc1tdW2N2XT00NTk1NiZwPWZhbHNl>
INFO: Reading pact at <https://usertesting.pactflow.io/pacts/provider/orders-message/consumer/test-plan-logic-service/pact-version/f80a1e8aa90f78a261951b65da55d8d42181e3d5/metadata/c1tdW2xdPXRydWUmc1tdW2N2XT00NzY5MCZwPWZhbHNl>
WARN: Ignoring unsupported combine AND for path $['data']['testPlan']['id']
WARN: Ignoring unsupported combine AND for path $['data']['testPlan']['logicNodes']
WARN: Ignoring unsupported combine AND for path $['data']['testPlan']['taskGroups']
WARN: Ignoring unsupported combine AND for path $['data']['testPlan']['tasks']
WARN: Ignoring unsupported combine AND for path $['data']['testPlan']['testPlanEntries']
WARN: Ignoring unsupported combine AND for path $['data']['testPlan']['uuid']
[rspec-sidekiq] WARNING! Sidekiq will *NOT* process jobs in this environment. See <https://github.com/wspurgin/rspec-sidekiq/wiki/FAQ-&-Troubleshooting>
DEBUG: The pact at <https://usertesting.pactflow.io/pacts/provider/orders-message/consumer/participant-study-service/pact-version/0ceb7c9c8077f0631b6b404e3b867949047fdf93> is being verified because the pact content belongs to the consumer version matching the following criterion:
* latest version from the main branch 'main' (2990ad33ff33540b487d0a414d888b3676530dc6)
DEBUG: This pact has previously been successfully verified by orders-message. If this verification fails, it will fail the build. Read more at <https://docs.pact.io/go/pending>
Verifying a pact between participant-study-service and orders-message
Given a study has been created in orders
a STUDY_CREATED kafka event
has matching content
Given a study has been updated in orders
a STUDY_UPDATED kafka event
has matching content
DEBUG: The pact at <https://usertesting.pactflow.io/pacts/provider/orders-message/consumer/permissions-service/pact-version/e37c088721e1b5b2e468fca3993fe6a95a557b91> is being verified because the pact content belongs to the consumer version matching the following criterion:
* latest version from the main branch 'main' (712b524f30d58ad24bfbebae43182e68db953d73)
DEBUG: This pact has previously been successfully verified by orders-message. If this verification fails, it will fail the build. Read more at <https://docs.pact.io/go/pending>
Verifying a pact between permissions-service and orders-message
Given a workspace member has been updated
a WORKSPACE_MEMBERSHIP_UPDATED message
has matching content
Given an account has been created
an ACCOUNT_CREATED message
has matching content
Given a workspace member has been added
a WORKSPACE_MEMBERSHIP_USER_ADDED message
has matching content
Given a workspace has been deleted
a WORKSPACE_DELETED message
has matching content
Given a workspace member has been removed
a WORKSPACE_MEMBERSHIP_REMOVED message
has matching content
Given a workspace has been created
a WORKSPACE_CREATED message
has matching content
Given an account membership has been updated
an ACCOUNT_MEMBERSHIP_UPDATED message
has matching content
Given an account membership has been created
an ACCOUNT_MEMBERSHIP_USER_ADDED message
has matching content
Given an account membership has been removed
an ACCOUNT_MEMBERSHIP_REMOVED message
has matching content
DEBUG: The pact at <https://usertesting.pactflow.io/pacts/provider/orders-message/consumer/test-plan-logic-service/pact-version/f80a1e8aa90f78a261951b65da55d8d42181e3d5> is being verified because the pact content belongs to the consumer version matching the following criterion:
* latest version from the main branch 'main' (ea8775a85efb2153771ceddfb063a210d0975b4f)
DEBUG: This pact has previously been successfully verified by orders-message. If this verification fails, it will fail the build. Read more at <https://docs.pact.io/go/pending>
Verifying a pact between test-plan-logic-service and orders-message
Given a test plan has been updated in orders
a TEST_PLAN_UPDATED kafka event
has matching content
12 interactions, 0 failures
WARN: Ignoring unsupported combine AND for path $['data']['study']['createdByUuid']
WARN: Ignoring unsupported combine AND for path $['data']['study']['productType']['type']
WARN: Ignoring unsupported combine AND for path $['data']['study']['studyContext']['accountUuid']
WARN: Ignoring unsupported combine AND for path $['data']['study']['title']
WARN: Ignoring unsupported combine AND for path $['data']['study']['uuid']
WARN: Ignoring unsupported combine AND for path $['id']
WARN: Ignoring unsupported combine AND for path $['data']['study']['testPlanUuid']
WARN: Ignoring unsupported combine AND for path $['data']['study']['uuid']
WARN: Ignoring unsupported combine AND for path $['id']
WARN: Ignoring unsupported combine AND for path $['data']['testPlan']['id']
WARN: Ignoring unsupported combine AND for path $['data']['testPlan']['logicNodes']
WARN: Ignoring unsupported combine AND for path $['data']['testPlan']['taskGroups']
WARN: Ignoring unsupported combine AND for path $['data']['testPlan']['tasks']
WARN: Ignoring unsupported combine AND for path $['data']['testPlan']['testPlanEntries']
WARN: Ignoring unsupported combine AND for path $['data']['testPlan']['uuid']Sauparna Gupta
08/22/2024, 11:51 AMmainBranch property, and has set a branch name when publishing the pacts. Can you please verify if you have specified the main branch for the two services.Yousaf Nabi (pactflow.io)
Dilip Punna
08/22/2024, 12:10 PMlatest:true and it is recognising the pact consumer contracts, when i try with mainBranch:true it doesnt work. I know pact recommending not to use latest:true wondering if you have any new solution here?Sauparna Gupta
08/22/2024, 12:26 PMDilip Punna
08/22/2024, 12:29 PMmain , we can only run them as part of the push on main , is that what you mean?Sauparna Gupta
08/22/2024, 12:31 PMSauparna Gupta
08/22/2024, 12:31 PM/pacticipants/<pacticipant_name>/settings/version-control in the UI there will an option for main branchDilip Punna
08/22/2024, 12:34 PMDilip Punna
08/22/2024, 12:34 PMDilip Punna
08/22/2024, 12:35 PM<pacticipant_name> - Is this consumer or provider service name?Yousaf Nabi (pactflow.io)
Dilip Punna
08/22/2024, 12:36 PMSauparna Gupta
08/22/2024, 12:37 PMDilip Punna
08/22/2024, 12:40 PMpact-broker describe-pacticipant --name=participant-test-plan-service -b, --broker-base-url=<https://usertesting.pactflow.io/>
ERROR: "pact-broker describe_pacticipant" was called with arguments ["-b,"]
Usage: "pact-broker describe-pacticipant --name=NAME -b, --broker-base-url=BROKER_BASE_URL"Dilip Punna
08/22/2024, 12:40 PMYousaf Nabi (pactflow.io)
-b, --broker-base-url
-b is an aliasSauparna Gupta
08/22/2024, 12:40 PMSauparna Gupta
08/22/2024, 12:41 PMSauparna Gupta
08/22/2024, 12:41 PMSauparna Gupta
08/22/2024, 12:41 PM-k, [--broker-token=BROKER_TOKEN]Dilip Punna
08/22/2024, 12:44 PMName: participant-test-plan-service
Display Name: Participant Test Plan Service
Main Branch: main
Updated At: '2024-05-15T15:12:19+00:00'
Created At: '2023-10-26T09:57:30+00:00'Sauparna Gupta
08/22/2024, 12:44 PMDilip Punna
08/22/2024, 12:45 PMName: responses-tracker
Display Name: Responses Tracker
Main Branch: main
Updated At: '2024-02-12T20:46:42+00:00'
Created At: '2024-02-12T20:46:41+00:00'Dilip Punna
08/22/2024, 12:45 PMmainBranch: trueSauparna Gupta
08/22/2024, 12:50 PMmain_branch: trueYousaf Nabi (pactflow.io)
order-serviceDilip Punna
08/22/2024, 2:55 PMcan you trymain_branch: true
I already tried this but it was only fetching up for these 3 StudyServiceProviderMessage, TestPlanLogicServiceMessageProvider, TestPlanLogicServiceMessageProvider not fetching the MyMessageProvider, TestPlanServiceMessageProviderDilip Punna
08/22/2024, 2:58 PMorders-message where it is consuming 5 servicesDilip Punna
08/22/2024, 3:14 PMorders-message versions control has the mainBranch set to master but the consumers version control for the mainBranch is always to main , so there are 2 different mainBranch names here, for provider it is using master and all the consumers mainBranch called main , i guess as long as the consumers are main for the mainBranch we should be good, correct?Dilip Punna
08/22/2024, 3:15 PMYousaf Nabi (pactflow.io)
orders-message?Dilip Punna
08/22/2024, 3:21 PMmain
Here is the log:
/usr/src/app/vendor/bundle/ruby/3.2.0/gems/io-event-1.3.2/lib/io/event/support.rb:24: warning: IO::Buffer is experimental and both the Ruby and C interface may change in the future!
DEPRECATION WARNING: ActiveSupport::PerThreadRegistry is deprecated and will be removed in Rails 7.1.
Use `Module#thread_mattr_accessor` instead.
(called from <top (required)> at /usr/src/app/config/application.rb:11)
SPEC_OPTS='' /usr/local/bin/ruby -S pact verify --pact-helper ./spec/contract/service_consumers/pact_helper_message.rb
/usr/src/app/vendor/bundle/ruby/3.2.0/gems/io-event-1.3.2/lib/io/event/support.rb:24: warning: IO::Buffer is experimental and both the Ruby and C interface may change in the future!
DEPRECATION WARNING: ActiveSupport::PerThreadRegistry is deprecated and will be removed in Rails 7.1.
Use `Module#thread_mattr_accessor` instead.
(called from <top (required)> at /usr/src/app/config/application.rb:11)
/usr/src/app/config/initializers/sidekiq.rb:67: warning: Sidekiq's Delayed Extensions will be removed in Sidekiq 7.0
AssetSync: using /usr/src/app/config/initializers/asset_sync.rb
PACT_BROKER_URL: <https://usertesting.pactflow.io/>
PACT_BROKER_TOKEN: **********************
GIT_SHA: abcc710ceff680f338f11cb2779b8ae321c6dd75
GIT_BRANCH: main
CI: true
CONFIG keys: ["A message with the Test Plan Published event", "A message with the Study Created event", "A message with the Study Context Updated event", "a STUDY_CREATED kafka event", "a STUDY_UPDATED kafka event", "a TEST_PLAN_PUBLISHED kafka event", "an ACCOUNT_CREATED message", "an ACCOUNT_MEMBERSHIP_USER_ADDED message", "an ACCOUNT_MEMBERSHIP_REMOVED message", "an ACCOUNT_MEMBERSHIP_UPDATED message", "a WORKSPACE_CREATED message", "a WORKSPACE_DELETED message", "a WORKSPACE_MEMBERSHIP_USER_ADDED message", "a WORKSPACE_MEMBERSHIP_UPDATED message", "a WORKSPACE_MEMBERSHIP_REMOVED message", "a TEST_PLAN_UPDATED kafka event"]
INFO: Fetching pacts for orders-message from <https://usertesting.pactflow.io/> with the selection criteria: latest from main branch
INFO: Reading pact at <https://usertesting.pactflow.io/pacts/provider/orders-message/consumer/participant-study-service/pact-version/0ceb7c9c8077f0631b6b404e3b867949047fdf93/metadata/c1tdW2xdPXRydWUmc1tdW2N2XT00NTIxNA>
WARN: Ignoring unsupported combine AND for path $['data']['study']['createdByUuid']
WARN: Ignoring unsupported combine AND for path $['data']['study']['productType']['type']
WARN: Ignoring unsupported combine AND for path $['data']['study']['studyContext']['accountUuid']
WARN: Ignoring unsupported combine AND for path $['data']['study']['title']
WARN: Ignoring unsupported combine AND for path $['data']['study']['uuid']
WARN: Ignoring unsupported combine AND for path $['id']
WARN: Ignoring unsupported combine AND for path $['data']['study']['testPlanUuid']
WARN: Ignoring unsupported combine AND for path $['data']['study']['uuid']
WARN: Ignoring unsupported combine AND for path $['id']
INFO: Reading pact at <https://usertesting.pactflow.io/pacts/provider/orders-message/consumer/permissions-service/pact-version/e37c088721e1b5b2e468fca3993fe6a95a557b91/metadata/c1tdW2xdPXRydWUmc1tdW2N2XT00NTk1Ng>
INFO: Reading pact at <https://usertesting.pactflow.io/pacts/provider/orders-message/consumer/test-plan-logic-service/pact-version/f80a1e8aa90f78a261951b65da55d8d42181e3d5/metadata/c1tdW2xdPXRydWUmc1tdW2N2XT00NzY5MA>
WARN: Ignoring unsupported combine AND for path $['data']['testPlan']['id']
WARN: Ignoring unsupported combine AND for path $['data']['testPlan']['logicNodes']
WARN: Ignoring unsupported combine AND for path $['data']['testPlan']['taskGroups']
WARN: Ignoring unsupported combine AND for path $['data']['testPlan']['tasks']
WARN: Ignoring unsupported combine AND for path $['data']['testPlan']['testPlanEntries']
WARN: Ignoring unsupported combine AND for path $['data']['testPlan']['uuid']
[33m[rspec-sidekiq] WARNING! Sidekiq will *NOT* process jobs in this environment. See <https://github.com/wspurgin/rspec-sidekiq/wiki/FAQ-&-Troubleshooting>[0m
DEBUG: The pact at <https://usertesting.pactflow.io/pacts/provider/orders-message/consumer/participant-study-service/pact-version/0ceb7c9c8077f0631b6b404e3b867949047fdf93> is being verified because the pact content belongs to the consumer version matching the following criterion:
* latest version from the main branch 'main' (2990ad33ff33540b487d0a414d888b3676530dc6)
Verifying a pact between participant-study-service and orders-message
Given a study has been created in orders
a STUDY_CREATED kafka event
Verifying message: a STUDY_CREATED kafka event
[32m has matching content[0m
Given a study has been updated in orders
a STUDY_UPDATED kafka event
Verifying message: a STUDY_UPDATED kafka event
[32m has matching content[0m
DEBUG: The pact at <https://usertesting.pactflow.io/pacts/provider/orders-message/consumer/permissions-service/pact-version/e37c088721e1b5b2e468fca3993fe6a95a557b91> is being verified because the pact content belongs to the consumer version matching the following criterion:
* latest version from the main branch 'main' (712b524f30d58ad24bfbebae43182e68db953d73)
Verifying a pact between permissions-service and orders-message
Given a workspace member has been updated
a WORKSPACE_MEMBERSHIP_UPDATED message
Verifying message: a WORKSPACE_MEMBERSHIP_UPDATED message
[32m has matching content[0m
Given an account has been created
an ACCOUNT_CREATED message
Verifying message: an ACCOUNT_CREATED message
[32m has matching content[0m
Given a workspace member has been added
a WORKSPACE_MEMBERSHIP_USER_ADDED message
Verifying message: a WORKSPACE_MEMBERSHIP_USER_ADDED message
[32m has matching content[0m
Given a workspace has been deleted
a WORKSPACE_DELETED message
Verifying message: a WORKSPACE_DELETED message
[32m has matching content[0m
Given a workspace member has been removed
a WORKSPACE_MEMBERSHIP_REMOVED message
Verifying message: a WORKSPACE_MEMBERSHIP_REMOVED message
[32m has matching content[0m
Given a workspace has been created
a WORKSPACE_CREATED message
Verifying message: a WORKSPACE_CREATED message
[32m has matching content[0m
Given an account membership has been updated
an ACCOUNT_MEMBERSHIP_UPDATED message
Verifying message: an ACCOUNT_MEMBERSHIP_UPDATED message
[32m has matching content[0m
Given an account membership has been created
an ACCOUNT_MEMBERSHIP_USER_ADDED message
Verifying message: an ACCOUNT_MEMBERSHIP_USER_ADDED message
[32m has matching content[0m
Given an account membership has been removed
an ACCOUNT_MEMBERSHIP_REMOVED message
Verifying message: an ACCOUNT_MEMBERSHIP_REMOVED message
[32m has matching content[0m
DEBUG: The pact at <https://usertesting.pactflow.io/pacts/provider/orders-message/consumer/test-plan-logic-service/pact-version/f80a1e8aa90f78a261951b65da55d8d42181e3d5> is being verified because the pact content belongs to the consumer version matching the following criterion:
* latest version from the main branch 'main' (ea8775a85efb2153771ceddfb063a210d0975b4f)
Verifying a pact between test-plan-logic-service and orders-message
Given a test plan has been updated in orders
a TEST_PLAN_UPDATED kafka event
Verifying message: a TEST_PLAN_UPDATED kafka event
[32m has matching content[0m
[32m12 interactions, 0 failures[0m
WARN: Ignoring unsupported combine AND for path $['data']['study']['createdByUuid']
WARN: Ignoring unsupported combine AND for path $['data']['study']['productType']['type']
WARN: Ignoring unsupported combine AND for path $['data']['study']['studyContext']['accountUuid']
WARN: Ignoring unsupported combine AND for path $['data']['study']['title']
WARN: Ignoring unsupported combine AND for path $['data']['study']['uuid']
WARN: Ignoring unsupported combine AND for path $['id']
WARN: Ignoring unsupported combine AND for path $['data']['study']['testPlanUuid']
WARN: Ignoring unsupported combine AND for path $['data']['study']['uuid']
WARN: Ignoring unsupported combine AND for path $['id']
WARN: Ignoring unsupported combine AND for path $['data']['testPlan']['id']
WARN: Ignoring unsupported combine AND for path $['data']['testPlan']['logicNodes']
WARN: Ignoring unsupported combine AND for path $['data']['testPlan']['taskGroups']
WARN: Ignoring unsupported combine AND for path $['data']['testPlan']['tasks']
WARN: Ignoring unsupported combine AND for path $['data']['testPlan']['testPlanEntries']
WARN: Ignoring unsupported combine AND for path $['data']['testPlan']['uuid']
INFO: Tagging version abcc710ceff680f338f11cb2779b8ae321c6dd75 of orders-message as "main"
INFO: Verification results published to <https://usertesting.pactflow.io/pacts/provider/orders-message/consumer/participant-study-service/pact-version/0ceb7c9c8077f0631b6b404e3b867949047fdf93/verification-results/73545>
INFO: Tagging version abcc710ceff680f338f11cb2779b8ae321c6dd75 of orders-message as "main"
INFO: Verification results published to <https://usertesting.pactflow.io/pacts/provider/orders-message/consumer/permissions-service/pact-version/e37c088721e1b5b2e468fca3993fe6a95a557b91/verification-results/73546>
INFO: Tagging version abcc710ceff680f338f11cb2779b8ae321c6dd75 of orders-message as "main"
INFO: Verification results published to <https://usertesting.pactflow.io/pacts/provider/orders-message/consumer/test-plan-logic-service/pact-version/f80a1e8aa90f78a261951b65da55d8d42181e3d5/verification-results/73547>Dilip Punna
08/22/2024, 3:22 PM3 services instead all of them 5 , those 2 services which i mentioned above unable to fetch for some reason when i have the mainBranch: trueYousaf Nabi (pactflow.io)
orders-messageDilip Punna
08/22/2024, 3:22 PMYousaf Nabi (pactflow.io)
DEBUG: The pact at <https://usertesting.pactflow.io/pacts/provider/orders-message/consumer/permissions-service/pact-version/e37c088721e1b5b2e468fca3993fe6a95a557b91> is being verified because the pact content belongs to the consumer version matching the following criterion:
* latest version from the main branch 'main'Yousaf Nabi (pactflow.io)
orders-message provider (but I don’t think it will)Yousaf Nabi (pactflow.io)
orders-messageDilip Punna
08/22/2024, 3:25 PM<https://usertesting.pactflow.io/pacticipants/participant-test-plan-service/versions/02c7c8067f6cddb952934a6180b84466b91991e7?branch=main> and we should see the provider orders-message ?Dilip Punna
08/22/2024, 3:28 PMorders-message under pacticipants for the missing consumers above.Dilip Punna
08/22/2024, 3:29 PMlook at each consumer application where the provider is failing to find pacts, and check the latest application version in the list for its main branch, it should reference theWhat might be the cause for not showing the application version not showing the latest asprovider (but I don’t think it will)orders-message
main ? Can you suggest?Yousaf Nabi (pactflow.io)
What might be the cause for not showing the application version not showing the latest asPossibly a consumer having multiple providers, and publishing each pact with a different version number (possibly suffixed with a service name) or for pact spec versions v3, you could not mix http and message pact services, so if you have a provider which does both, they should have distinct names for the http portion and the message portion. pact spec v4 allows for mixed interactions in a pact file, but pact ruby does not yet support it? Can you suggest?main
Dilip Punna
08/22/2024, 3:39 PMparticipant-test-plan-service acting like a provider and consumer with orders-message provider. At the same time. and responses-tracker service acting like a consumer for 2 different providers orders-message & participant-test-plan-serviceDilip Punna
08/22/2024, 3:44 PMresponses-tracker which is consuming from 2 different providers orders-message & participant-test-plan-service
name: Run contract tests
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, closed]
branches:
- main
env:
sub_application_name: "responsesTracker"
version: ${{ github.sha }}
pactfiles: "target/pacts"
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
PACT_BROKER_BASE_URL: "<https://usertesting.pactflow.io>"
PACT_BROKER_TOKEN: ${{ secrets.PACT_BROKER_TOKEN }}
jobs:
run-contract-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Contract Test
run: sbt -v clean +${{ env.sub_application_name }}/ContractTest/test
env:
GITHUB_TOKEN: "foobar"
GH_ANALYTICS_PACKAGES_TOKEN: ${{ secrets.GA_READ }}
- name: Upload pactfiles
uses: actions/upload-artifact@v4
with:
name: Pactfiles
path: ${{ env.pactfiles }}
publish-pacts:
needs: run-contract-tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download pactfiles
uses: actions/download-artifact@v4
with:
name: Pactfiles
path: ${{ env.pactfiles }}
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1.2
- name: Install pact_broker-client
run: gem install pact_broker-client
- name: Publish Pacts
run: |
for pactfile in responses-tracker-orders-message.json responses-tracker-participant-test-plan-service.json; do
CONSUMER_NAME=$(basename $pactfile .json)
CONSUMER_NAME=${CONSUMER_NAME#responses-tracker-}
CONSUMER_VERSION="${{ env.version }}-${CONSUMER_NAME}"
pact-broker publish ${{ env.pactfiles }}/$pactfile \
--consumer-app-version $CONSUMER_VERSION \
--branch ${{ env.BRANCH_NAME }} \
--broker-base-url ${{ env.PACT_BROKER_BASE_URL }} \
--broker-token ${{ env.PACT_BROKER_TOKEN }}
doneYousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
CONSUMER_VERSION="${{ env.version }}-${CONSUMER_NAME}"
--consumer-app-version $CONSUMER_VERSION
they should be the same 👍Yousaf Nabi (pactflow.io)
Dilip Punna
08/22/2024, 4:01 PMfor pactfile in responses-tracker-orders-message.json responses-tracker-participant-test-plan-service.json; do
pact-broker publish ${{ env.pactfiles }}/$pactfile \
--consumer-app-version ${{ env.version }} \
--branch ${{ env.BRANCH_NAME }} \
--broker-base-url ${{ env.PACT_BROKER_BASE_URL }} \
--broker-token ${{ env.PACT_BROKER_TOKEN }}
doneYousaf Nabi (pactflow.io)
Dilip Punna
08/22/2024, 4:03 PMDilip Punna
08/22/2024, 4:05 PMDilip Punna
08/22/2024, 4:05 PM-Yousaf Nabi (pactflow.io)
Dilip Punna
08/22/2024, 4:17 PM- 's and figure out the fix, correct?Yousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
Dilip Punna
08/22/2024, 4:22 PMYousaf Nabi (pactflow.io)
Dilip Punna
08/22/2024, 4:27 PMYousaf Nabi (pactflow.io)
Dilip Punna
08/22/2024, 4:44 PMDilip Punna
08/22/2024, 4:44 PMmain once this is mergedYousaf Nabi (pactflow.io)
branch: "RAD-xyz" in your providers consumer version selectors to see if it picks them both upYousaf Nabi (pactflow.io)
Dilip Punna
08/22/2024, 4:45 PMDilip Punna
08/22/2024, 4:48 PMresponses-tracker not both
DEBUG: The pact at <https://usertesting.pactflow.io/pacts/provider/orders-message/consumer/responses-tracker/pact-version/c9190d1a20d497a5e810efbe994581cde96590e7> is being verified because the pact content belongs to the consumer version matching the following criterion:
* latest version from branch 'RAD-32507-fix-publishing-contracts' (d47dc12b734785ab5d260066af608e2842ec02ef)Dilip Punna
08/22/2024, 4:48 PMYousaf Nabi (pactflow.io)
Dilip Punna
08/22/2024, 4:49 PMorders-message for the responses-tracker consumerDilip Punna
08/22/2024, 4:50 PMparticipant-test-plan-service will pick up the same consumer version selector for responses-tracker correct?Yousaf Nabi (pactflow.io)
orders-message wasn’t picking up.Dilip Punna
08/22/2024, 4:52 PMorders-message is a provider hereYousaf Nabi (pactflow.io)
participant-test-plan-service is both a provider to responses-tracker and a consumer or orders-message
your original query was that orders-message was not picking up both responses-tracker and participant-test-plan-serviceYousaf Nabi (pactflow.io)
participant-test-plan-service as well possibly (you haven’t shown that ci workflow)Dilip Punna
08/22/2024, 4:57 PMparticipant-test-plan-service CI flow
• It is a consumer of orders-message
• Provider to participant-video-service & responses-trackerDilip Punna
08/22/2024, 4:57 PMparticipant-test-plan-service
name: Pact Checks
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, closed]
branches:
- main
env:
CI: true
PACT_BROKER_TOKEN: ${{ secrets.PACT_BROKER_TOKEN }}
PACT_BROKER_BASE_URL: '<https://usertesting.pactflow.io>'
BRANCH: ${{ github.head_ref || github.ref_name }}
PUBLISH_VERIFICATION_RESULTS: true
VERSION: ${{ github.sha }}
jobs:
pact-checks:
permissions:
contents: read
packages: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
- name: Setup npm token
run: npm config set "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}"
- name: Install dependencies
run: npm ci
- name: Execute Pact contract tests (Consumer)
run: npm run test:contract:consumer
- name: Execute Pact contract tests (Provider)
run: npm run test:contract:provider
- name: Publish Pacts (Consumer POV)
run: |
npm run pact:broker:download --if-present
npm run pact:publish --if-present -- --consumer-app-version ${{ env.VERSION }} --branch ${{ env.BRANCH }} --broker-base-url ${{ env.PACT_BROKER_BASE_URL }} --broker-token ${{ env.PACT_BROKER_TOKEN }}
# - name: Can I Deploy Pacts (Consumer & Provider POV)
# run: |
# npm run pact:can-i-deploy --if-present -- --pacticipant participant-test-plan-service --version ${{ env.VERSION }} --broker-base-url ${{ env.PACT_BROKER_BASE_URL }} --broker-token ${{ env.PACT_BROKER_TOKEN }} --retry-while-unknown=10 --retry-interval=30Dilip Punna
08/22/2024, 4:58 PMcan-i-deploy just now until we understood the flow and it works correctlyYousaf Nabi (pactflow.io)
npm run pact:publish --if-present -- --consumer-app-version ${{ env.VERSION }} --branch ${{ env.BRANCH }} --broker-base-url ${{ env.PACT_BROKER_BASE_URL }} --broker-token ${{ env.PACT_BROKER_TOKEN }}
this looks ok although i’ve not seen the --if-present flag before used.
what is in the package.json under pact:publish?
can you check the view of that application, and check its main branch?Dilip Punna
08/22/2024, 5:01 PM"pact:publish": "pact-broker publish ./pacts/*.json",Yousaf Nabi (pactflow.io)
we are not doingthat makes sense, you can also run it in dry run mode so you can see if it works and gain confidence , before switching overjust now until we understood the flow and it works correctly (edited)can-i-deploy
Dilip Punna
08/22/2024, 5:01 PM"test:contract:consumer": "mocha -r ts-node/register 'test/contract/consumer/**/*.ts' --timeout 20000 --exit",
"test:contract:provider": "mocha -r ts-node/register 'test/contract/provider/**/*.ts' --timeout 20000 --exit",Dilip Punna
08/22/2024, 5:02 PMcan-i-deploy already in another PR, this is what is says
Computer says no ¯\_(ツ)_/¯
CONSUMER | C.VERSION | PROVIDER | P.VERSION | SUCCESS? | RESULT#
------------------------------|-----------------------------------------------------------------|-------------------------------|------------|----------|--------
participant-test-plan-service | 9c0b0b7... | orders-message | ??? | ??? |
participant-video-service | a41bcff... | participant-test-plan-service | 9c0b0b7... | true | 1
responses-tracker | ba3f6cc2b9b2f42b2787bd6752569d921c74233f-participant-test-pl... | participant-test-plan-service | 9c0b0b7... | true | 2
VERIFICATION RESULTS
--------------------
1. <https://usertesting.pactflow.io/pacts/provider/participant-test-plan-service/consumer/participant-video-service/pact-version/f9ba2fda0a19a88a73f5ed5a611754e97b5969e4/metadata/Y3ZuPWE0MWJjZmY5ZDdjNzNiN2M5Y2M1OGQ0NWY5MGEzOTMxM2UzYmM3MDg/verification-results/73298> (success)
2. <https://usertesting.pactflow.io/pacts/provider/participant-test-plan-service/consumer/responses-tracker/pact-version/40c76b20d00be4284c37539ed1dd38a97bfed695/metadata/Y3ZuPWJhM2Y2Y2MyYjliMmY0MmIyNzg3YmQ2NzUyNTY5ZDkyMWM3NDIzM2YtcGFydGljaXBhbnQtdGVzdC1wbGFuLXNlcnZpY2U/verification-results/73299> (success)
WARN: It is recommended to specify the environment into which you are deploying. Without the environment, this result will not be reliable.
There is no verified pact between version 9c0b0b7fef90ee36d58d246d4d3f6145608d11e2 of participant-test-plan-service and the latest version of orders-message (253267ca7294f9d843e6e06280a4c660a50f2519)
Error: Process completed with exit code 1.Dilip Punna
08/22/2024, 5:02 PMYousaf Nabi (pactflow.io)
participant-test-plan-serviceYousaf Nabi (pactflow.io)
Dilip Punna
08/22/2024, 5:05 PMparticipant-test-plan-service
options.consumerVersionSelectors = [{ consumer: consumerName, branch: "RAD-32507-fix-publishing-contracts" }];Yousaf Nabi (pactflow.io)
orders-message and its 5 consumers.
one of them is participant-test-plan-service
so lets first make a branch called RAD-32507-fix-publishing-contracts for participant-test-plan-service and push that commit
Once that is published to PactFlow, you can run your provider orders-message with branch: "RAD-32507-fix-publishing-contracts" locally, which will should now pick up the 2 previously missing consumers that you originally reported.
That would effectively fill in this result (once results are published to pactflow etc)
CONSUMER | C.VERSION | PROVIDER | P.VERSION | SUCCESS? | RESULT#
------------------------------|-----------------------------------------------------------------|-------------------------------|------------|----------|--------
participant-test-plan-service | 9c0b0b7... | orders-message | ??? | ??? |Dilip Punna
08/22/2024, 5:10 PMRAD-32507-fix-publishing-contracts for participant-test-plan-service and push that commit
Which commit we supposed to do at participant-test-plan-service ?Yousaf Nabi (pactflow.io)
main and pushing thatYousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
Dilip Punna
08/22/2024, 5:13 PMparticipant-test-plan-service and commit something, correcT?Yousaf Nabi (pactflow.io)
RAD-32507-fix-publishing-contracts
you might be able to get away with creating a new branch from master in your git UI, or you may need to actually create a new branch and make any type of commit.Dilip Punna
08/22/2024, 5:14 PMRAD-32507-fix-publishing-contract from responses-tracker service - FYIYousaf Nabi (pactflow.io)
orders-message (provider) and `participant-test-plan-service`(consumer)
this was one of the missing consumers. the other being responses-trackerYousaf Nabi (pactflow.io)
participant-test-plan-service is correctly publishing pact files, so that orders-message can discover themYousaf Nabi (pactflow.io)
participant-test-plan-service as a provider role.Yousaf Nabi (pactflow.io)
responses-tracker (consumer) publish pacts to RAD-32507-fix-publishing-contract
2. participant-test-plan-service (consumer) publish pacts to RAD-32507-fix-publishing-contract
3. orders-message (provider) uses branch: RAD-32507-fix-publishing-contract in consumer version selectors
4. orders-message discovers responses-tracker & participant-test-plan-service
5. Everybody celebratesDilip Punna
08/22/2024, 5:20 PMparticipant-test-plan-service (consumer) publish pacts to RAD-32507-fix-publishing-contract
What should i need to change here at this service?
npm run pact:publish --if-present -- --consumer-app-version ${{ env.VERSION }} --branch ${{ "RAD-32507-fix-publishing-contract" }} - this ?Yousaf Nabi (pactflow.io)
env:
CI: true
PACT_BROKER_TOKEN: ${{ secrets.PACT_BROKER_TOKEN }}
PACT_BROKER_BASE_URL: '<https://usertesting.pactflow.io>'
BRANCH: ${{ github.head_ref || github.ref_name }}
PUBLISH_VERIFICATION_RESULTS: true
VERSION: ${{ github.sha }}
how do you normally create a new branch and push the commit to your version control system?Yousaf Nabi (pactflow.io)
participant-test-plan-service view in pactflow, for the newly created branchDilip Punna
08/22/2024, 5:24 PMBRANCH: "RAD-32507-fix-publishing-contract"Yousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
Dilip Punna
08/22/2024, 5:28 PMBRANCH: ${{ github.head_ref || github.ref_name }}Yousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
--auto-detect-version-properties which will detect the version & branch for youDilip Punna
08/22/2024, 5:30 PMenv:
CI: true
PACT_BROKER_TOKEN: ${{ secrets.PACT_BROKER_TOKEN }}
PACT_BROKER_BASE_URL: '<https://usertesting.pactflow.io>'
BRANCH: ${{ github.head_ref || github.ref_name }}
PUBLISH_VERIFICATION_RESULTS: true
VERSION: ${{ github.sha }}Yousaf Nabi (pactflow.io)
--consumer-app-version <version> or --branch <branch>Dilip Punna
08/22/2024, 5:31 PM--auto-detect-version-properties ?Dilip Punna
08/22/2024, 5:31 PMnpm run pact:publish --if-present -- --auto-detect-version-properties --broker-base-url ${{ env.PACT_BROKER_BASE_URL }} --broker-token ${{ env.PACT_BROKER_TOKEN }} ?Yousaf Nabi (pactflow.io)
Dilip Punna
08/22/2024, 5:32 PMYousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
Dilip Punna
08/22/2024, 5:34 PMUpdated participant-test-plan-service version d239e7558fc6201247d6cdaf1ff0c207fdcc1c1e with branch xcanchal/fix/RAD-29690-contract-testing-iteration
Pact successfully published for participant-test-plan-service version d239e7558fc6201247d6cdaf1ff0c207fdcc1c1e and provider orders-message.
View the published pact at <https://usertesting.pactflow.io/pacts/provider/orders-message/consumer/participant-test-plan-service/version/d239e7558fc6201247d6cdaf1ff0c207fdcc1c1e>Dilip Punna
08/22/2024, 5:35 PMYousaf Nabi (pactflow.io)
xcanchal/fix/RAD-29690-contract-testing-iteration
to that set on the other service
RAD-32507-fix-publishing-contract
do you want to align them both?Yousaf Nabi (pactflow.io)
Dilip Punna
08/22/2024, 5:36 PMYousaf Nabi (pactflow.io)
orders-message can find them both with a single selectorYousaf Nabi (pactflow.io)
orders-message provider back to mainBranch 🙂 )Dilip Punna
08/22/2024, 5:37 PMxcanchal/fix/RAD-29690-contract-testing-iteration this is the working branch where i updated the CI flow changes to use auto-detect-version propertiesDilip Punna
08/22/2024, 5:39 PMRAD-32507-fix-publishing-contract and push the same commit againYousaf Nabi (pactflow.io)
orders-message provider, it should find all the consumers pactsYousaf Nabi (pactflow.io)
i will create a new branch from main calledGreat, this will just allow you to be sure yourand push the same commit agaiRAD-32507-fix-publishing-contract
orders-message consumer can find the two missing consumers, but I am sure it will just work once mergedDilip Punna
08/22/2024, 5:40 PMorders-message already by giving the consumer_version_selectors [{branch: "RAD-32507-fix-publishing-contracts"}] but it was still fetching one, not bothYousaf Nabi (pactflow.io)
participant-test-plan-service on that branch too?
we only did it for response-trackerDilip Punna
08/22/2024, 5:43 PMparticipant-test-plan-service on that branch too?
> yes this was done from this branch xcanchal/fix/RAD-29690-contract-testing-iterationDilip Punna
08/22/2024, 5:44 PMRAD-32507-fix-publishing-contracts at participant-test-plan-serviceDilip Punna
08/22/2024, 5:47 PMorders-message still fetching only responses-tracker not participant-test-plan-service sadDilip Punna
08/22/2024, 5:47 PMINFO: Fetching pacts for orders-message from <https://usertesting.pactflow.io> with the selection criteria: latest from branch RAD-32507-fix-publishing-contracts
INFO: Reading pact at <https://usertesting.pactflow.io/pacts/provider/orders-message/consumer/responses-tracker/pact-version/c9190d1a20d497a5e810efbe994581cde96590e7/metadata/c1tdW2JdPVJBRC0zMjUwNy1maXgtcHVibGlzaGluZy1jb250cmFjdHMmc1tdW2xdPXRydWUmc1tdW2N2XT00ODIyNg>
DEBUG: The pact at <https://usertesting.pactflow.io/pacts/provider/orders-message/consumer/responses-tracker/pact-version/c9190d1a20d497a5e810efbe994581cde96590e7> is being verified because the pact content belongs to the consumer version matching the following criterion:
* latest version from branch 'RAD-32507-fix-publishing-contracts' (d47dc12b734785ab5d260066af608e2842ec02ef)
Verifying a pact between responses-tracker and orders-message
A message with the test plan published event
has matching content
Given A study is created
A message with the Study Created event
has matching content
Given A study is created
A message with the Study Created event
has matching content
Given A study is created
A message with the Study Created event
has matching content
Given The study context is updated
A message with the Study Context Updated event
has matching content
Given The study context is updated
A message with the Study Context Updated event
has matching content
Given The study context is updated
A message with the Study Context Updated event
has matching contentYousaf Nabi (pactflow.io)
Dilip Punna
08/22/2024, 5:49 PMPlease update imports to @pact-foundation/pact-cli
<https://github.com/pact-foundation/pact-js-core/issues/488>
Updated participant-test-plan-service version 391dde4b2a62ba908c201f50092e5a3fd8a421c0 with branch RAD-32507-fix-publishing-contract
Pact successfully published for participant-test-plan-service version 391dde4b2a62ba908c201f50092e5a3fd8a421c0 and provider orders-message.
View the published pact at <https://usertesting.pactflow.io/pacts/provider/orders-message/consumer/participant-test-plan-service/version/391dde4b2a62ba908c201f50092e5a3fd8a421c0>
Events detected: contract_published (pact content is the same as previous versions with tags and no new tags were applied)
No enabled webhooks found for the detected eventsDilip Punna
08/22/2024, 5:50 PMpacticipant i need to check in pactflow UI?Yousaf Nabi (pactflow.io)
participant-test-plan-service pleaseDilip Punna
08/22/2024, 5:51 PMDilip Punna
08/22/2024, 5:51 PMresponses-tracker also there, it is hiding at the bottomYousaf Nabi (pactflow.io)
participant-test-plan-service as a consumer and orders-message as a provider, and the pact published to RAD-32507-fix-publishing-contract
That looks correct, so I am also confused as to why the provider orders-message cannot find it with `branch: RAD-32507-fix-publishing-contract in the consumer version selectors.
Can we check what you have set in the consumer version selectors on the orders-message provider?
Is it only the branch name?Yousaf Nabi (pactflow.io)
Dilip Punna
08/22/2024, 5:58 PMDilip Punna
08/22/2024, 6:00 PMorders-message consumerVersionSelectors
honours_pacts_from_pact_broker do
pact_broker_base_url pact_base_url, {token: token}
consumer_version_selectors [{branch: "RAD-32507-fix-publishing-contracts"}]Dilip Punna
08/22/2024, 6:01 PMmessage pacts from both the consumersDilip Punna
08/22/2024, 6:01 PMYousaf Nabi (pactflow.io)
require_relative "provider_states_participant_test_plan_service"
what does that contain?
is the name correct?
Pact.provider_states_for "Participant Test Plan Service" do
the test i did not in CI, but running locally though, is that makes any difference?This should be fine, if your token has access to that team where the pacts are published
Yousaf Nabi (pactflow.io)
Dilip Punna
08/22/2024, 6:04 PMYousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
Updated participant-test-plan-service version 391dde4b2a62ba908c201f50092e5a3fd8a421c0 with branch RAD-32507-fix-publishing-contract
contract signularYousaf Nabi (pactflow.io)
honours_pacts_from_pact_broker do
pact_broker_base_url pact_base_url, {token: token}
consumer_version_selectors [{branch: "RAD-32507-fix-publishing-contracts"}]
contracts pluralisedDilip Punna
08/22/2024, 6:04 PMDilip Punna
08/22/2024, 6:04 PMDilip Punna
08/22/2024, 6:04 PMDilip Punna
08/22/2024, 6:05 PMYousaf Nabi (pactflow.io)
Dilip Punna
08/22/2024, 6:17 PMDilip Punna
08/22/2024, 6:19 PMDilip Punna
08/22/2024, 6:19 PMcan-i-deploy what do you suggest?Dilip Punna
08/22/2024, 6:21 PM--auto-detect-version-properties ?Yousaf Nabi (pactflow.io)
and also for publishing pacts, do you want us to change for all the consumers to useup to you, but makes it consistent and easy for users to understand (but not need to know the mechanics behind branches/commits and how to get/parse them in their workflow)?--auto-detect-version-properties
regarding theuse environments, record versions of your application once they are deployed into an env use can-i-deploy with the --dry-run flagwhat do you suggest?can-i-deploy
When dry-run is enabled, always exit process with a success
code. Can also be enabled by setting the environment variable
PACT_BROKER_CAN_I_DEPLOY_DRY_RUN=true. This mode is useful when
setting up your CI/CD pipeline for the first time, or in a
'break glass' situation where you need to knowingly deploy what
Pact considers a breaking change. For the second scenario, it
is recommended to use the environment variable and just set it
for the build required to deploy that particular version, so
you don't accidentally leave the dry run mode enabled.
# Default: falseYousaf Nabi (pactflow.io)
Dilip Punna
08/22/2024, 6:45 PMDilip Punna
08/22/2024, 7:34 PMDilip Punna
08/23/2024, 12:21 PMreponses-tracker picked up but not the participant-test-plan-service when i run the orders-message provider verificationDilip Punna
08/23/2024, 12:48 PMpublish-pacts for participant-test-plan-service
Updated participant-test-plan-service version dfe43a44c6b852e03a5d30558d41f2adeaacaf8d with branch main
Pact successfully published for participant-test-plan-service version dfe43a44c6b852e03a5d30558d41f2adeaacaf8d and provider orders-message.
View the published pact at <https://usertesting.pactflow.io/pacts/provider/orders-message/consumer/participant-test-plan-service/version/dfe43a44c6b852e03a5d30558d41f2adeaacaf8d>
Events detected: contract_published (pact content is the same as previous versions with tags and no new tags were applied), contract_requiring_verification_published (pact content is the same as previous versions with tags and no new tags were applied)
Webhook "Orders - Verification" triggered for event contract_requiring_verification_published.
View logs at <https://usertesting.pactflow.io/triggered-webhooks/494d0c11-d522-454e-8aae-28fa38b30cb0/logs>Dilip Punna
08/23/2024, 12:52 PMDilip Punna
08/23/2024, 12:53 PMYousaf Nabi (pactflow.io)
Dilip Punna
08/23/2024, 12:57 PMDilip Punna
08/23/2024, 12:57 PMDilip Punna
08/23/2024, 12:58 PMorders-message to show on main now, i would expect to show automatically as soon as we publish the contracts on each PR run or merge etcYousaf Nabi (pactflow.io)
Events detected: contract_published (pact content is the same as previous versions with tags and no new tags were applied), contract_requiring_verification_published (pact content is the same as previous versions with tags and no new tags were applied)
Webhook "Orders - Verification" triggered for event contract_requiring_verification_published.
View logs at <https://usertesting.pactflow.io/triggered-webhooks/494d0c11-d522-454e-8aae-28fa38b30cb0/logs>
the version is only updated when you publish a new pact for that consumer. something else published a pact under a different version 35 minutes.Yousaf Nabi (pactflow.io)
Dilip Punna
08/23/2024, 1:33 PMDilip Punna
08/27/2024, 9:15 AMDilip Punna
08/27/2024, 10:45 AMSauparna Gupta
08/27/2024, 10:47 AMDilip Punna
08/27/2024, 10:52 AMparticipant-test-plan-service acting like a provider and consumer as shown in the screenshot. However since it is also consumer for orders-message service, right now on participant-test-plan-service main branch we don't see the latest version of orders-message . The latest thing we found from hereDilip Punna
08/27/2024, 10:54 AMSauparna Gupta
08/27/2024, 11:36 AMDilip Punna
08/27/2024, 11:52 AMmain from the consumer? Because of this we don't have a provider verification on branch main for the providerSauparna Gupta
08/27/2024, 11:58 AMDilip Punna
08/27/2024, 12:00 PMorders-message (provider) doesnt have a participant-test-plan-service (consumer) consumer version from mainSauparna Gupta
08/27/2024, 12:01 PMDilip Punna
08/27/2024, 12:31 PMmainBranchDilip Punna
08/27/2024, 12:31 PMmain only the participant-test-plan-service is missing since we dont have version for this service from mainSauparna Gupta
08/27/2024, 12:32 PMSauparna Gupta
08/27/2024, 12:33 PMSauparna Gupta
08/27/2024, 12:37 PMDilip Punna
08/27/2024, 12:40 PMworkflow_dispatch event which i can run manually from github actions by passing a specific consumer. Will it do the same?Sauparna Gupta
08/27/2024, 12:42 PMSauparna Gupta
08/27/2024, 12:43 PMDilip Punna
08/27/2024, 1:34 PMhonours_pacts_from_pact_broker do
pact_broker_base_url pact_base_url, {token: token}
consumer_version_selectors [{consumer: 'participant-test-plan-service', mainBranch: true}]
endDilip Punna
08/27/2024, 1:34 PMSauparna Gupta
08/27/2024, 1:36 PMDilip Punna
08/27/2024, 3:15 PMDilip Punna
08/27/2024, 3:15 PMDilip Punna
08/27/2024, 5:26 PMorders-message is picking up correctly now and all running 🎉Dilip Punna
08/27/2024, 5:30 PMcan-i-deploy , we still have some issues
There is no verified pact between the latest version of responses-tracker (efe0bd4a4d904622442fd00be7cdb5953e7922e7) and version 98dc2164cc843db389d8ed1ba6e164bbf70ed293 of participant-test-plan-service
Error: Process completed with exit code 1.
Computer says no ¯\_(ツ)_/¯
CONSUMER | C.VERSION | PROVIDER | P.VERSION | SUCCESS? | RESULT#
------------------------------|------------|-------------------------------|------------|----------|--------
participant-test-plan-service | 98dc216... | orders-message | faa0f82... | true | 1
participant-video-service | 5276954... | participant-test-plan-service | 98dc216... | true | 2
responses-tracker | efe0bd4... | participant-test-plan-service | ??? | ??? |
VERIFICATION RESULTS
--------------------
1. <https://usertesting.pactflow.io/pacts/provider/orders-message/consumer/participant-test-plan-service/pact-version/bb102df14d5bde4a336622904cf7acb8bc24919c/metadata/Y3ZuPTk4ZGMyMTY0Y2M4NDNkYjM4OWQ4ZWQxYmE2ZTE2NGJiZjcwZWQyOTM/verification-results/75061> (success)
2. <https://usertesting.pactflow.io/pacts/provider/participant-test-plan-service/consumer/participant-video-service/pact-version/a129dc4f121189051c484b5c2ce6c357e982f0c5/metadata/Y3ZuPTUyNzY5NTQyMDUwZTYwNGViMWEzY2E1NGY1MzM2YjU0YmY3ZWQ4N2I/verification-results/75067> (success)
WARN: It is recommended to specify the environment into which you are deploying. Without the environment, this result will not be reliable.
There is no verified pact between the latest version of responses-tracker (efe0bd4a4d904622442fd00be7cdb5953e7922e7) and version 98dc2164cc843db389d8ed1ba6e164bbf70ed293 of participant-test-plan-service
Error: Process completed with exit code 1.Dilip Punna
08/27/2024, 5:30 PMun npm run pact:can-i-deploy --if-present -- --pacticipant participant-test-plan-service --version 98dc2164cc843db389d8ed1ba6e164bbf70ed293 --broker-base-url <https://usertesting.pactflow.io> --broker-token *** --retry-while-unknown=10 --retry-interval=30Sauparna Gupta
08/27/2024, 8:04 PMDilip Punna
08/28/2024, 9:21 AMDilip Punna
08/28/2024, 9:23 AMfor pactfile in responses-tracker-orders-message.json responses-tracker-participant-test-plan-service.json; do
pact-broker publish ${{ env.pactfiles }}/$pactfile \
--auto-detect-version-properties \
--broker-base-url ${{ env.PACT_BROKER_BASE_URL }} \
--broker-token ${{ env.PACT_BROKER_TOKEN }}
doneDilip Punna
08/28/2024, 9:23 AM--auto-detect-version-properties here instead --versionSauparna Gupta
08/28/2024, 9:27 AMYousaf Nabi (pactflow.io)
Dilip Punna
08/28/2024, 9:33 AMpact-broker publish ${{ env.pactfiles }} \
--auto-detect-version-properties \
--branch ${{ env.BRANCH_NAME }} \
--broker-base-url ${{ env.PACT_BROKER_BASE_URL }} \
--broker-token ${{ env.PACT_BROKER_TOKEN }}Yousaf Nabi (pactflow.io)
Dilip Punna
08/28/2024, 9:36 AMparticipant-test-plan-service for orders-message service. I thought the above change for responses-tracker should fix by adding the --auto-detect versionsYousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
Dilip Punna
08/28/2024, 9:40 AMDilip Punna
08/28/2024, 9:42 AMresponses-tracker and added the --auto-detect flag instead the --consumer-version , let me know if you want me to merge that?Dilip Punna
08/28/2024, 9:43 AMYousaf Nabi (pactflow.io)
Dilip Punna
08/28/2024, 9:56 AMDilip Punna
08/28/2024, 9:56 AMDilip Punna
08/28/2024, 10:04 AMpact-broker verify --provider my-provider --broker-base-url <https://usertesting.pactflow.io> --broker-token <PACT_BROKER_TOKEN> - is this correct?Dilip Punna
08/28/2024, 10:39 AMYousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
Dilip Punna
08/28/2024, 10:46 AMresponses-tracker first? Since we are using for loop and --consumer-version tag hereDilip Punna
08/28/2024, 10:50 AMwhy does the latest main of part-test-plan-service not reference orders-message as a provider?It is disappeared again
Dilip Punna
08/28/2024, 11:13 AMparticipant-test-plan-service looking into the previous version instead the latest, looks like the latest version doesnt have orders-message provider verification again? Is it worth removing the latest version?Dilip Punna
08/28/2024, 11:25 AMDilip Punna
08/29/2024, 12:50 PMparticipant-test-plan-service, right now orders-message doesnt run verifications unless if the consumer participant-test-plan-service merged something on their main. Why is that? It doesnt happen to other consumers with orders-message but only with this service thinkingDilip Punna
09/02/2024, 1:34 PM