Skip to main content
Warning This document has not been updated for a while now. It may be out of date.
Last updated: 27 Apr 2022

govuk-pact-broker: Versioning

Out of the box, the Pact Broker allows uploading of pact files with semver style versions (eg 2.0.1). For our usage, we wanted to be able to upload pact files from various branches in addition to the released versions so that our branch builds of consumers can verify their pactfiles with the providers.

Pact Broker allows us to implement our own versioning scheme by providing a custom version parser. We've used this to extend the versioning scheme to allow branch builds to be uploaded as well. In addition to numeric versions, our scheme allows for "main", and "branch-foo" versions to be uploaded. These will always be ordered after any numeric versions, so the 'latest' pactfile from the Pact Broker's point of view will always be the highest numeric version.