Skip to content

Commit 354c4a6

Browse files
committed
Merge branch 'master' into feature/tracing-support
2 parents 9978c35 + 07007cc commit 354c4a6

17 files changed

+206
-66
lines changed

.craft.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
minVersion: '0.9.0'
1+
minVersion: 0.9.0
22
github:
33
owner: getsentry
44
repo: sentry-symfony
55
changelogPolicy: simple
6-
statusProvider:
6+
statusProvider:
77
name: github
88
artifactProvider:
99
name: none

.editorconfig

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
; top-most EditorConfig file
2+
root = true
3+
4+
; Unix-style newlines
5+
[*]
6+
charset = utf-8
7+
end_of_line = LF
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
indent_style = space
11+
indent_size = 4
12+
13+
[*.md]
14+
max_line_length = 80
15+
16+
[*.{yml, yaml}]
17+
indent_size = 2
18+
19+
[COMMIT_EDITMSG]
20+
max_line_length = 0
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Prepare Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: Version to release
8+
required: true
9+
force:
10+
description: Force a release even when there are release-blockers (optional)
11+
required: false
12+
13+
jobs:
14+
release:
15+
runs-on: ubuntu-latest
16+
name: Release version
17+
steps:
18+
- uses: actions/checkout@v2
19+
with:
20+
token: ${{ secrets.GH_RELEASE_PAT }}
21+
fetch-depth: 0
22+
23+
- name: Prepare release
24+
uses: getsentry/action-prepare-release@v1
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GH_RELEASE_PAT }}
27+
with:
28+
version: ${{ github.event.inputs.version }}
29+
force: ${{ github.event.inputs.force }}

.github/workflows/tests.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ jobs:
4444
name: PHP ${{ matrix.php }} tests (${{ matrix.description }})
4545
steps:
4646
- uses: actions/checkout@v2
47+
with:
48+
fetch-depth: 2
4749
- uses: actions/cache@v2
4850
with:
4951
path: ~/.composer/cache/files

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22

33
## Unreleased
44

5-
- Added missing `capture-soft-fails` config schema option (#417)
5+
- Add `kernel.project_dir` to `prefixes` default value to trim paths to the project root (#434)
6+
7+
## 4.0.1 (2021-01-26)
8+
9+
- Add missing `capture-soft-fails` option to the XSD schema for the XML config (#417)
10+
- Fix regression that send PII even when the `send_default_pii` option is off (#425)
11+
- Fix capture of console errors when the `register_error_listener` option is disabled (#427)
612

713
## 4.0.0 (2021-01-19)
814

README.md

Lines changed: 12 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,18 @@ You can install this bundle using Composer:
4444
composer require sentry/sentry-symfony
4545
```
4646

47+
**Warning:** due to a bug in all versions lower than `6.0` of the [`SensioFrameworkExtra`](https://github.com/sensiolabs/SensioFrameworkExtraBundle) bundle,
48+
if you have it installed you will likely get an error during the execution of the command above in regards to the missing `Nyholm\Psr7\Factory\Psr17Factory`
49+
class. To workaround the issue, if you are not using the PSR-7 bridge, please change the configuration of that bundle as follows:
50+
51+
```yaml
52+
sensio_framework_extra:
53+
psr_message:
54+
enabled: false
55+
```
56+
57+
For more details about the issue see https://github.com/sensiolabs/SensioFrameworkExtraBundle/pull/710.
58+
4759
### Step 2: Enable the Bundle
4860
4961
Then, enable the bundle by adding it to the list of registered bundles
@@ -92,43 +104,6 @@ The parameter `options` allows to fine-tune exceptions. To discover more options
92104
[the Unified APIs](https://docs.sentry.io/development/sdk-dev/unified-api/#options) options and
93105
the [PHP specific](https://docs.sentry.io/platforms/php/#php-specific-options) ones.
94106

95-
#### Optional: use monolog handler provided by `sentry/sentry` (available since 3.2.0)
96-
*Note: this step is optional*
97-
98-
If you're using `monolog` for logging e.g. in-app errors, you
99-
can use this handler in order for them to show up in Sentry.
100-
101-
First, enable & configure the `Sentry\Monolog\Handler`; you'll also need
102-
to disable the `Sentry\SentryBundle\EventListener\ErrorListener` to
103-
avoid having duplicate events in Sentry:
104-
105-
```yaml
106-
sentry:
107-
register_error_listener: false # Disables the ErrorListener
108-
monolog:
109-
error_handler:
110-
enabled: true
111-
level: error
112-
```
113-
114-
Then enable it in `monolog` config:
115-
116-
```yaml
117-
monolog:
118-
handlers:
119-
sentry:
120-
type: service
121-
id: Sentry\Monolog\Handler
122-
```
123-
124-
Additionally, you can register the `PsrLogMessageProcessor` to resolve PSR-3 placeholders in reported messages:
125-
126-
```yaml
127-
services:
128-
Monolog\Processor\PsrLogMessageProcessor:
129-
tags: { name: monolog.processor, handler: sentry }
130-
```
131-
132107
#### Optional: use custom HTTP factory/transport
133108

134109
Since SDK 2.0 uses HTTPlug to remain transport-agnostic, you need to have installed two packages that provides

UPGRADE-4.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ using an on-premise installation it requires Sentry version `>= v20.6.0` to work
140140
```yaml
141141
sentry:
142142
options:
143-
before_send: 'app.sentry.before_breadcrumb'
143+
before_breadcrumb: 'app.sentry.before_breadcrumb'
144144
```
145145

146146
- Changed the type of the `sentry.options.class_serializers` configuration option from an array of `scalar` values to an array of `string` values. The value must always be the name of the container service to call without the `@` prefix.

phpstan-baseline.neon

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,6 @@ parameters:
4545
count: 1
4646
path: tests/End2End/End2EndTest.php
4747

48-
-
49-
message: "#^Comparison operation \"\\<\" between 50201 and 40300 is always false\\.$#"
50-
count: 1
51-
path: tests/End2End/End2EndTest.php
52-
5348
-
5449
message: "#^Parameter \\$event of method Sentry\\\\SentryBundle\\\\Tests\\\\EventListener\\\\ErrorListenerTest\\:\\:testHandleExceptionEvent\\(\\) has invalid typehint type Symfony\\\\Component\\\\HttpKernel\\\\Event\\\\GetResponseForExceptionEvent\\.$#"
5550
count: 1
@@ -92,7 +87,7 @@ parameters:
9287

9388
-
9489
message: "#^Instantiated class Symfony\\\\Component\\\\HttpKernel\\\\Event\\\\GetResponseEvent not found\\.$#"
95-
count: 6
90+
count: 8
9691
path: tests/EventListener/RequestListenerTest.php
9792

9893
-

src/DependencyInjection/Configuration.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public function getConfigTreeBuilder(): TreeBuilder
5050
->booleanNode('default_integrations')->end()
5151
->integerNode('send_attempts')->min(0)->end()
5252
->arrayNode('prefixes')
53+
->defaultValue(array_merge(['%kernel.project_dir%'], array_filter(explode(\PATH_SEPARATOR, get_include_path() ?: ''))))
5354
->scalarPrototype()->end()
5455
->end()
5556
->floatNode('sample_rate')

src/DependencyInjection/SentryExtension.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use Sentry\Integration\RequestFetcherInterface;
1313
use Sentry\Integration\RequestIntegration;
1414
use Sentry\Options;
15+
use Sentry\SentryBundle\EventListener\ConsoleCommandListener;
1516
use Sentry\SentryBundle\EventListener\ErrorListener;
1617
use Sentry\SentryBundle\EventListener\MessengerListener;
1718
use Sentry\SentryBundle\SentryBundle;
@@ -133,6 +134,8 @@ private function registerErrorListenerConfiguration(ContainerBuilder $container,
133134
if (!$config['register_error_listener']) {
134135
$container->removeDefinition(ErrorListener::class);
135136
}
137+
138+
$container->getDefinition(ConsoleCommandListener::class)->setArgument(1, $config['register_error_listener']);
136139
}
137140

138141
/**

0 commit comments

Comments
 (0)