Maintaining a pact consumer contract published version through to deployment

33 Views Asked by At

I am working with a gitlab pipeline trying to meet the diamond model from pact.io.

I have contract test, publication, and verification for commit and merge request, and that publishes with the commit_sha version. Fine.

I then want to have the contract with the tag version when it is deployed. I don't see this in the diamond model, but if the provider webhooks need the release version (which it seems they do) it seems reasonable to have the same versioning on the consumer side of the pact.

I know record-deployment will update the release version ledger without updating the contract version, but do I really have to run a consumer test and publish again, this time with the tag version for the contract?

This means re-running the consumer test for an unchanged contract and a merged repository, which is counterintuitive.

Just for completeness I don't like the idea of retaining the contract artifact and republishing with the semantic release version, it sounds brittle and I like simple, maintainable code ...

We chose CI_COMMIT_SHA for commit and MR, and CI_COMMIT_TAG for versions after MR (i.e. semantic release version) which works for the trigger webhook for provider verification...

0

There are 0 best solutions below