Kerry McKeever
01/18/2023, 3:31 AMcreate-version-tag for my pacticipant version.
For reference, we're using GitHub Actions. I'm using the commit short SHA for my versioning, and the environment name as the tag.
Our general development flow is:
1. Commit PR and run tests
2. Squash and merge
3. Deploy (This is handled in a separate GitHub Action file)
My question is: When we squash and merge the PR into the target branch, the only commit reference for that branch is then the merge commit SHA, which doesn't align with the commit SHA that the contract was verified for. So what is the appropriate way to then run the create-version-tag command and reference the correct version for that particular environment?Boris
01/18/2023, 5:07 AMMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
If the contract is the same for both commits, the newer one will be pre-verified, so that doesn’t sound like a major sticking point.exactly. But to expand on this, the underlying assumption is that you should run the consumer contract test + publish steps (thus producing a new consumer version) in every build (even post merge). The contract should be pre-verified, and so you can deploy. If the second GitHub action doesn’t run the publish step, the version will be different and won’t have any published contracts to reference, to then determine compatibility with providers in the target environment.
Kerry McKeever
01/18/2023, 2:23 PMpact-can-i-deploy using the --to-environment=<environment> flag and forget the --to=<tag> flag, post-test, pre-merge
3. Merge
ON POST-MERGE/DEPLOY
1. Run the consumer test and publish on post-merge, pre-deploy
2. Run pact-can-i-deploy on post-merge, pre-deploy
3. Deploy
4. Run the record-deployment script post deploy (and skip create-version-tag altogether)
And do something similarly on the provider side?Beth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
Kerry McKeever
01/18/2023, 10:05 PM