Hi team, we are using Squash and Merge strategy fo...
# pact-broker
w
Hi team, we are using Squash and Merge strategy for merging PRs. We are also publishing contracts and running can-i-deploy in PR cycle. Our contracts version is set as the commit sha, so after merge the sha change and when we record deployment in deployment cycle we cannot use the deploy sha. I was considering resolving sha from git history, but it adds another logic layer (especially that we need to handle rollbacks). Therefore I was considering if there is any possibility to republish contracts (both consumer and provider) without running tests? I think running tests again in main cycle is redundant so time and resource consumption seems a bit waste. Any ideas how to handle that?
blob wave 1
y
the tests themselves are inexpensive to run, if a contract has already been verified, publishing the contract will result in a verified state. (it is pre-verified). This relies on the contract values being deterministic. The orchestration and waiting for the provider build to verify is an external wait time dep, but the pre verification means it is a no-op for a verified contract
thankyou 1
m
The typical advice is to re-run the tests and publish with the new SHA. As yousaf mentioned, the broker will know it’s the same contract and pre-existing results means it won’t require a re-verification. If you did have the pact files about, I guess you could re-publish them without running the tests again (as long as there is no chance the code has changed)?
thankyou 1
w
Thank you for the response. By expensive additional test run I was thinking about running tests again in the pipeline which includes setting up the env again, running the tests and then publishing again. But I understand that there is no other path so I will add this step in our workflow
👍 1
m
No probs!