Ben Docherty
02/21/2024, 1:33 PMpact_helpers
(Ruby) to deal with both cases - this has been handled by tagging the consumer pacts as either REST
or message
. The problem arises in the provider pipeline when we set our consumer_version_selectors: we only want to verify the latest from the main branch of the consumers, but we want to combine this criteria with the existing tag implementation that we have for splitting REST
and Message
verification.
I'm guessing that our implementation of the REST
and Message
split is not the recommended way, so I'm wondering what is the preferred strategy for this case?Yousaf Nabi (pactflow.io)
-message
appended onto their name.
In that case, the consumer is probably okay to have the same name, for whether they are http or message based, but would just signify message based by changing the provider nameBen Docherty
02/21/2024, 2:13 PMBen Docherty
04/22/2024, 10:17 AMrequire "pact/provider/rspec"
is playing a role here also...
Pact.message_provider "<provider>-message" do
honours_pacts_from_pact_broker do
pact_broker_base_url pact_base_url, {token: token}
consumer_version_selectors [{mainBranch: true, latest: true}]
end
end
app_version provider_version
app_version_tags [provider_branch]
app_version_branch provider_branch
publish_verification_results publish_flag
builder do |message_description|
CONFIG[message_description].call
end
end
Pact.service_provider "<provider>-REST" do
honours_pacts_from_pact_broker do
pact_broker_base_url pact_base_url, {token: token}
consumer_version_selectors [{mainBranch: true, latest: true}]
end
end
app_version provider_version
app_version_tags [provider_branch]
app_version_branch provider_branch
publish_verification_results publish_flag
end