GitHub Enterprise

You can now use the data from your GitHub Enterprise commits to help you find and fix bugs faster.

Configure GitHub Enterprise

Add new GitHub App

  1. Make sure you’ve whitelisted Sentry’s outbound request IPs addresses for your GitHub Enterprise instance.
  2. In your GitHub Enterprise organization, navigate to Settings > Developer Settings > GitHub Apps and click to add a new New GitHub App.

Register new GitHub App

  1. First, you’ll need to generate a webhook secret. For example, in terminal:

     openssl rand -base64 500 | tr -dc 'a-zA-Z0-9' | fold -w 64 | head -n 1
  2. Then in GitHub, fill out the form as follows and click Create GitHub App.

    GitHub App Name sentry-app
    Homepage URL
    User authorization callback URL
    Setup URL
    Webhook URL
    Webhook secret Input your secret from the previous step
    Repository Administration Read-only
    Commit Statuses No Access
    Deployments No Access
    Issues Read & Write
    Pages No Access
    Pull Requests Read-only
    Repository Contents Read-only
    Single File No Access
    Repository Projects No Access
    Organization members Read-only
    Organization projects No Access
    Subscribe to Events  
    Pull Request Yes
    Push Yes

Install your GitHub App

  1. In Sentry, navigate to Organization Settings > Integrations.
  2. Next to GitHub Enterprise, click Install.

  3. Click Add Installation.

  4. Fill out the following form with information from your GitHub apps configuration page.

    You’ll need to generate a private key on your GitHub apps configuration page, and paste the entire contents into the GitHub App Private Key field.

    For example, in terminal:

     cat <YOUR_PRIVATE_KEY_FILE> | pbcopy
  5. Click Configure and then a GitHub install window will pop up. Select which repositories Sentry should have access to (or select all repositories) and click Install.

  6. You will then be redirected back to Sentry. On your new GitHub Enterprise instance, click Configure.

  7. Add any repositories that you want to collect commit data from. Note: Make sure you have given Sentry access to these repositories in GitHub in the previous steps.

GitHub Enterprise should now be enabled for all projects under your Sentry organization.

Commit Tracking

Commit tracking allows you to hone in on problematic commits. Learn more about commit tracking.

Suspect Commits and Suggested Assignees

Once you set up commit tracking, you’ll be able to see the most recent changes to files found in the issue’s stack trace with suspect commits.

For issues where the files in the stack trace match files included in commits sent to Sentry, you’ll see the suspect commit, with a link to the commit itself.

You’ll also see that the author of the suspect commit will be listed as a suggested assignee for this issue. To assign the issue to the suggested assignee, click on their icon.

Issue Management

Issue tracking allows you to create GitHub issues from within Sentry, and link Sentry issues to existing GitHub Issues.

Once you’ve navigated to a specific issue, you’ll find the Linked Issues section on the right hand panel. Here, you’ll be able to create or link GitHub issues.

Resolving in Commit/Pull Request

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.