Skip to main content
This guide covers the development workflow for contributing to the Sentry JavaScript SDK, including Git Flow, commit guidelines, and the PR review process.

Git Flow

We use Git Flow as our branching model.

Key Principles

  • Ongoing work happens on develop - All active development and PRs target this branch
  • master contains the last released state - Whatever is on master reflects the most recent published version
  • Never merge directly into master - Releases are created by merging developmaster
  • After release, merge back - master is merged back into develop to keep them in sync

Branch Structure

Creating a Feature Branch

Always create feature branches from develop:
Branch naming conventions:
  • feat/feature-name - New features
  • fix/bug-name - Bug fixes
  • ref/refactor-name - Refactoring
  • docs/doc-name - Documentation changes

Important Caveats

While a release is pending, you may merge anything into develop, except for changes to package.json files.
Changing package.json files on develop during a release will cause merge conflicts in the Git Flow PR (masterdevelop), because package versions are updated on master during the release.

Handling Merge Conflicts

If you encounter merge conflicts when merging master back into develop:
  1. Close the automated PR
  2. Create a new branch from master:
  3. Merge develop into this branch and resolve conflicts:
  4. Create a PR from manual-develop-syncdevelop
  5. Merge with a merge commit (not squash)

Commit Guidelines

Commit Message Format

We follow the Sentry commit message format:
Example:

Commit Types

  • feat - New feature
  • fix - Bug fix
  • ref - Refactoring
  • perf - Performance improvement
  • docs - Documentation changes
  • test - Test changes
  • build - Build system changes
  • ci - CI configuration changes
  • chore - Other changes

Commit Scope

The scope should indicate which package(s) are affected:
  • feat(browser): - Changes to @sentry/browser
  • fix(node): - Changes to @sentry/node
  • feat(core): - Changes to @sentry/core
  • feat(react): - Changes to @sentry/react
  • fix(nextjs): - Changes to @sentry/nextjs

GitHub ID

The GitHub PR number can be left out until the PR is merged. It will be added when squashing.

Example Commits

Before Committing

Always run these commands before committing:
NEVER push directly to the develop branch. Always create a PR.

Pull Request Process

Creating a PR

  1. Push your branch to GitHub:
  2. Create the PR:
    • Target: develop (not master!)
    • Title: Follow commit message format without the GitHub ID
    • Description: Explain the changes, why they’re needed, and any relevant context
  3. Add labels:
    • Package labels: Package: Browser, Package: Node, etc.
    • Type labels: Type: Feature, Type: Bug Fix, etc.

PR Requirements

  • All tests pass
  • Linting passes
  • Non-trivial changes include tests
  • Breaking changes are documented
  • Commit message follows guidelines
  • PR targets develop branch

PR Review

The SDK team will review your PR. You may be asked to:
  • Make changes
  • Add tests
  • Update documentation
  • Rebase on latest develop
For more details, see docs/pr-reviews.md.

Merging PRs

PRs are merged via Squash and Merge. This means all commits on the branch are squashed into a single commit on develop.
We cannot enforce Squash Merge due to Git Flow usage. GitHub remembers the last merge method used, so double-check you’re using “Squash and Merge.”

Squash Merge Checklist

  • Rebase the branch on latest develop
  • Use “Squash and Merge” (not “Merge” or “Rebase and Merge”)
  • Update the commit message to follow guidelines
  • Add the PR number to the commit message:
  • If you’re a Sentry employee, assign yourself to the PR

Backporting

To backport a commit to a previous major version, reflect this in the PR/commit title:
The major version (v8/) becomes a scope prefix.

Linting and Formatting

Run Linter

Linting includes:
  • ESLint for code quality
  • Oxfmt for code formatting

Auto-fix Issues

Check Formatting

Useful Commands

Clean Build Artifacts

Check for Circular Dependencies

Update Snapshots

External Contributors

We highly appreciate external contributions! Here’s what you need to know:
  1. Fork the repository on GitHub
  2. Create a branch from develop in your fork
  3. Make your changes following the guidelines in this document
  4. Open a PR against develop in the main repository
  5. The SDK team will review your PR shortly

Important Notes

Getting Help

If you have questions:

Next Steps