|
1 | 1 | ---
|
2 |
| -title: Enable Suspect Commits |
| 2 | +title: Suspect Commits |
3 | 3 | sidebar_order: 2
|
4 |
| -description: "Learn how to associate commits to a release to track suspect commits." |
| 4 | +description: "Learn how associating commits to a release allows you to track suspect commits." |
5 | 5 | ---
|
6 | 6 |
|
7 |
| -In your release process, add a step to create a release in Sentry and associate it with commits from your linked repository. We recommend using Sentry’s [Command Line Interface](/product/cli/releases/) or [our API](/product/releases/setup/manual-setup-releases/#using-the-api) to add this step in your release process, especially if you're using [Release Automation](/product/releases/setup/release-automation/). |
| 7 | +In your release process, you can add a step to create a release in Sentry and associate it with commits from your linked repository. When you've done this, you'll be able to see suspect commits and suggested assignees in issues, as well as resolve issues by commit, as described below. |
8 | 8 |
|
9 |
| -After this, we can tie together the commits in the release, including: |
| 9 | + |
| 10 | +If you're using one of our [release automation](/product/releases/setup/release-automation/) options or our [manual setup](/product/releases/setup/manual-setup-releases/) instructions, suspect commits should already be enabled. However, we've included directions for enabling suspect commits using the [Sentry CLI](#using-the-cli) and [our API](#using-the-api) at the end of this page, just in case you need them. |
| 11 | + |
| 12 | +## Suspect Commits & Suggested Assignees |
| 13 | + |
| 14 | +When you've enabled suspect commits, we can tie together the commits in the release, including: |
10 | 15 |
|
11 | 16 | - Files touched by those commits
|
12 | 17 | - Files observed in the stack trace
|
13 | 18 | - Authors of those files
|
14 | 19 | - The issue number in a commit message
|
15 | 20 |
|
| 21 | +Suspect commits and suggested assignees will then display on the **Issue Details** page in [sentry.io](https://sentry.io): |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | +## Resolve Issues by Commit |
| 26 | + |
| 27 | +Additionally, when you've enabled suspect commits, you'll be able to resolve issues by including the issue ID in your commit message. You can find the issue ID at the top of the **Issue Details** page, next to the assignee dropdown. |
| 28 | + |
| 29 | +A commit message might look like this, for example: |
| 30 | + |
| 31 | +```bash |
| 32 | +Prevent empty queries on users |
| 33 | + |
| 34 | +Fixes SENTRY-317 |
| 35 | +``` |
| 36 | + |
| 37 | +When Sentry sees this commit, we’ll reference the commit in the issue, and when you create a release in Sentry, we’ll mark the issue as resolved in that release. |
| 38 | + |
| 39 | +<Note> |
| 40 | + |
| 41 | +If you’re using GitHub, you may have a privacy setting enabled that prevents Sentry from identifying the user’s actual email address. To use the suggested owners feature, uncheck “Keep my email address private” in GitHub’s [account settings](https://github.com/settings/emails). |
| 42 | + |
| 43 | +</Note> |
| 44 | + |
| 45 | +## Enable Suspect Commits |
| 46 | + |
| 47 | +We recommend using Sentry’s [Command Line Interface](/product/cli/releases/) or [our API](/product/releases/setup/manual-setup-releases/#using-the-api) to add this step in your release process, whether you're doing this manually or using release automation. If you're using one of our [release automation](/product/releases/setup/release-automation/) options or our [manual setup](/product/releases/setup/manual-setup-releases/) instructions, this step should already be included, but we've included the relevant code below just in case. |
| 48 | + |
16 | 49 | This process assumes:
|
17 | 50 |
|
18 |
| -- the SDK is [configured to provide a release identifier](/platform-redirect/?next=/configuration/releases/) |
19 |
| -- [Source maps](/platforms/javascript/sourcemaps/) have been uploaded |
| 51 | +- The SDK is [configured to provide a release identifier](/platform-redirect/?next=/configuration/releases/) |
| 52 | +- Source maps — or your platform-specific files for mapping transformed source code to the original source — have been uploaded (check out the docs for your [specific platform](/platforms/)) |
20 | 53 |
|
21 |
| -## Using the CLI |
| 54 | +### Using the CLI |
22 | 55 |
|
23 |
| -In this CLI example: |
24 |
| -- Environment variables configure the CLI (see [Working with Projects](/product/cli/configuration/#sentry-cli-working-with-projects) for alternatives) |
25 |
| -- The `propose-version` sub-command determines a release ID automatically |
26 |
| -- A release tagged `VERSION` is created for the organization `my-org` for projects (`project1` and `project2`) |
27 |
| -- The `--auto` flag determines the repository name automatically, and associates commits between the previous release’s commit and the current head commit with the release. |
| 56 | +In this CLI example, the `--auto` flag determines the repository name automatically, and associates commits between the previous release’s commit and the current head commit with the release. |
28 | 57 |
|
29 | 58 | <Note>
|
30 | 59 |
|
@@ -53,47 +82,7 @@ The following example associates commits (or refs) between `from` and `to` with
|
53 | 82 | sentry-cli releases set-commits --commit "[email protected]" $VERSION
|
54 | 83 | ```
|
55 | 84 |
|
56 |
| -For more information, see our [CLI docs](/product/cli/releases/). |
57 |
| - |
58 |
| -After this step, suspect commits and suggested assignees will display on the Issues page. |
59 |
| - |
60 |
| - |
61 |
| - |
62 |
| -Additionally, you will be able to resolve issues by including the issue ID in your commit message. You can find the issue ID at the top of the Issue Details page, next to the assignee dropdown. For example, a commit message might look like this: |
63 |
| - |
64 |
| -```bash |
65 |
| -Prevent empty queries on users |
66 |
| - |
67 |
| -Fixes SENTRY-317 |
68 |
| -``` |
69 |
| - |
70 |
| -When Sentry sees this commit, we’ll reference the commit in the issue, and when you create a release in Sentry we’ll mark the issue as resolved in that release. |
71 |
| - |
72 |
| -<Note> |
73 |
| - |
74 |
| -If you’re using GitHub, you may have a privacy setting enabled that prevents Sentry from identifying the user’s actual email address. To use the suggested owners feature, uncheck “Keep my email address private” in GitHub’s [account settings](https://github.com/settings/emails). |
75 |
| - |
76 |
| -</Note> |
77 |
| - |
78 |
| -### Finalize the Release |
79 |
| - |
80 |
| -By default, a release is created as “unreleased”. Finalizing a release means that we populate a second timestamp on the release record, which is prioritized over `date_created` when sorting releases in sentry.io. Release finalization (and the timestamp) also affects: |
81 |
| -- What counts as "the next release" for resolving issues |
82 |
| -- Which release is used as the base for associating commits if you use `--auto` |
83 |
| -- Creates an entry in the Activity stream |
84 |
| - |
85 |
| -You can change this by passing either `--finalize` to the `new` command, which will immediately finalize the release, or by separately calling `sentry-cli releases finalize VERSION` later on, which is useful if you are managing releases as part of a build process. |
86 |
| - |
87 |
| -You can also choose to finalize the release when you've made the release live (such as when you've deployed to your machines or enabled in the App store). |
88 |
| - |
89 |
| -```bash |
90 |
| -#!/bin/sh |
91 |
| -sentry-cli releases new "$VERSION" |
92 |
| -# do your build steps here |
93 |
| -# once you are done, finalize |
94 |
| -sentry-cli releases finalize "$VERSION" |
95 |
| -``` |
96 |
| -## Using the API |
| 85 | +### Using the API |
97 | 86 |
|
98 | 87 | <Note>
|
99 | 88 |
|
|
0 commit comments