pact-foundation/pact_broker

fallbackBranch consumer version selector property not behaving as expected

petenattress opened this issue · 1 comments

Pre issue-raising checklist

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

  • Upgraded to the latest Pact Broker OR
  • Checked the CHANGELOG to see if the issue I am about to raise has been fixed
  • Created an executable example that demonstrates the issue using either a:
    • Dockerfile
    • Git repository with a Travis or Appveyor (or similar) build

Software versions

  • pact-broker docker version: 2.105.0.1

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.

+1. Have the same situation