Back to Blog Home

Releases Are Better With Commits

Jess MacQueen image

Jess MacQueen -

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

You can also resolve issues with pull requests by including fixes <SHORT-ID> in the title or description.

When Sentry sees this, we’ll automatically annotate the matching issue with a reference to the commit or pull request, and, later, when that commit or pull request 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. And, whether you want to debug Node, do Ruby error tracking, or handle an obscure Java exception, you can get started fast with Sentry.

Share

Share on Twitter
Share on Facebook
Share on HackerNews
Share on LinkedIn

Published

Sentry Sign Up CTA

Code breaks, fix it faster

Sign up for Sentry and monitor your application in minutes.

Try Sentry Free

Topics

Error Monitoring

New product releases and exclusive demos

Listen to the Syntax Podcast

Of course we sponsor a developer podcast. Check it out on your favorite listening platform.

Listen To Syntax
    TwitterGitHubDribbbleLinkedinDiscord
© 2024 • Sentry is a registered Trademark of Functional Software, Inc.