Skip to main content

Pact detail

A pact holds the interactions one version of a consumer expects of its provider. The Pact page shows one pact: its interactions with their provider states, requests and responses, how providers verified it, and what changed since the previous different pact. For the terms, see Pacticipants and versions.

The page only reads. To publish a pact, see Publish pacts; to verify one, see Verification.

Before you start​

  • You hold Pacts → View. Without it, the page shows Permission denied.
  • The consumer has published a pact for the provider.

Open a pact​

  1. In the rail, under Ship, click Contracts.
  2. Click a pacticipant's name to open its page. See Pacticipants.
  3. In Pacts, click a pact, for example Billing Service → Ledger API.

The page opens the latest pact of the consumer and provider. To share a pact of one version, copy the address: it ends with ?version= and the consumer version, for example /ade/dashboard/pacts/pacticipants/billing-service/pacts/ledger-api?version=1.4.0.

The Billing Service → Ledger API pact page: the Overview facts, the verification status Verified with two provider versions, one interaction added, one changed and one removed since version 1.3.2, and the first interaction.The Billing Service → Ledger API pact page: the Overview facts, the verification status Verified with two provider versions, one interaction added, one changed and one removed since version 1.3.2, and the first interaction.
Route/ade/dashboard/pacts/pacticipants/billing-service/pacts/ledger-api

The page has five sections.

Overview​

FactWhat it shows
Consumer and ProviderThe two pacticipants. Each links to its page.
Consumer versionThe consumer version that published this pact.
Pact versionThe first 12 characters of the content SHA. Every consumer version that published the same content shares it.
SpecificationThe Pact specification the pact is written in, for example Pact 3.0.0.
PublishedWhen the consumer version published the pact, in UTC.
InteractionsHow many interactions of each kind the pact has, for example 3 HTTP, 1 message.

Verification status​

The badge next to the heading is the verdict of the newest verification result:

VerdictMeaning
VerifiedThe newest result passed.
FailedThe newest result failed.
Failed (pending)The newest result failed, but the pact was pending, so the provider's build did not fail.
Not verified yetNo provider has published a result for this pact.

The table lists every provider version that verified the pact, newest first. Each row shows the provider version and its branch, whether it Passed or Failed, whether the pact was Pending or Work in progress for that verifier, how the result was reached (a Pact verifier, or a Bi-directional comparison), and when.

Click Results and logs next to the heading to open the provider's Verification page for this consumer: every result with its expected and actual values, its log, and Re-run.

If no provider has verified the pact yet, the section shows the command that replays it against a registered verification target:

apiome pact verify --provider "Ledger API" --provider-app-version "$GIT_COMMIT" --target staging

Changes since the previous pact​

This section compares the pact with the previous different pact: the newest earlier consumer version whose pact content differs. Earlier versions that published the same content are skipped. The count next to the heading reads, for example, 1 added, 1 changed, 1 removed, 2 unchanged.

  • Added interactions are new in this pact.
  • Changed interactions are in both pacts with different content. Each changed value is listed with its path and its old and new values, for example response.body.amount "120.50" → 120.5. Up to 50 values are listed for each interaction.
  • Removed interactions were in the previous pact and are not in this one.

An interaction is matched by its kind, its description and the names of its provider states. If you rename an interaction or change its provider states, it reads as one removed and one added. A change to a provider state's parameters reads as a changed value.

Click the previous version's number to open its pact.

When there is nothing to compare, the section says why:

  • This is the first pact of the consumer and provider.
  • Every earlier version published the same pact.
  • The 20 versions before this one published the same pact. Older versions are not compared.
  • The version is older than the history the page reads (see History).

Interactions​

Every interaction of the pact, in the order it was written. Each row shows the description, a summary such as GET /invoices/INV-42 → 200, and its kind: HTTP, Message or Synchronous message. An interaction that is new or changed since the previous pact is marked New or Changed. A pending interaction (Pact V4) is marked Pending.

Click an interaction, or press Enter on it, to open it:

  • Provider states lists each state the interaction needs, as Given and the state's name, with its parameters.
  • For an HTTP interaction, Request shows the method, path and query, the headers and the body; Response shows the status, the headers and the body.
  • For a message, Message shows its metadata and contents. A synchronous message shows its Request and each Response.

If the pact has an interaction of a type Apiome does not draw, such as a plugin interaction, it is marked Not drawn and shows its JSON as published, with the reason. It is never left out.

History​

The consumer versions that published a pact for this provider, newest first, with their branch, when they published it, and their verification verdict. The open version is marked (open). Click another version's number to open its pact.

The page reads the newest 500 verification results of the consumer and provider. If there are more, the count reads, for example, 120+ versions, and older versions are not listed.

When a section cannot be read​

Each section loads on its own. If one cannot be read, it shows the reason and Try again, and the other sections still show.

If the consumer has no pact for the provider, the page says No pact yet and shows the command that publishes one:

apiome pact publish ./pacts \
--consumer-app-version "$GIT_COMMIT" \
--branch "$GIT_BRANCH"

A consumer version that contains / cannot be opened on this page; the page says so instead of opening a different version.

Who can do what​

ActionPermission
Open a pact and its historyPacts → View

Every read is scoped to your current workspace.