Development Environment

Setting up Your Development Environment


Follow the Docker file in the repository but instead of creating and installing a wheel, install the package in editable mode (pip install . -e).

Macintosh OS X

To get started, fork the repo at and clone it:

git clone<your github username>/sentry.git
cd sentry

Install Homebrew, if you haven’t already. Run brew bundle to install the various system packages as listed in sentry’s Brewfile. This will install, among other things, Python 2 and docker.

Setup and activate a python 2 virtual environment:

python2 -m pip install virtualenv
python2 -m virtualenv .venv
source .venv/bin/activate

Install nvm and use it to install the node version specified in sentry’s .nvmrc file:

brew install nvm
echo "source /usr/local/opt/nvm/" >> ~/.bashrc
exec bash
nvm install

Run the following to install the Python and JavaScript libraries and database services that Sentry depends on and some extra pieces that hold the development environment together:

make bootstrap

make bootstrap will generally run these sequence of commands (you can poke around through the Makefile file to see more details):

make install-system-pkgs
make develop
# creates a development configuration file at ~/.sentry/
sentry init --dev
# start up our development services
sentry devservices up
make create-db
make apply-migrations

Running the Development Server

Once you’ve successfully stood up your datastore, you can now run the development server:

sentry devserver --workers

If you are developing for aesthetics only and do not rely on the async workers, you can omit the --workers flag in order to use less system resources.

If you would like to be able to run devserver outside of your root checkout, you can install webpack globally with npm install -g webpack.

When webpack finishes processing, you can find a login prompt for the user account you previously created at http://localhost:8000. From there, you are free to browse the website as an administrator.

Staging Your Changes

You’ve made your changes to the codebase, now it’s time to present them to the Sentry developers. It is recommended to first run the test suite locally in order to find any linting, syntax, or integration before you post a Pull Request.

Running the Test Suite Locally

There are no additional services required for running the Sentry test suite. To install dependent libraries, lint all source code, and run both the Python and JavaScript test suites, simply run:

make test

If you find yourself constantly running make test and wishing it was faster, running either make test-js or make test-python will only run the test suite with the corresponding language, skipping over linting and dependency checks. If you would like to see even more options, check out other entry points in the Makefile.