Releases Are Better With Commits

Knowing what code changed recently is extremely helpful in determining the cause of an error, which is why we’ve expanded our Releases feature to support commit data. By integrating commit data, you’ll unlock a number of helpful features:

  • Enhanced releases overview page that allows you to see new and resolved issues, files changed and authors all in the same place (see photo below)
  • Resolving Sentry issues via commit messages
  • Suggested assignees for issues
  • Detailed deploy emails (look out for a more in-depth look at deploys in Sentry soon)
Releases Overview

Connecting a repository

To get started, go to your organization’s dashboard, click “Repositories” and then click “Add Repository.” This will create a webhook and we’ll start collecting commit data, which you can then reference in releases.

Add a repo

Adding commits to releases

To indicate which commits are part of a release, you simply send along a refs attribute when creating a release. In the below example, we’re telling Sentry that this release contains the my-repo repository, in which the current version (HEAD) is 2da95dfb052f477380608d59d32b4ab9. When you send this information, we’ll figure out which commits are part of the release based on your git history and previous releases.

# Create a new release
curl https://sentry.io/api/0/organizations/:organization_slug/releases/ \
  -X POST \
  -H 'Authorization: Bearer {TOKEN}' \
  -H 'Content-Type: application/json' \
  -d '
  {
    "version": "2da95dfb052f477380608d59d32b4ab9",
    "refs": [{
        "repository":"my-repo",
        "commit":"2da95dfb052f477380608d59d32b4ab9"
    }],
    "projects":["my-project","my-other-project"]
}
'

Resolving issues via commits

Once you are sending commit data, you can start resolving issues by including fixes <SHORT-ID> in your commit messages. For example, a commit message might look like:

Prevent empty queries on users

Fixes MYAPP-317

When Sentry sees this, we’ll automatically annotate the matching issue with a reference to the commit, and, later, when that commit is part of a release, we’ll mark the issue as resolved.

Stay tuned

We’ll have a series of posts about the new features we’ve added to our releases workflow. In the meantime, you can check out our docs for more details on how to get started. As always, let us know what you think on the Sentry forum.