pact-foundation / pact_broker

Enables your consumer driven contracts workflow
http://pactflow.io
MIT License
705 stars 173 forks source link

fallbackBranch consumer version selector property not behaving as expected #587

Open petenattress opened 1 year ago

petenattress commented 1 year ago

Pre issue-raising checklist

I have already (please mark the applicable with an x):

Software versions

Expected behaviour

Hi I have published a single Pact contract for provider my-provider to my local broker on branch develop. When sending the following request:

POST localhost/pacts/provider/my-provider/for-verification

{"consumerVersionSelectors": [{"branch": "not-a-branch", "fallbackBranch": "develop"}],  "includePendingStatus": false}

I am expecting the broker to return the contract because even though not-a-branch won't match anything, the fallback branch should be used instead (as per documentation). However, the response contains no contracts. I know the broker definitely has a contract for this branch because the request:

POST localhost/pacts/provider/my-provider/for-verification

{"consumerVersionSelectors": [{"branch": "develop"}],  "includePendingStatus": false}

Correctly returns the contract. Do I need to do something else or am I misinterpreting the docs?

Many thanks.

Osmyslitelny commented 11 months ago

+1. Have the same situation