pact-foundation / pact_broker

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

Tag for most recent version of provider incorrectly says "more recent" version exists #348

Closed TAGC closed 3 years ago

TAGC commented 3 years ago

Our company is using a pact broker that I believe is hosted by https://pactflow.io/ (COMPANY.pact.dius.com.au). For one of our pacts, we've published a more recent version of the provider with a specific tag (prod_env) but the broker interface is showing an older version of the provider as being the "more recent version", as shown:

image

Do you know what might be causing this?

Software versions

Expected behaviour

Pacts with the provider version of 1.2.0 should be shown as representing the latest version of the prod_env tag. The tag should appear blue in the interface.

Actual behaviour

The tags associated with the pacts for provider 1.2.0 appear grey, and suggests a newer version of the provider exists even though it has a higher version number and was published more recently.

bethesque commented 3 years ago

I think this might answer your question: https://docs.pact.io/pact_broker/tags#handling-rollbacks

Have a look at the createdAt date for each of the version resources. If that doesn't resolve the issue, then please send an email to support@pactflow.io and I'll do some further debugging.

TAGC commented 3 years ago

Thanks, that worked. Looking at the /versions response data for the provider showed that v1.2.0 had been created back in March:

image

I did a deployment of v1.1.0 on that date, but Jenkins has a bug that causes it to incorrectly checkout origin/master as a local branch also called origin/master instead of just master. This confused GitVersion and presumably caused it to produce a semantic version of something like v1.2.0-origin-master0001 (instead of v1.1.0) which would have got published to the pact broker as v1.2.0. Even though the issue with the pipeline was later fixed and v1.1.0 published, I guess I forgot to remove v1.2.0 from the broker.

I deleted v1.2.0, re-ran the pact verification pipeline and manually re-tagged it with prod_env from the CLI tool. All looks good now.

bethesque commented 3 years ago

Glad you've resolved it. I've found the environment variables set by CI systems are more reliable and predictable than the responses from the git CLI. Which technique are you using?