> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qawolf.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Deployments

> What a deployment carries when it reaches QA Wolf, how it resolves to an environment and a pull request, and the verdict recorded for each trigger.

A deployment trigger fires on a deployment QA Wolf received. Deployments arrive through the [GitHub](https://docs.qawolf.com/deployment-testing/github.md) or [GitLab](https://docs.qawolf.com/deployment-testing/gitlab.md) integration, or through [`deployment.reportStatus`](https://docs.qawolf.com/deployment-testing/webhook).

## What a deployment carries

| | GitHub | GitLab | `deployment.reportStatus` |
| - | - | - | - |
| Environment name | `environment` | `environment.name` | `environment.name` or `environment.id` |
| Deploy target URL | `environment_url` on the deployment status | `environment.url` | `deployTarget` |
| Preview | `transient_environment: true` | Name starts with `review/` | `environment.ephemeral: true` |
| Branch and commit | The deployed `ref` | The pipeline's commit | `metadata.ref`, `metadata.commitSha` |
| Repository | The deploying repository | The deploying project | `metadata.repository` |
| Pull request | Resolved from the deployed commit | Resolved from the deployed commit | `metadata.repository` with `metadata.pullRequestNumber` or `metadata.commitSha` |
| Service | Not reported | Not reported | `service` |

A deployment names a service when several applications deploy into one environment, or when one pipeline ships more than one build — an Android and an iOS build, say. `service` is what tells those deploys apart, and it is what a trigger's `servicePattern` matches on. A deployment that names no service never matches a trigger carrying a service pattern.

On `deployment.reportStatus`, the branch comes only from `metadata.ref`. A report with no `ref`, or with a commit sha as its `ref`, has no branch, and never matches a trigger's `branchPattern`.

## Environment

QA Wolf matches the environment name against the workspace's environments by alias or by slugified name. When nothing matches, it creates a new environment under that name.

A pipeline sending `prod-us` while the QA Wolf environment is named `production` creates a second environment that no trigger targets. Make the pipeline send the QA Wolf environment's name, or add the name it sends as an alias.

The preview flag decides what kind of environment gets created. A preview environment is torn down when its pull request closes. A permanent one is not. The flag defaults to permanent on every path, so a preview deploy that omits it leaves a permanent environment behind, once per pull request.

A `deployment.reportStatus` report that would create an environment needs `deployTarget`, and is refused without it. On GitHub and GitLab, a deploy with no URL creates an environment that keeps the base environment's URL.

## Previews

Each pull request needs its own environment name (`preview/pr-42`, `review/pr-42`) and its own deploy target URL. A shared environment name puts every pull request into the same QA Wolf environment. A shared URL under per-pull-request names passes silently: the trigger matches and the run executes against whatever was deployed last.

## Pull request

Linking a deployment to its pull request requires a connected GitHub or GitLab integration covering the deploying repository. `metadata.pullRequestNumber` names the pull request to read; it does not replace the integration. Without a pull request number, `metadata.repository` and `metadata.commitSha` find the pull request from the commit. `metadata.repository` has to match the connected repository's `owner/name` exactly. A report for a repository with no integration succeeds and carries no pull request. See [PR testing](https://docs.qawolf.com/deployment-testing/pr-testing.md).

## Evaluation

A deployment's first `success` status evaluates every trigger in the workspace. No later status does, and a trigger created or resumed afterwards is not evaluated against it. To evaluate a `deployment.reportStatus` deploy again, report it under a new `providerDeploymentId`.

QA Wolf records one verdict per trigger. `deployment.listTriggerEvaluations` returns them.

| State | Meaning |
| - | - |
| `not-evaluated` | No verdicts were recorded. No `success` status has arrived, evaluation is still in progress, the environment was terminated, or the workspace had no active trigger when the deploy succeeded. |
| `evaluated` | One verdict per trigger that existed at the time. |

| Verdict | Meaning |
| - | - |
| `not-considered`, `trigger-paused` | The trigger was paused. |
| `not-considered`, `not-a-deployment-trigger` | The trigger is a schedule. |
| `did-not-match` | A condition failed. Each condition is listed as `matched` or `did-not-match`, and each failure carries a reason. |
| `matched` | The trigger fired. The verdict carries a run outcome. |

| Run outcome | Meaning |
| - | - |
| `ran` | Names the run the trigger created. |
| `starting` | Run creation is in progress. |
| `did-not-run` | Carries a reason and a message. `no-pull-request` means a Smart Smoke Suite found no pull request on the deploy. `supersededByRunId` names a run an earlier delivery of the same deployment already created. |
| `unknown` | No record of what followed the match. |

Verdicts are a snapshot. Editing or deleting a trigger later does not change them. A verdict with no trigger id belongs to a trigger deleted since.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.