Hi all We're using bi-directional testing with th...
# pactflow
b
Hi all We're using bi-directional testing with the provider contract coming from an OpenApi schema. We're finding that Pactflow is very slow to run comparisons and I think this is because it looks like every version of a provider/consumer contract is getting compared with all previous versions. Is there a way to tell Pactflow to only compare the latest versions or the version running in a particular environment? Or can we tell it to only run comparisons on demand? Or is there a way to delete versions that are over a certain age?
m
I’ll follow up the logic here, I thought it only compares the heads of branches and deployed environments (if so, deleting the branch using the delete branch API could be a way to resolve it). The current comparison process is slow, but we have some work on our backlog to rewrite the engine that does this (we’re spiked a new approach and get 10-20x performance increases on average). What makes you think it’s comparing every permutation? (you might be right)
b
The Pactflow dashboard very much suggests that it's comparing every version on live branches:
image.png
I have also found that if I delete all previous versions that comparisons are significantly faster
m
We are currently checking: currently deployed currently released main branch most recent overall last 10 branch heads
Deleting inactive branches could help (see https://docs.pact.io/blog/2024/02/21/deleting-branches-automatically). We probably could drop that last check, or reduce to a smaller number
b
Looks like more than the last 10!
image.png
This is on main branch btw. We do already delete inactive branches. We're basically just keeping main. We still don't need it to check all version history on main though. It would be nice if anything but the latest/deployed was compared on demand or was configurable.
m
Thanks, perhaps the logic has changed since we last documented that. I'll look into this
🙌 1
@phanindra srungavarapu FYI