Skip to main content

Keep a pact current from CI, and decide what a looser pact does

A pact recorded once goes stale, and a pact that quietly drops an expectation removes protection without anyone noticing. Generate a pact from a mock now has a fourth source, Keep it current from CI, so every build's pact is published under a policy you set once. See Keep it current from CI.

  • One step in the pipeline. apiome pact record --mock <project>/<version> --consumer … --publish -- npm test (or the GitHub Action's record command) records the tests' calls to the hosted mock and hands the pact to the mock's policy.
  • Publish when. The tests pass (the default) or Always. A run whose tests failed publishes nothing under the default and says so.
  • If the pact got looser — when it no longer expects an interaction or a response field the last pact did. Publish and tell me (the default) publishes it and tells the provider's and the consumer's owner teams, through the same owner routing as other Pact findings. Hold for review keeps it unpublished.
  • Held pacts are never lost. They wait under Held for review on the page, and the Contracts landing's status strip counts them. Review shows what the pact no longer expects first and its JSON second; Publish pact publishes exactly that document for the consumer version it was recorded for; Discard keeps it, marked discarded, with your note.
  • The last run, at a glance. The panel shows the last run's branch, version, interactions and whether the pact was unchanged, changed or looser.
  • REST. GET/PUT …/pact-recording/settings, GET …/pact-recording/held and …/held/{id}, POST …/held/{id}/approve and …/discard, and POST …/pact-broker/pacts/record, which apiome pact record --publish calls. Policy changes, runs and decisions are audited.