Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare 4.5.0 #679

Merged
merged 13 commits into from Nov 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion .craft.yml
Expand Up @@ -2,7 +2,6 @@ minVersion: 0.23.1
changelogPolicy: simple
artifactProvider:
name: none
preReleaseCommand: ''
targets:
- name: github
- name: registry
Expand Down
18 changes: 5 additions & 13 deletions .github/workflows/tests.yaml
Expand Up @@ -24,7 +24,6 @@ jobs:
- '8.0'
- '8.1'
symfony-version:
- 3.4.*
- 4.4.*
- 5.*
- 6.*
Expand All @@ -37,14 +36,7 @@ jobs:
symfony-version: 6.*
- php: '7.4'
symfony-version: 6.*
- php: '8.0'
symfony-version: 3.4.*
- php: '8.1'
symfony-version: 3.4.*
include:
- php: '7.2'
symfony-version: 3.4.*
dependencies: lowest
- php: '7.2'
symfony-version: 4.4.*
dependencies: lowest
Expand All @@ -71,9 +63,9 @@ jobs:
- name: Setup Problem Matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Remove Symfony Messenger
run: composer remove --dev symfony/messenger --no-update
if: matrix.symfony-version == '3.4.*'
- name: Update PHPUnit
run: composer require --dev phpunit/phpunit ^9.3.9 --no-update
if: matrix.php == '8.0' && matrix.dependencies == 'lowest'

- name: Install dependencies
uses: ramsey/composer-install@v1
Expand All @@ -100,7 +92,7 @@ jobs:
include:
- php: '7.2'
dependencies: lowest
symfony-version: 3.4.*
symfony-version: 4.4.*
- php: '7.4'
dependencies: highest
- php: '8.0'
Expand All @@ -124,7 +116,7 @@ jobs:
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Remove optional packages
run: composer remove doctrine/dbal doctrine/doctrine-bundle symfony/messenger symfony/twig-bundle symfony/cache --dev --no-update
run: composer remove doctrine/dbal doctrine/doctrine-bundle symfony/messenger symfony/twig-bundle symfony/cache symfony/http-client --dev --no-update

- name: Install dependencies
uses: ramsey/composer-install@v1
Expand Down
12 changes: 11 additions & 1 deletion CHANGELOG.md
Expand Up @@ -2,6 +2,16 @@

## Unreleased

## 4.5.0 (2022-11-28)

- Symfony version 3.4 is no longer supported
- Drop Symfony support below 4.4 (#643)
- feat: Add support for tracing of Symfony HTTP client requests (#606)
- feat: Add support for HTTP client baggage propagation (#663)
- ref: Add proper HTTP client span descriptions (#680)
- feat: Support logging the impersonator user, if any (#647)
- ref: Use a constant for the SDK version (#662)

## 4.4.0 (2022-10-20)

- feat: Add support for Dynamic Sampling (#665)
Expand All @@ -12,7 +22,7 @@

## 4.3.0 (2022-05-30)

- Fix compatibility issue with Symfony >= 6.1.0 (#635)
- Fix compatibility issue with Symfony `>= 6.1.0` (#635)
- Add `TracingDriverConnectionInterface::getNativeConnection()` method to get the original driver connection (#597)
- Add `options.http_timeout` and `options.http_connect_timeout` configuration options (#593)

Expand Down
27 changes: 14 additions & 13 deletions composer.json
Expand Up @@ -28,14 +28,14 @@
"php-http/discovery": "^1.11",
"sentry/sdk": "^3.3",
"symfony/cache-contracts": "^1.1||^2.4||^3.0",
"symfony/config": "^3.4.44||^4.4.20||^5.0.11||^6.0",
"symfony/console": "^3.4.44||^4.4.20||^5.0.11||^6.0",
"symfony/dependency-injection": "^3.4.44||^4.4.20||^5.0.11||^6.0",
"symfony/event-dispatcher": "^3.4.44||^4.4.20||^5.0.11||^6.0",
"symfony/http-kernel": "^3.4.44||^4.4.20||^5.0.11||^6.0",
"symfony/config": "^4.4.20||^5.0.11||^6.0",
"symfony/console": "^4.4.20||^5.0.11||^6.0",
"symfony/dependency-injection": "^4.4.20||^5.0.11||^6.0",
"symfony/event-dispatcher": "^4.4.20||^5.0.11||^6.0",
"symfony/http-kernel": "^4.4.20||^5.0.11||^6.0",
"symfony/polyfill-php80": "^1.22",
"symfony/psr-http-message-bridge": "^1.2||^2.0",
"symfony/security-core": "^3.4.44||^4.4.20||^5.0.11||^6.0"
"symfony/security-core": "^4.4.20||^5.0.11||^6.0"
},
"require-dev": {
"doctrine/dbal": "^2.13||^3.0",
Expand All @@ -50,16 +50,17 @@
"phpstan/phpstan-phpunit": "^1.0",
"phpstan/phpstan-symfony": "^1.0",
"phpunit/phpunit": "^8.5.14||^9.3.9",
"symfony/browser-kit": "^3.4.44||^4.4.20||^5.0.11||^6.0",
"symfony/cache": "^3.4.44||^4.4.20||^5.0.11||^6.0",
"symfony/dom-crawler": "^3.4.44||^4.4.20||^5.0.11||^6.0",
"symfony/framework-bundle": "^3.4.44||^4.4.20||^5.0.11||^6.0",
"symfony/browser-kit": "^4.4.20||^5.0.11||^6.0",
"symfony/cache": "^4.4.20||^5.0.11||^6.0",
"symfony/dom-crawler": "^4.4.20||^5.0.11||^6.0",
"symfony/framework-bundle": "^4.4.20||^5.0.11||^6.0",
"symfony/http-client": "^4.4.20||^5.0.11||^6.0",
"symfony/messenger": "^4.4.20||^5.0.11||^6.0",
"symfony/monolog-bundle": "^3.4",
"symfony/phpunit-bridge": "^5.2.6||^6.0",
"symfony/process": "^3.4.44||^4.4.20||^5.0.11||^6.0",
"symfony/twig-bundle": "^3.4.44||^4.4.20||^5.0.11||^6.0",
"symfony/yaml": "^3.4.44||^4.4.20||^5.0.11||^6.0",
"symfony/process": "^4.4.20||^5.0.11||^6.0",
"symfony/twig-bundle": "^4.4.20||^5.0.11||^6.0",
"symfony/yaml": "^4.4.20||^5.0.11||^6.0",
"vimeo/psalm": "^4.3"
},
"suggest": {
Expand Down
129 changes: 44 additions & 85 deletions phpstan-baseline.neon
Expand Up @@ -105,6 +105,11 @@ parameters:
count: 1
path: src/DependencyInjection/SentryExtension.php

-
message: "#^Parameter \\#2 \\$config of method Sentry\\\\SentryBundle\\\\DependencyInjection\\\\SentryExtension\\:\\:registerHttpClientTracingConfiguration\\(\\) expects array\\<string, mixed\\>, mixed given\\.$#"
count: 1
path: src/DependencyInjection/SentryExtension.php

-
message: "#^Parameter \\#2 \\$config of method Sentry\\\\SentryBundle\\\\DependencyInjection\\\\SentryExtension\\:\\:registerMessengerListenerConfiguration\\(\\) expects array\\<string, mixed\\>, mixed given\\.$#"
count: 1
Expand All @@ -122,7 +127,7 @@ parameters:

-
message: "#^Parameter \\#2 \\$config of method Symfony\\\\Component\\\\DependencyInjection\\\\Extension\\\\Extension\\:\\:isConfigEnabled\\(\\) expects array, mixed given\\.$#"
count: 3
count: 4
path: src/DependencyInjection/SentryExtension.php

-
Expand Down Expand Up @@ -150,26 +155,11 @@ parameters:
count: 1
path: src/EventListener/ConsoleCommandListener.php

-
message: "#^Else branch is unreachable because previous condition is always true\\.$#"
count: 1
path: src/EventListener/ErrorListener.php

-
message: "#^Call to an undefined method Symfony\\\\Component\\\\HttpKernel\\\\Event\\\\KernelEvent\\:\\:isMasterRequest\\(\\)\\.$#"
count: 1
path: src/EventListener/RequestListener.php

-
message: "#^Cannot call method getUser\\(\\) on Symfony\\\\Component\\\\Security\\\\Core\\\\Authentication\\\\Token\\\\TokenInterface\\|null\\.$#"
count: 1
path: src/EventListener/RequestListener.php

-
message: "#^Parameter \\#1 \\$user of method Sentry\\\\SentryBundle\\\\EventListener\\\\RequestListener\\:\\:getUsername\\(\\) expects object\\|string, Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\|null given\\.$#"
count: 1
path: src/EventListener/RequestListener.php

-
message: "#^Call to an undefined method Symfony\\\\Component\\\\HttpKernel\\\\Event\\\\KernelEvent\\:\\:isMasterRequest\\(\\)\\.$#"
count: 1
Expand Down Expand Up @@ -240,6 +230,31 @@ parameters:
count: 1
path: src/Tracing/Doctrine/DBAL/TracingStatementForV3.php

-
message: "#^Parameter \\#4 \\$length of method Doctrine\\\\DBAL\\\\Driver\\\\Statement\\:\\:bindParam\\(\\) expects int\\|null, mixed given\\.$#"
count: 1
path: src/Tracing/Doctrine/DBAL/TracingStatementForV3.php

-
message: "#^Method Sentry\\\\SentryBundle\\\\Tracing\\\\HttpClient\\\\AbstractTraceableHttpClient\\:\\:request\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
count: 1
path: src/Tracing/HttpClient/AbstractTraceableHttpClient.php

-
message: "#^Method Sentry\\\\SentryBundle\\\\Tracing\\\\HttpClient\\\\AbstractTraceableResponse\\:\\:toArray\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
path: src/Tracing/HttpClient/AbstractTraceableResponse.php

-
message: "#^Method Sentry\\\\SentryBundle\\\\Tracing\\\\HttpClient\\\\TraceableHttpClientForV6\\:\\:withOptions\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
count: 1
path: src/Tracing/HttpClient/TraceableHttpClientForV6.php

-
message: "#^Call to an undefined method Symfony\\\\Contracts\\\\HttpClient\\\\ResponseInterface\\:\\:toStream\\(\\)\\.$#"
count: 1
path: src/Tracing/HttpClient/TraceableResponseForV6.php

-
message: "#^Cannot access offset 'sample_rate' on mixed\\.$#"
count: 1
Expand Down Expand Up @@ -280,73 +295,28 @@ parameters:
count: 1
path: tests/End2End/TracingEnd2EndTest.php

-
message: "#^Call to method getException\\(\\) on an unknown class Symfony\\\\Component\\\\HttpKernel\\\\Event\\\\GetResponseForExceptionEvent\\.$#"
count: 1
path: tests/EventListener/ErrorListenerTest.php

-
message: "#^Instantiated class Symfony\\\\Component\\\\HttpKernel\\\\Event\\\\GetResponseForExceptionEvent not found\\.$#"
count: 1
path: tests/EventListener/ErrorListenerTest.php

-
message: "#^Parameter \\#1 \\$event of method Sentry\\\\SentryBundle\\\\EventListener\\\\ErrorListener\\:\\:handleExceptionEvent\\(\\) expects Symfony\\\\Component\\\\HttpKernel\\\\Event\\\\ExceptionEvent, Symfony\\\\Component\\\\HttpKernel\\\\Event\\\\ExceptionEvent\\|Symfony\\\\Component\\\\HttpKernel\\\\Event\\\\GetResponseForExceptionEvent given\\.$#"
count: 1
path: tests/EventListener/ErrorListenerTest.php

-
message: "#^Parameter \\$event of method Sentry\\\\SentryBundle\\\\Tests\\\\EventListener\\\\ErrorListenerTest\\:\\:testHandleExceptionEvent\\(\\) has invalid type Symfony\\\\Component\\\\HttpKernel\\\\Event\\\\GetResponseForExceptionEvent\\.$#"
count: 1
path: tests/EventListener/ErrorListenerTest.php

-
message: "#^Class Symfony\\\\Component\\\\Messenger\\\\Event\\\\WorkerMessageFailedEvent constructor invoked with 4 parameters, 3 required\\.$#"
count: 1
path: tests/EventListener/MessengerListenerTest.php

-
message: "#^If condition is always false\\.$#"
count: 1
path: tests/EventListener/MessengerListenerTest.php

-
message: "#^Call to function method_exists\\(\\) with \\$this\\(Sentry\\\\SentryBundle\\\\Tests\\\\EventListener\\\\AuthenticatedTokenStub\\) and 'setAuthenticated' will always evaluate to false\\.$#"
count: 1
path: tests/EventListener/RequestListenerTest.php

-
message: "#^Instantiated class Symfony\\\\Component\\\\HttpKernel\\\\Event\\\\FilterControllerEvent not found\\.$#"
count: 3
path: tests/EventListener/RequestListenerTest.php

-
message: "#^Instantiated class Symfony\\\\Component\\\\HttpKernel\\\\Event\\\\GetResponseEvent not found\\.$#"
count: 9
path: tests/EventListener/RequestListenerTest.php

-
message: "#^Parameter \\#1 \\$event of method Sentry\\\\SentryBundle\\\\EventListener\\\\RequestListener\\:\\:handleKernelControllerEvent\\(\\) expects Symfony\\\\Component\\\\HttpKernel\\\\Event\\\\ControllerEvent, Symfony\\\\Component\\\\HttpKernel\\\\Event\\\\ControllerEvent\\|Symfony\\\\Component\\\\HttpKernel\\\\Event\\\\FilterControllerEvent given\\.$#"
count: 1
path: tests/EventListener/RequestListenerTest.php

-
message: "#^Parameter \\#1 \\$event of method Sentry\\\\SentryBundle\\\\EventListener\\\\RequestListener\\:\\:handleKernelRequestEvent\\(\\) expects Symfony\\\\Component\\\\HttpKernel\\\\Event\\\\RequestEvent, Symfony\\\\Component\\\\HttpKernel\\\\Event\\\\GetResponseEvent\\|Symfony\\\\Component\\\\HttpKernel\\\\Event\\\\RequestEvent given\\.$#"
message: "#^Parameter \\#1 \\$user of method Symfony\\\\Component\\\\Security\\\\Core\\\\Authentication\\\\Token\\\\AbstractToken\\:\\:setUser\\(\\) expects Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface, string\\|Stringable\\|Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface given\\.$#"
count: 1
path: tests/EventListener/RequestListenerTest.php

-
message: "#^Parameter \\#1 \\$user of method Symfony\\\\Component\\\\Security\\\\Core\\\\Authentication\\\\Token\\\\AbstractToken\\:\\:setUser\\(\\) expects Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface, string\\|Stringable\\|Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface given\\.$#"
message: "#^Parameter \\#3 \\$roles of class Symfony\\\\Component\\\\Security\\\\Core\\\\Authentication\\\\Token\\\\SwitchUserToken constructor expects array\\<string\\>, string given\\.$#"
count: 1
path: tests/EventListener/RequestListenerTest.php

-
message: "#^Parameter \\$controllerEvent of method Sentry\\\\SentryBundle\\\\Tests\\\\EventListener\\\\RequestListenerTest\\:\\:testHandleKernelControllerEvent\\(\\) has invalid type Symfony\\\\Component\\\\HttpKernel\\\\Event\\\\FilterControllerEvent\\.$#"
message: "#^Parameter \\#4 \\$originalToken of class Symfony\\\\Component\\\\Security\\\\Core\\\\Authentication\\\\Token\\\\SwitchUserToken constructor expects Symfony\\\\Component\\\\Security\\\\Core\\\\Authentication\\\\Token\\\\TokenInterface, array\\<int, string\\> given\\.$#"
count: 1
path: tests/EventListener/RequestListenerTest.php

-
message: "#^Parameter \\$requestEvent of method Sentry\\\\SentryBundle\\\\Tests\\\\EventListener\\\\RequestListenerTest\\:\\:testHandleKernelRequestEvent\\(\\) has invalid type Symfony\\\\Component\\\\HttpKernel\\\\Event\\\\GetResponseEvent\\.$#"
message: "#^Parameter \\#5 \\$originatedFromUri of class Symfony\\\\Component\\\\Security\\\\Core\\\\Authentication\\\\Token\\\\SwitchUserToken constructor expects string\\|null, Sentry\\\\SentryBundle\\\\Tests\\\\EventListener\\\\AuthenticatedTokenStub given\\.$#"
count: 1
path: tests/EventListener/RequestListenerTest.php

Expand All @@ -355,26 +325,6 @@ parameters:
count: 1
path: tests/EventListener/SubRequestListenerTest.php

-
message: "#^Instantiated class Symfony\\\\Component\\\\HttpKernel\\\\Event\\\\GetResponseEvent not found\\.$#"
count: 2
path: tests/EventListener/SubRequestListenerTest.php

-
message: "#^Parameter \\#1 \\$event of method Sentry\\\\SentryBundle\\\\EventListener\\\\SubRequestListener\\:\\:handleKernelRequestEvent\\(\\) expects Symfony\\\\Component\\\\HttpKernel\\\\Event\\\\RequestEvent, Symfony\\\\Component\\\\HttpKernel\\\\Event\\\\GetResponseEvent\\|Symfony\\\\Component\\\\HttpKernel\\\\Event\\\\RequestEvent given\\.$#"
count: 1
path: tests/EventListener/SubRequestListenerTest.php

-
message: "#^Parameter \\#1 \\$event of method Sentry\\\\SentryBundle\\\\Tests\\\\EventListener\\\\SubRequestListenerTest\\:\\:isMainRequest\\(\\) expects Symfony\\\\Component\\\\HttpKernel\\\\Event\\\\KernelEvent, Symfony\\\\Component\\\\HttpKernel\\\\Event\\\\GetResponseEvent\\|Symfony\\\\Component\\\\HttpKernel\\\\Event\\\\RequestEvent given\\.$#"
count: 1
path: tests/EventListener/SubRequestListenerTest.php

-
message: "#^Parameter \\$event of method Sentry\\\\SentryBundle\\\\Tests\\\\EventListener\\\\SubRequestListenerTest\\:\\:testHandleKernelRequestEvent\\(\\) has invalid type Symfony\\\\Component\\\\HttpKernel\\\\Event\\\\GetResponseEvent\\.$#"
count: 1
path: tests/EventListener/SubRequestListenerTest.php

-
message: "#^Call to an undefined method TCacheAdapter of Symfony\\\\Component\\\\Cache\\\\Adapter\\\\AdapterInterface\\:\\:delete\\(\\)\\.$#"
count: 2
Expand Down Expand Up @@ -495,3 +445,12 @@ parameters:
count: 1
path: tests/Tracing/Doctrine/DBAL/TracingStatementForV2Test.php

-
message: "#^Parameter \\#1 \\$responses of method Sentry\\\\SentryBundle\\\\Tracing\\\\HttpClient\\\\AbstractTraceableHttpClient\\:\\:stream\\(\\) expects iterable\\<\\(int\\|string\\), Symfony\\\\Contracts\\\\HttpClient\\\\ResponseInterface\\>\\|Symfony\\\\Contracts\\\\HttpClient\\\\ResponseInterface, stdClass given\\.$#"
count: 1
path: tests/Tracing/HttpClient/TraceableHttpClientTest.php

-
message: "#^Parameter \\#2 \\$responses of static method Sentry\\\\SentryBundle\\\\Tracing\\\\HttpClient\\\\AbstractTraceableResponse\\:\\:stream\\(\\) expects iterable\\<Sentry\\\\SentryBundle\\\\Tracing\\\\HttpClient\\\\AbstractTraceableResponse\\>, array\\<int, stdClass\\> given\\.$#"
count: 1
path: tests/Tracing/HttpClient/TraceableResponseTest.php
4 changes: 4 additions & 0 deletions phpstan.neon
Expand Up @@ -14,6 +14,10 @@ parameters:
- src/Tracing/Cache/TraceableTagAwareCacheAdapterForV2.php
- src/Tracing/Doctrine/DBAL/TracingStatementForV2.php
- src/Tracing/Doctrine/DBAL/TracingDriverForV2.php
- src/Tracing/HttpClient/TraceableHttpClientForV4.php
- src/Tracing/HttpClient/TraceableHttpClientForV5.php
- src/Tracing/HttpClient/TraceableResponseForV4.php
- src/Tracing/HttpClient/TraceableResponseForV5.php
- tests/End2End/App
- tests/Tracing/Doctrine/DBAL/TracingDriverForV2Test.php
- tests/EventListener/Fixtures/UserWithoutIdentifierStub.php
Expand Down
29 changes: 29 additions & 0 deletions psalm-baseline.xml
Expand Up @@ -50,6 +50,16 @@
<code>$params</code>
</MoreSpecificImplementedParamType>
</file>
<file src="src/Tracing/HttpClient/TraceableResponseForV5.php">
<UndefinedInterfaceMethod occurrences="1">
<code>toStream</code>
</UndefinedInterfaceMethod>
</file>
<file src="src/Tracing/HttpClient/TraceableResponseForV6.php">
<UndefinedInterfaceMethod occurrences="1">
<code>toStream</code>
</UndefinedInterfaceMethod>
</file>
<file src="src/aliases.php">
<MissingDependency occurrences="1">
<code>TracingDriverForV2</code>
Expand All @@ -63,4 +73,23 @@
<code>PostResponseEvent</code>
</UndefinedClass>
</file>
<file src="src/DependencyInjection/Compiler/CacheTracingPass.php">
<UndefinedDocblockClass occurrences="1">
<code>$container-&gt;getParameter('sentry.tracing.cache.enabled')</code>
</UndefinedDocblockClass>
</file>
<file src="src/DependencyInjection/Compiler/HttpClientTracingPass.php">
<UndefinedDocblockClass occurrences="2">
<code>$container-&gt;getParameter('sentry.tracing.enabled')</code>
<code>$container-&gt;getParameter('sentry.tracing.http_client.enabled')</code>
</UndefinedDocblockClass>
</file>
<file src="src/DependencyInjection/Compiler/DbalTracingPass.php">
<UndefinedDocblockClass occurrences="4">
<code>$container-&gt;getParameter('sentry.tracing.enabled')</code>
<code>$container-&gt;getParameter('sentry.tracing.dbal.enabled')</code>
<code>$container-&gt;getParameter('sentry.tracing.dbal.connections')</code>
<code>$container-&gt;getParameter('doctrine.connections')</code>
</UndefinedDocblockClass>
</file>
</files>
2 changes: 2 additions & 0 deletions psalm.xml
Expand Up @@ -11,6 +11,8 @@
<directory name="src" />
<ignoreFiles>
<file name="src/Tracing/Doctrine/DBAL/TracingStatementForV2.php" />
<file name="src/Tracing/HttpClient/TraceableHttpClientForV4.php" />
<file name="src/Tracing/HttpClient/TraceableHttpClientForV5.php" />
<directory name="vendor" />
</ignoreFiles>
</projectFiles>
Expand Down