Skip to content

Commit 39ab78f

Browse files
authored
Update contribution guide (getsentry#1346)
* docs(python): Added 'how to create a release' to contribution guide. * docs(python): added link to new integration checklist and moved migration section below integrations section
1 parent 3e11ce3 commit 39ab78f

File tree

3 files changed

+65
-34
lines changed

3 files changed

+65
-34
lines changed

CONTRIBUTING.md

+51-8
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,20 @@ cd sentry-python
3737
python -m venv .env
3838

3939
source .env/bin/activate
40+
```
41+
42+
### Install `sentry-python` in editable mode
4043

44+
```bash
4145
pip install -e .
4246
```
4347

44-
**Hint:** Sometimes you need a sample project to run your new changes to sentry-python. In this case install the sample project in the same virtualenv and you should be good to go because the ` pip install -e .` from above installed your local sentry-python in editable mode. So you can just hack away!
48+
**Hint:** Sometimes you need a sample project to run your new changes to sentry-python. In this case install the sample project in the same virtualenv and you should be good to go because the ` pip install -e .` from above installed your local sentry-python in editable mode.
4549

4650
### Install coding style pre-commit hooks:
4751

52+
This will make sure that your commits will have the correct coding style.
53+
4854
```bash
4955
cd sentry-python
5056

@@ -107,15 +113,52 @@ pytest -rs tests/integrations/flask/
107113

108114
## Releasing a new version
109115

110-
We use [craft](https://github.com/getsentry/craft#python-package-index-pypi) to
111-
release new versions. You need credentials for the `getsentry` PyPI user, and
112-
must have `twine` installed globally.
116+
(only relevant for Sentry employees)
117+
118+
Prerequisites:
119+
120+
- All the changes that should be release must be in `master` branch.
121+
- Every commit should follow the [Commit Message Format](https://develop.sentry.dev/commit-messages/#commit-message-format) convention.
122+
- CHANGELOG.md is updated automatically. No human intervention necessary.
123+
124+
Manual Process:
125+
126+
- On GitHub in the `sentry-python` repository go to "Actions" select the "Release" workflow.
127+
- Click on "Run workflow" on the right side, make sure the `master` branch is selected.
128+
- Set "Version to release" input field. Here you decide if it is a major, minor or patch release. (See "Versioning Policy" below)
129+
- Click "Run Workflow"
130+
131+
This will trigger [Craft](https://github.com/getsentry/craft) to prepare everything needed for a release. (For more information see [craft prepare](https://github.com/getsentry/craft#craft-prepare-preparing-a-new-release)) At the end of this process a release issue is created in the [Publish](https://github.com/getsentry/publish) repository. (Example release issue: https://github.com/getsentry/publish/issues/815)
132+
133+
Now one of the persons with release privileges (most probably your engineering manager) will review this Issue and then add the `accepted` label to the issue.
134+
135+
There are always two persons involved in a release.
113136

114-
The usual release process goes like this:
137+
If you are in a hurry and the release should be out immediatly there is a Slack channel called `#proj-release-approval` where you can see your release issue and where you can ping people to please have a look immediatly.
138+
139+
When the release issue is labeled `accepted` [Craft](https://github.com/getsentry/craft) is triggered again to publish the release to all the right platforms. (See [craft publish](https://github.com/getsentry/craft#craft-publish-publishing-the-release) for more information). At the end of this process the release issue on GitHub will be closed and the release is completed! Congratulations!
140+
141+
There is a sequence diagram visualizing all this in the [README.md](https://github.com/getsentry/publish) of the `Publish` repository.
142+
143+
### Versioning Policy
144+
145+
This project follows [semver](https://semver.org/), with three additions:
146+
147+
- Semver says that major version `0` can include breaking changes at any time. Still, it is common practice to assume that only `0.x` releases (minor versions) can contain breaking changes while `0.x.y` releases (patch versions) are used for backwards-compatible changes (bugfixes and features). This project also follows that practice.
148+
149+
- All undocumented APIs are considered internal. They are not part of this contract.
150+
151+
- Certain features (e.g. integrations) may be explicitly called out as "experimental" or "unstable" in the documentation. They come with their own versioning policy described in the documentation.
152+
153+
We recommend to pin your version requirements against `1.x.*` or `1.x.y`.
154+
Either one of the following is fine:
155+
156+
```
157+
sentry-sdk>=1.0.0,<2.0.0
158+
sentry-sdk==1.5.0
159+
```
115160

116-
1. Go through git log and write new entry into `CHANGELOG.md`, commit to master
117-
2. `craft p a.b.c`
118-
3. `craft pp a.b.c`
161+
A major release `N` implies the previous release `N-1` will no longer receive updates. We generally do not backport bugfixes to older versions unless they are security relevant. However, feel free to ask for backports of specific commits on the bugtracker.
119162

120163
## Adding a new integration (checklist)
121164

README.md

+8-26
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,6 @@ This is the official Python SDK for [Sentry](http://sentry.io/)
1616

1717
---
1818

19-
## Migrate From sentry-raven
20-
21-
The old `raven-python` client has entered maintenance mode and was moved [here](https://github.com/getsentry/raven-python).
22-
23-
If you're using `raven-python`, we recommend you to migrate to this new SDK. You can find the benefits of migrating and how to do it in our [migration guide](https://docs.sentry.io/platforms/python/migration/).
24-
2519
## Getting Started
2620

2721
### Install
@@ -60,6 +54,8 @@ raise ValueError() # Will also create an event in Sentry.
6054

6155
## Integrations
6256

57+
(If you want to create a new integration have a look at the [Adding a new integration checklist](CONTRIBUTING.md#adding-a-new-integration-checklist).)
58+
6359
- [Django](https://docs.sentry.io/platforms/python/guides/django/)
6460
- [Flask](https://docs.sentry.io/platforms/python/guides/flask/)
6561
- [Bottle](https://docs.sentry.io/platforms/python/guides/bottle/)
@@ -82,6 +78,12 @@ raise ValueError() # Will also create an event in Sentry.
8278
- [Apache Beam](https://docs.sentry.io/platforms/python/guides/beam/)
8379
- [Apache Spark](https://docs.sentry.io/platforms/python/guides/pyspark/)
8480

81+
## Migrate From sentry-raven
82+
83+
The old `raven-python` client has entered maintenance mode and was moved [here](https://github.com/getsentry/raven-python).
84+
85+
If you're using `raven-python`, we recommend you to migrate to this new SDK. You can find the benefits of migrating and how to do it in our [migration guide](https://docs.sentry.io/platforms/python/migration/).
86+
8587
## Contributing to the SDK
8688

8789
Please refer to [CONTRIBUTING.md](CONTRIBUTING.md).
@@ -90,26 +92,6 @@ Please refer to [CONTRIBUTING.md](CONTRIBUTING.md).
9092

9193
If you need help setting up or configuring the Python SDK (or anything else in the Sentry universe) please head over to the [Sentry Community on Discord](https://discord.com/invite/Ww9hbqr). There is a ton of great people in our Discord community ready to help you!
9294

93-
## Versioning Policy
94-
95-
This project follows [semver](https://semver.org/), with three additions:
96-
97-
- Semver says that major version `0` can include breaking changes at any time. Still, it is common practice to assume that only `0.x` releases (minor versions) can contain breaking changes while `0.x.y` releases (patch versions) are used for backwards-compatible changes (bugfixes and features). This project also follows that practice.
98-
99-
- All undocumented APIs are considered internal. They are not part of this contract.
100-
101-
- Certain features (e.g. integrations) may be explicitly called out as "experimental" or "unstable" in the documentation. They come with their own versioning policy described in the documentation.
102-
103-
We recommend to pin your version requirements against `1.x.*` or `1.x.y`.
104-
Either one of the following is fine:
105-
106-
```
107-
sentry-sdk>=1.0.0,<2.0.0
108-
sentry-sdk==1.5.0
109-
```
110-
111-
A major release `N` implies the previous release `N-1` will no longer receive updates. We generally do not backport bugfixes to older versions unless they are security relevant. However, feel free to ask for backports of specific commits on the bugtracker.
112-
11395
## Resources
11496

11597
- [![Documentation](https://img.shields.io/badge/documentation-sentry.io-green.svg)](https://docs.sentry.io/quickstart/)

tox.ini

+6
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,12 @@ commands =
306306
{py3.5,py3.6,py3.7,py3.8,py3.9}-flask-{0.10,0.11,0.12}: pip install pytest<5
307307
{py3.6,py3.7,py3.8,py3.9}-flask-{0.11}: pip install Werkzeug<2
308308

309+
; https://github.com/pallets/flask/issues/4455
310+
{py3.7,py3.8,py3.9,py3.10}-flask-{0.11,0.12,1.0,1.1}: pip install "itsdangerous>=0.24,<2.0" "markupsafe<2.0.0"
311+
;"itsdangerous >= 0.24, < 2.0",
312+
;itsdangerous==1.1.0
313+
;markupsafe==1.1.1
314+
309315
; https://github.com/more-itertools/more-itertools/issues/578
310316
py3.5-flask-{0.10,0.11,0.12}: pip install more-itertools<8.11.0
311317

0 commit comments

Comments
 (0)