You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# This is the 1st commit message:
ref: Use constant for the SDK version
# This is the commit message #2:
docs: Update README.md & CONTRIBUTING.md (#650)
* docs: Update README.md & CONTRIBUTING.md
* Add slogan
# This is the commit message #3:
test: Add dsn to e2e test config (#657)
* test: Add dsn to e2e test config
* Add phpstan exclusion
# This is the commit message #4:
Fix Symfony 6 deprecations in E2E test (#656)
# This is the commit message #5:
fix: Update span ops (#655)
We welcome contributions to `sentry-symfony` by the community.
10
+
11
+
Please search the [issue tracker](https://github.com/getsentry/sentry-symfony/issues) before creating a new issue (a problem or an improvement request). Please also ask in our [Sentry Community on Discord](https://discord.com/invite/Ww9hbqr) before submitting a new issue. There is a ton of great people in our Discord community ready to help you!
12
+
13
+
If you feel that you can fix or implement it yourself, please read on to learn how to submit your changes.
14
+
15
+
## Submitting changes
16
+
17
+
- Setup the development environment.
18
+
- Clone the `sentry-symfony` repository and prepare necessary changes.
19
+
- Add tests for your changes to `tests/`.
20
+
- Run tests and make sure all of them pass.
21
+
- Submit a pull request, referencing any issues it addresses.
22
+
- Make sure to update the `CHANGELOG.md` file below the `Unreleased` heading.
23
+
24
+
We will review your pull request as soon as possible.
Make sure that you have PHP 7.2+ installed. Version 7.4 or higher is required to run style checkers. On macOS, we recommend using brew to install PHP. For Windows, we recommend an official PHP.net release.
36
+
37
+
### Install the dependencies
38
+
39
+
Dependencies are managed through [Composer](https://getcomposer.org/):
40
+
41
+
```bash
42
+
composer install
43
+
```
44
+
45
+
### Running tests
46
+
47
+
Tests can then be run via [PHPUnit](https://phpunit.de/):
48
+
49
+
```bash
50
+
vendor/bin/phpunit
51
+
```
52
+
53
+
## Releasing a new version
54
+
55
+
(only relevant for Sentry employees)
56
+
57
+
Prerequisites:
58
+
59
+
- All changes that should be released must be in the `master` branch.
60
+
- Every commit should follow the [Commit Message Format](https://develop.sentry.dev/commit-messages/#commit-message-format) convention.
61
+
62
+
Manual Process:
63
+
64
+
- Update CHANGELOG.md with the version to be released. Example commit: https://github.com/getsentry/sentry-symfony/commit/d1d2895c028676113cb191516b80b91abcde31f3.
65
+
- On GitHub in the `sentry-symfony` repository go to "Actions" select the "Release" workflow.
66
+
- Click on "Run workflow" on the right side and make sure the `master` branch is selected.
67
+
- Set "Version to release" input field. Here you decide if it is a major, minor or patch release. (See "Versioning Policy" below)
68
+
- Click "Run Workflow"
69
+
70
+
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)
71
+
72
+
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.
73
+
74
+
There are always two persons involved in a release.
75
+
76
+
If you are in a hurry and the release should be out immediately 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 immediately.
77
+
78
+
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!
79
+
80
+
There is a sequence diagram visualizing all this in the [README.md](https://github.com/getsentry/publish) of the `Publish` repository.
81
+
82
+
### Versioning Policy
83
+
84
+
This project follows [semver](https://semver.org/), with three additions:
85
+
86
+
- 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.
87
+
88
+
- All undocumented APIs are considered internal. They are not part of this contract.
89
+
90
+
- 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.
91
+
92
+
We recommend pinning your version requirements against `1.x.*` or `1.x.y`.
93
+
Either one of the following is fine:
94
+
95
+
```json
96
+
"sentry/sentry": "^1.0",
97
+
"sentry/sentry": "^1",
98
+
```
99
+
100
+
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 bug tracker.
Copy file name to clipboardExpand all lines: README.md
+47-27Lines changed: 47 additions & 27 deletions
Original file line number
Diff line number
Diff line change
@@ -4,31 +4,30 @@
4
4
</a>
5
5
</p>
6
6
7
-
# sentry-symfony
7
+
_Bad software is everywhere, and we're tired of it. Sentry is on a mission to help developers write better software faster, so we can get back to enjoying technology. If you want to join us [<kbd>**Check out our open positions**</kbd>](https://sentry.io/careers/)_
8
8
9
-
Symfony integration for [Sentry](https://getsentry.com/).
This is the official Symfony SDK for [Sentry](https://getsentry.com/).
20
+
21
+
## Getting Started
20
22
21
-
Use `sentry-symfony`for:
23
+
Using this `sentry-symfony`SDK provides you with the following benefits:
22
24
23
-
* A fast Sentry setup
24
-
* Easy configuration in your Symfony app
25
-
* Automatic wiring in your app. Each event has the following things added automatically to it:
26
-
- user
27
-
- Symfony environment
28
-
- app path
29
-
- excluded paths (cache and vendor)
25
+
* Quickly integrate and configure Sentry for your Symfony app
26
+
* Out of the box, each event will contain the following data by default
27
+
- The currently authenticated user
28
+
- The Symfony environment
30
29
31
-
##Installation
30
+
### Install
32
31
33
32
To install the SDK you will need to be using [Composer]([https://getcomposer.org/)
34
33
in your project. To install it please see the [docs](https://getcomposer.org/download/).
@@ -37,7 +36,7 @@ in your project. To install it please see the [docs](https://getcomposer.org/dow
37
36
composer require sentry/sentry-symfony
38
37
```
39
38
40
-
If you're using the [Symfony Flex](https://symfony.com/doc/current/setup/flex.html) Composer plugin, it could show a message similar to this:
39
+
If you're using the [Symfony Flex](https://symfony.com/doc/current/setup/flex.html) Composer plugin, you might encounter a message similar to this:
41
40
42
41
```
43
42
The recipe for this package comes from the "contrib" repository, which is open to community contributions.
@@ -48,9 +47,8 @@ Do you want to execute this recipe?
48
47
49
48
Just type `y`, press return, and the procedure will continue.
50
49
51
-
**Warning:** due to a bug in all versions lower than `6.0` of the [`SensioFrameworkExtra`](https://github.com/sensiolabs/SensioFrameworkExtraBundle) bundle,
52
-
if you have it installed you will likely get an error during the execution of the commands above in regards to the missing `Nyholm\Psr7\Factory\Psr17Factory`
53
-
class. To workaround the issue, if you are not using the PSR-7 bridge, please change the configuration of that bundle as follows:
50
+
**Caution:** Due to a bug in the [`SensioFrameworkExtra`](https://github.com/sensiolabs/SensioFrameworkExtraBundle) bundle, affecting version 6.0 and below, you might run into a missing `Nyholm\Psr7\Factory\Psr17Factory::class` error while executing the commands mentioned above.
51
+
If you are not using the PSR-7 bridge, you can work around this issue by changing the configuration of the bundle as follows:
54
52
55
53
```yaml
56
54
sensio_framework_extra:
@@ -60,7 +58,7 @@ sensio_framework_extra:
60
58
61
59
For more details about the issue see https://github.com/sensiolabs/SensioFrameworkExtraBundle/pull/710.
62
60
63
-
### Step 2: Enable the Bundle
61
+
### Enable the Bundle
64
62
65
63
If you installed the package using the Flex recipe, the bundle will be automatically enabled. Otherwise, enable it by adding it to the list
66
64
of registered bundles in the `Kernel.php` file of your project:
@@ -80,13 +78,16 @@ class AppKernel extends \Symfony\Component\HttpKernel\Kernel
80
78
}
81
79
```
82
80
83
-
Note that, unlike before in version 3, the bundle will be enabled in all environments; event reporting, instead, is enabled
84
-
only when providing a DSN (see the next step).
81
+
The bundle will be enabled in all environments by default.
82
+
To enable event reporting, you'll need to add a DSN (see the next step).
85
83
86
-
## Configuration of the SDK
84
+
### Configure
87
85
88
-
Add your [Sentry DSN](https://docs.sentry.io/quickstart/#configure-the-dsn) value of your project, if you have Symfony 3.4 add it to ``app/config/config_prod.yml`` for Symfony 4 or newer add the value to `config/packages/sentry.yaml`.
89
-
Keep in mind that leaving the `dsn` value empty (or undeclared) in other environments will effectively disable Sentry reporting.
86
+
Add the [Sentry DSN](https://docs.sentry.io/quickstart/#configure-the-dsn) of your project.
87
+
If you're using Symfony 3.4, add the DSN to your `app/config/config_prod.yml` file.
88
+
For Symfony 4 or newer, add the DSN to your `config/packages/sentry.yaml` file.
89
+
90
+
Keep in mind that by leaving the `dsn` value empty (or undeclared), you will disable Sentry's event reporting.
90
91
91
92
```yaml
92
93
sentry:
@@ -105,20 +106,19 @@ the [PHP specific](https://docs.sentry.io/platforms/php/#php-specific-options) o
105
106
106
107
#### Optional: use custom HTTP factory/transport
107
108
108
-
Since SDK 2.0 uses HTTPlug to remain transport-agnostic, you need to have installed two packages that provides
109
+
Since the SDK 2.0 uses HTTPlug to remain transport-agnostic, you need to install two packages that provide
and [`psr/http-message-implementation`](https://packagist.org/providers/psr/http-message-implementation).
111
112
112
113
This bundle depends on `sentry/sdk`, which is a metapackage that already solves this need, requiring our suggested HTTP
113
114
packages: the Curl client and Guzzle's message factories.
114
115
115
-
If instead you want to use a different HTTP client or message factory, you can override the ``sentry/sdk`` package adding the following to your ``composer.json`` after the ``require`` section:
116
+
Instead, if you want to use a different HTTP client or message factory, you can override the ``sentry/sdk`` package by adding the following to your ``composer.json`` after the ``require`` section:
116
117
```json
117
118
"replace": {
118
119
"sentry/sdk": "*"
119
120
}
120
121
```
121
-
This will prevent the installation of ``sentry/sdk`` package and will allow you to install through Composer the HTTP client or message factory of your choice.
122
122
123
123
For example for using Guzzle's components:
124
124
@@ -154,7 +154,8 @@ sentry:
154
154
YourValueObject: 'ValueObjectSerializer'
155
155
```
156
156
157
-
Several serializers can be added and the serializable check is done using **instanceof**. The serializer must implements the `__invoke` method returning an **array** with the information to send to sentry (class name is always sent).
157
+
Several serializers can be added and the serializable check is done by using the **instanceof** type operator.
158
+
The serializer must implement the `__invoke` method, which needs to return an **array**, containing the information that should be send to Sentry. The class name is always sent by default.
158
159
159
160
Serializer example:
160
161
```php
@@ -169,6 +170,25 @@ final class ValueObjectSerializer
169
170
}
170
171
```
171
172
173
+
## Contributing to the SDK
174
+
175
+
Please refer to [CONTRIBUTING.md](CONTRIBUTING.md).
176
+
177
+
## Getting help/support
178
+
179
+
If you need help setting up or configuring the Symfony 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!
0 commit comments