PK
06/04/2024, 3:45 AMStephen Bell
06/13/2024, 11:08 PMGraham Pederson
06/14/2024, 6:55 PMPaolo Laurenti
06/17/2024, 6:53 AMJocelyn Lecomte
07/25/2024, 9:23 AMDiego Betancur
07/29/2024, 4:44 PMMegan Honig
07/30/2024, 6:56 PMYousaf Nabi (pactflow.io)
Cyrus Devnomad
08/21/2024, 8:25 AM...
docker pull pactfoundation/pact-cli:latest
docker run pactfoundation/pact-cli:latest pact-broker list-latest-pact-versions --output=json --broker-base-url=$PactBrokerBaseUrl --broker-username=$PactBrokerUsername --broker-password=$PactBrokerPassword
But I get the following error:
<internal:/usr/local/lib/site_ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require': cannot load such file -- pact_broker/client/pacts/list_latest_versions (LoadError)
from <internal:/usr/local/lib/site_ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
from /usr/lib/ruby/gems/3.3.0/gems/pact_broker-client-1.76.0/lib/pact_broker/client/cli/pact_commands.rb:44:in `list_latest_pact_versions'
from /usr/lib/ruby/gems/3.3.0/gems/thor-1.3.1/lib/thor/command.rb:28:in `run'
from /usr/lib/ruby/gems/3.3.0/gems/thor-1.3.1/lib/thor/invocation.rb:127:in `invoke_command'
from /usr/lib/ruby/gems/3.3.0/gems/thor-1.3.1/lib/thor.rb:527:in `dispatch'
from /usr/lib/ruby/gems/3.3.0/gems/thor-1.3.1/lib/thor/base.rb:584:in `start'
from /usr/lib/ruby/gems/3.3.0/gems/pact_broker-client-1.76.0/lib/pact_broker/client/cli/custom_thor.rb:34:in `start'
from /usr/lib/ruby/gems/3.3.0/gems/pact_broker-client-1.76.0/bin/pact-broker:10:in `<top (required)>'
from /usr/bin/pact-broker:25:in `load'
from /usr/bin/pact-broker:25:in `<main>'
Am I using the pact-cli command wrongly or is something wrong with that docker image?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
end
Dilip Punna
08/21/2024, 10:19 PMStudyServiceProviderMessage, PermissionsServiceProviderMessage, TestPlanLogicServiceMessageProvider
. Missing other 2 . So far I checked following below
• Check pactflow has the run from latest main ✅
• Check by changing consumer_version_selectors , tried all of them ✅
Not sure what else i can try? Please suggest what could be the reason here? thanksBertold Kolics
09/08/2024, 8:12 PMRoma Abrosimov
09/12/2024, 3:45 PMCannot publish verification for member_homepage as there is no link named pb:publish-verification-results in the pact JSON. If you are using a pact broker, please upgrade to version 2.0.0 or later
Please help with it or give an advice of what to do. Thanks
P.S.
I configured to send verification after performing test
publish_verification_results true
Dilip Punna
09/13/2024, 10:16 AMnpm 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 versionsTom Linford
09/16/2024, 4:22 PMpact-provider-verifier
--consumer-version-selector "{\"mainBranch\":true}"
--consumer-version-selector "{\"deployedOrReleased\":true}"
--enable-pending
...
We have a consumer for which we have never successfully verified their pact, making the pact we have with them "pending". When we run provider verification, the failures are correctly suppressed because of the --enable-pending
flag.
Today a new version of this consumer's pact was published to their main branch with a new request matcher rule in one of the interactions:
"path": {
"combine": "AND",
"matchers": [
{
"match": "regex",
"regex": ".*([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2}).*"
}
]
}
However, in their request they do not provide a path
, meaning that the regex will never match.
When we next ran provider verification as part of our CI/CD, this exception was thrown by the pact-provider-verifier
and caused our build to exit and fail:
.../pact/lib/vendor/ruby/3.3.0/gems/pact-support-1.20.0/lib/pact/term.rb:32:in `initialize': Value to generate "" does not match regular expression /.*([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2}).*/ (Pact::Error)
from .../pact/lib/vendor/ruby/3.3.0/gems/pact-support-1.20.0/lib/pact/matching_rules/v3/merge.rb:105:in `new'
from .../pact/lib/vendor/ruby/3.3.0/gems/pact-support-1.20.0/lib/pact/matching_rules/v3/merge.rb:105:in `handle_regex'
from .../pact/lib/vendor/ruby/3.3.0/gems/pact-support-1.20.0/lib/pact/matching_rules/v3/merge.rb:91:in `wrap'
...
Is there some reason why this exception was not caught and suppressed? The issue is with the request, which we (as the provider) have no control over.
Any advice would be appreciated! 😄Val Kolovos
09/19/2024, 10:40 PMYousaf Nabi (pactflow.io)
Roma Abrosimov
10/02/2024, 3:15 PMMarcus Couto
10/04/2024, 4:16 PMStanislav Vodetskyi
10/08/2024, 11:38 PM<path>/pact/lib/ruby/lib/ruby/3.3.0/json/common.rb:3: warning: ostruct was loaded from the standard library, but will no longer be part of the default gems starting from Ruby 3.5.0.
Siim Mardus
10/24/2024, 12:56 PMBearer ${authToken}
on Consumer side, and then pact verifier would replace it with a real token based on provider state when replaying the request. Was surprised to find that pact-ruby doesn't have it yet, but pleased to see that this has recently picked up attention again.
1. When can we expect those to come into latest version of pact-ruby?
2. Can you recommend a good branch/fork we could use for the time being, so that when the official release comes, we can switch over with minimal friction?Dilip Punna
11/06/2024, 2:04 PMfailIfNoPactsFound: false,
to pass for the pact provider verification when the verification is not implemented we want to skip the failure?Dilip Punna
11/18/2024, 11:40 AMRAELISON Zo Nofinidy
11/18/2024, 12:57 PMShakil Riyad
11/25/2024, 9:56 PMPietro Di Bello
12/17/2024, 11:23 AMTom Lopez
01/22/2025, 4:04 PMSpencer
02/11/2025, 3:34 PMDominik Krichbaum
02/26/2025, 2:22 PMMartin Mineo
03/07/2025, 1:16 PM