How Swarmia links PRs to deployments

Linked PRs are used to calculate change lead time and time to deploy. The are also used to determine who owns the deployment.

A deployment can include one or more pull requests. These are used for two main purposes:

  1. Calculating the Change lead time and the Time to deploy metrics. If a deployment has no associated pull request, these two metrics will be unavailable.

  2. Defining a deployment's ownership. Deployments are attributed based on the authors of the PRs in the deployment. A deployment without pull requests won't appear in any team's DORA metrics (but will be counted on the organization level).

  3. Adding better visibility into your deployments. You can dig deeper into each deployment to see which changes (pull requests and the associated issues) were deployed to which environment and when.

How PRs are automatically linked to deployments

When Swarmia receives a new deployment, we perform an automatic pull request detection for it. The PRs linked to a deployment are determined from the list of merge commits that occurred between the new deployment and the immediate previous deployment on the same application and same environment.

Associating pull requests to deployments

What about monorepos?

When using monorepos, we offer additional fields to help track deployments. You can read more here:

Generate deployments for monorepos via the API

The logic to associate pull requests with deployments is quite similar when using the includedCommitShas field (field specification) in the deployment payload, except that instead of using the git diff between the current deployment and the previous one, we will use only the commits provided in the payload.

Last updated

Was this helpful?