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 mastercontains the last released state - Whatever is onmasterreflects the most recent published version- Never merge directly into
master- Releases are created by mergingdevelop→master - After release, merge back -
masteris merged back intodevelopto keep them in sync
Branch Structure
Creating a Feature Branch
Always create feature branches fromdevelop:
feat/feature-name- New featuresfix/bug-name- Bug fixesref/refactor-name- Refactoringdocs/doc-name- Documentation changes
Important Caveats
While a release is pending, you may merge anything intodevelop, except for changes to package.json files.
Handling Merge Conflicts
If you encounter merge conflicts when mergingmaster back into develop:
- Close the automated PR
- Create a new branch from
master: - Merge
developinto this branch and resolve conflicts: - Create a PR from
manual-develop-sync→develop - Merge with a merge commit (not squash)
Commit Guidelines
Commit Message Format
We follow the Sentry commit message format:Commit Types
feat- New featurefix- Bug fixref- Refactoringperf- Performance improvementdocs- Documentation changestest- Test changesbuild- Build system changesci- CI configuration changeschore- Other changes
Commit Scope
The scope should indicate which package(s) are affected:feat(browser):- Changes to@sentry/browserfix(node):- Changes to@sentry/nodefeat(core):- Changes to@sentry/corefeat(react):- Changes to@sentry/reactfix(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:Pull Request Process
Creating a PR
-
Push your branch to GitHub:
-
Create the PR:
- Target:
develop(notmaster!) - Title: Follow commit message format without the GitHub ID
- Description: Explain the changes, why they’re needed, and any relevant context
- Target:
-
Add labels:
- Package labels:
Package: Browser,Package: Node, etc. - Type labels:
Type: Feature,Type: Bug Fix, etc.
- Package labels:
PR Requirements
- All tests pass
- Linting passes
- Non-trivial changes include tests
- Breaking changes are documented
- Commit message follows guidelines
- PR targets
developbranch
PR Review
The SDK team will review your PR. You may be asked to:- Make changes
- Add tests
- Update documentation
- Rebase on latest
develop
Merging PRs
PRs are merged via Squash and Merge. This means all commits on the branch are squashed into a single commit ondevelop.
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:v8/) becomes a scope prefix.
Linting and Formatting
Run Linter
- 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:- Fork the repository on GitHub
- Create a branch from
developin your fork - Make your changes following the guidelines in this document
- Open a PR against
developin the main repository - The SDK team will review your PR shortly
Important Notes
- Follow the commit and PR guidelines
- Non-trivial PRs must include tests
- Make sure to sign the Contributor License Agreement (CLA)
Getting Help
If you have questions:- Check the SDK Development Guide
- Ask on Discord
- Open a GitHub Discussion
Next Steps
- Explore the monorepo architecture
- Learn about package structure
- Understand how packages are organized in the monorepo