We welcome suggested improvements and bug fixes to the @sentry/*
family of packages, in the form of pull requests on GitHub
. The guide below will help you get started, but if you have further questions, please feel free to reach out on Discord.
To run the test suite and our code linter, node.js and yarn are required.
sentry-javascript-bundler-plugins
is a monorepo containing several packages, and we use nx
to manage them. To get started, install all dependencies and then perform an initial build.
$ yarn
$ yarn build
With that, the repo is fully set up and you are ready to run all commands.
Since we are using TypeScript
, you need to transpile the code to JavaScript to be able to use it. From the top level of the repo, there are three commands available:
yarn build
, which runs a one-time build (transpiling and type generation) of every packageyarn build:watch
, which runs the command listed above in watch mode, meaning the command is re-executed after every file change
Any nontrivial fixes/features should include tests. You'll find a test
folder in each package.
Running tests works the same way as building - running yarn test
at the project root will run tests for all packages, and running yarn test
in a specific package will run tests for that package. There are also commands to run subsets of the tests in each location. Check out the scripts
entry of the corresponding package.json
for details.
Similar to building and testing, linting can be done in the project root or in individual packages by calling yarn lint
.
When contributing to the codebase, please note:
- Non-trivial PRs will not be accepted without tests (see above). If you need assistance in writing tests, feel free to reach out to us.
- Please do not bump version numbers yourself.
For feedback in PRs, we use the LOGAF scale to specify how important a comment is:
l
: low - nitpick. You may address this comment, but you don't have to.m
: medium - normal comment. Worth addressing and fixing.h
: high - Very important. We must not merge this PR without addressing this issue.
You only need one approval from a maintainer to be able to merge. For some PRs, asking specific or multiple people for review might be adequate.
Our different types of reviews:
- LGTM without any comments. You can merge immediately.
- LGTM with low and medium comments. The reviewer trusts you to resolve these comments yourself, and you don't need to wait for another approval.
- Only comments. You must address all the comments and need another review until you merge.
- Request changes. Only use if something critical is in the PR that absolutely must be addressed. We usually use
h
comments for that. When someone requests changes, the same person must approve the changes to allow merging. Use this sparingly.
These steps are only relevant to Sentry employees when preparing and publishing a new SDK release.
- Determine what version will be released (we use semver).
- Update
CHANGELOG.md
to add an entry for the next release number and a list of changes since the last release. (See details below.) - Run the Prepare Release workflow.
- A new issue should appear in https://github.com/getsentry/publish/issues.
- Ask a member of the @getsentry/releases team to approve the release.
- Create a new branch.
- Run
git log --format="- %s"
and copy everything since the last release. - Create a new section in the changelog, deciding based on the changes whether it should be a minor bump or a patch release.
- Paste in the logs you copied earlier.
- Delete any which aren't user-facing changes.
- Alphabetize the rest.
- If any of the PRs are from external contributors, include underneath the commits
Work in this release contributed by <list of external contributors' GitHub usernames>. Thank you for your contributions!
. If there's only one external PR, don't forget to remove the finals
. If there are three or more, use an Oxford comma. (It's in the Sentry styleguide!) - Commit, push, and open a PR with the title
meta: Update changelog for <fill in relevant version here>
.