Skip to main content

Commit statuses

Apiome puts the verdict of each consumer ↔ provider pair on the commit it is about. The pull request then shows it next to its other checks, and a branch protection rule can require it:

  • When a consumer publishes a pact, its commit gets pending — Pact awaiting verification by Ledger API. If the provider's main branch has already verified this exact pact, the commit gets that verdict at once.
  • When a verification result arrives, from your own verifier or from hosted verification, both commits get success or failure: the provider's commit (the version that verified) and the consumer's commit (the version that published the pact).

Each status is named apiome-pact/<consumer>/<provider>, such as apiome-pact/billing-service/ledger-api, on both repositories. A newer verdict for the same pair replaces the status on that commit instead of adding another one. The status links to the pact or to the verification result.

Before you start​

  1. Register each repository under Repositories with a linked GitHub or GitLab account. Apiome writes the status with that account's token, so the account needs permission to write commit statuses (GitHub: the repo scope or Commit statuses: write; GitLab: the Developer role). Apiome never asks for a token for this.

  2. Set each pacticipant's repository URL to the same repository, either when you register the pacticipant or later with PATCH:

    curl -X PATCH https://api.apiome.dev/v1/tenants/acme/pacticipants/billing-service \
    -H "X-API-Key: sk_live_…" \
    -H "Content-Type: application/json" \
    -d '{"repository_url": "https://github.com/acme/billing-service"}'

    Case, a trailing / and a .git suffix don't matter.

  3. Use the commit SHA as the version number when you publish and verify. This is the usual Pact convention, such as --consumer-app-version "$GITHUB_SHA" and --provider-app-version "$GITHUB_SHA" (see Run Pact in CI).

Statuses go to repositories on github.com and gitlab.com.

What the commit shows​

EventCommitState (GitHub · GitLab)Description
A pact is publishedconsumerpending · pendingPact awaiting verification by provider
A pact the provider's main branch already verified is publishedconsumerthat verdictPact verified by provider version
A verification passesprovider and consumersuccess · successPact verified by provider version / Pact with consumer version verified
A verification failsprovider and consumerfailure · failedPact failed verification by provider version / Pact with consumer version failed verification

A failed verification of a pending pact is still reported as a failure on the commit. The pending rule only decides whether the verifier's own exit code fails the build.

A bi-directional verdict posts its statuses only when For bi-directional verdicts too is on (it is off by default). It then also fires its provider_verification_* webhooks, as a published verification does. Either way the verdict is in the matrix and in can-i-deploy.

Choose which statuses are written​

In Contracts, click Settings, then the CI and commit statuses tab.

The CI and commit statuses tab: three switches (on the consumer's commit and on the provider's commit on, for bi-directional verdicts too off) with Save switches; pipeline recipes for GitHub Actions, GitLab CI, Jenkins and Azure Pipelines; and the broker address with PACT_BROKER_BASE_URL and PACT_BROKER_TOKEN.The CI and commit statuses tab: three switches (on the consumer's commit and on the provider's commit on, for bi-directional verdicts too off) with Save switches; pipeline recipes for GitHub Actions, GitLab CI, Jenkins and Azure Pipelines; and the broker address with PACT_BROKER_BASE_URL and PACT_BROKER_TOKEN.
Route/ade/dashboard/pacts/settings?tab=ci
  1. Turn On the consumer's commit and On the provider's commit on or off. Both are on by default.
  2. Turn on For bi-directional verdicts too to give spec comparisons statuses and webhooks.
  3. Click Save switches.

A status a switch keeps off is still recorded, with the outcome suppressed and the reason pact-status-switched-off, so the list says why the commit has none. The switches need the Contracts admin permission (pacts:delete); everyone else sees them read-only. The same request from a script is PUT /v1/tenants/{tenant}/pact-contract-settings/commit-statuses with {"consumer_commit": true, "provider_commit": true, "bidirectional": true}.

When a status isn't sent​

Nothing is dropped silently. Every verdict is recorded, and one that could not be sent is recorded with the reason:

reason_codeWhat it meansWhat to do
pact-status-no-repositoryThe pacticipant has no repository URLSet repository_url
pact-status-version-not-a-commitThe version number, such as 1.4.0, is not a commit SHAPublish with the commit as the version
pact-status-repository-not-registeredNo registered repository matches the URLRegister it under Repositories
pact-status-provider-unsupportedThe repository is on Bitbucket or a self-hosted host—
check-provider-forbiddenNo stored credential, or the provider refused the accountRe-link the account, or give it write access
check-provider-unavailableThe provider could not be reached, or rate-limited the requestRetry
check-publishing-disabledStatus publishing is off for this deployment (APIOME_PROVIDER_CHECKS_ENABLED=false)Ask your administrator
pact-status-switched-offThe workspace switched this kind of status offTurn it on in Settings → CI and commit statuses

A status that was never attempted has the outcome suppressed. One that the provider refused or could not take has the outcome failed. A problem with a status never fails the publish or the verification that caused it.

List and retry statuses​

List what was posted, newest first. Filter by pacticipant, version or outcome. You need Pacts → View:

curl "https://api.apiome.dev/v1/tenants/acme/pact-commit-statuses?outcome=suppressed" \
-H "X-API-Key: sk_live_…"
{
"items": [
{
"id": "6f1c…",
"pacticipant": "billing-service",
"version": "4f2a9c1e0b7d3a6f5c8e9d0b1a2c3d4e5f6a7b8c",
"consumer": "billing-service",
"provider": "ledger-api",
"side": "consumer",
"context": "apiome-pact/billing-service/ledger-api",
"state": "pending",
"description": "Pact awaiting verification by Ledger API",
"outcome": "suppressed",
"reason_code": "pact-status-repository-not-registered",
"message": "No repository registered in this workspace matches https://github.com/acme/billing-service; …",
"attempts": 0
}
],
"next_cursor": null
}

After you fix the cause, send a suppressed or failed status again. You need Pacts → Edit:

curl -X POST https://api.apiome.dev/v1/tenants/acme/pact-commit-statuses/6f1c…/retry \
-H "X-API-Key: sk_live_…"

A retry checks again where the status can go, so it is sent once the repository is registered or the account is linked. A status that was already accepted returns 409 pact-status-not-retryable. Both endpoints read only your workspace's statuses. These endpoints take a Full access key; the Pact key presets cover the broker routes only. Every field is in the REST reference.