From 6d4b47a45970d6e4647c6ea62e57637a5ee959bd Mon Sep 17 00:00:00 2001 From: Alex Moinet Date: Thu, 30 Jan 2025 13:59:47 +0000 Subject: [PATCH] Merge down and release PHP 8.4 support (#185) * remove PHP 8.4 depreciation warning * fix test suite * removed setup-php action * updated version matrix * remove checking of the HTTP response * removed unsupported matrix combos * increased memory limit in test * Release 1.14.3 (#184) Co-authored-by: Alex Moinet --------- Co-authored-by: Aleksander Grzegorzewski Co-authored-by: Aleksander Co-authored-by: Alex Moinet --- .github/workflows/maze-runner.yml | 20 +++++++++---------- .github/workflows/test-package.yml | 10 ++++++++-- BugsnagBundle.php | 2 +- CHANGELOG.md | 11 ++++++++++ DependencyInjection/ClientFactory.php | 12 +++++------ Gemfile | 2 +- features/custom-guzzle.feature | 2 +- .../src/Controller/OomController.php | 2 +- features/fixtures/symfony-6/Dockerfile | 9 +++++---- features/ooms.feature | 6 ++---- 10 files changed, 46 insertions(+), 30 deletions(-) diff --git a/.github/workflows/maze-runner.yml b/.github/workflows/maze-runner.yml index cf4238d..648cc77 100644 --- a/.github/workflows/maze-runner.yml +++ b/.github/workflows/maze-runner.yml @@ -12,13 +12,13 @@ jobs: strategy: fail-fast: false matrix: - php-version: ['8.0'] - symfony-version: [4, 5, 6] - include: - - php-version: '7.2' - symfony-version: 2 - - php-version: '8.3' - symfony-version: 7 + php-version: ['8.0', '8.1', '8.2', '8.3', '8.4'] + symfony-version: [5, 6, 7] + exclude: + - php-version: 8.0 + symfony-version: 7 + - php-version: 8.1 + symfony-version: 7 steps: - uses: actions/checkout@v2 @@ -26,13 +26,13 @@ jobs: - name: Install libcurl4-openssl-dev and net-tools run: | sudo apt-get update - sudo apt-get install libcurl4-openssl-dev - sudo apt-get install net-tools + sudo apt-get -y install libcurl4-openssl-dev + sudo apt-get -y install net-tools - name: install Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: '3.0' + ruby-version: '3.2.3' bundler-cache: true - run: bundle exec maze-runner --no-source diff --git a/.github/workflows/test-package.yml b/.github/workflows/test-package.yml index 989e235..0105e29 100644 --- a/.github/workflows/test-package.yml +++ b/.github/workflows/test-package.yml @@ -96,7 +96,13 @@ jobs: symfony-version: '^6.0' - php-version: '8.3' symfony-version: '^7.0' - - php-version: '8.3' + - php-version: '8.4' + symfony-version: '^5.0' + - php-version: '8.4' + symfony-version: '^6.0' + - php-version: '8.4' + symfony-version: '^7.0' + - php-version: '8.4' symfony-version: 'latest' steps: @@ -120,7 +126,7 @@ jobs: if: ${{ matrix.symfony-version == 'latest' }} uses: actions/setup-python@v2 with: - python-version: '3.8' + python-version: '3.13' - run: composer validate diff --git a/BugsnagBundle.php b/BugsnagBundle.php index 2df83df..112704f 100644 --- a/BugsnagBundle.php +++ b/BugsnagBundle.php @@ -11,5 +11,5 @@ class BugsnagBundle extends Bundle * * @return string */ - const VERSION = '1.14.2'; + const VERSION = '1.14.3'; } diff --git a/CHANGELOG.md b/CHANGELOG.md index b54d278..6058f41 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,17 @@ Changelog ========= +## v1.14.3 (2025-01-30) + +This release should ensure compatibility with PHP 8.4 by removing the usage of certain +deprecated features by: +- Removing type annotations from parameters defaulting to `null`. Comment type annotations will continue to be present and accurate + +### Fixes + +* Ensure PHP 8.4 compatibility + [#183](https://github.com/bugsnag/bugsnag-symfony/pull/183) + ## 1.14.2 (2024-06-06) ### Bug Fixes diff --git a/DependencyInjection/ClientFactory.php b/DependencyInjection/ClientFactory.php index bfb477a..da0b6de 100644 --- a/DependencyInjection/ClientFactory.php +++ b/DependencyInjection/ClientFactory.php @@ -262,8 +262,8 @@ class ClientFactory */ public function __construct( SymfonyResolver $resolver, - TokenStorageInterface $tokens = null, - AuthorizationCheckerInterface $checker = null, + $tokens = null, + $checker = null, $key = null, $endpoint = null, $callbacks = true, @@ -278,12 +278,12 @@ public function __construct( $root = null, $env = null, $stage = null, - array $stages = null, - array $filters = null, - ShutdownStrategyInterface $shutdownStrategy = null, + $stages = null, + $filters = null, + $shutdownStrategy = null, $stripPathRegex = null, $projectRootRegex = null, - GuzzleHttp\ClientInterface $guzzle = null, + $guzzle = null, $memoryLimitIncrease = false, array $discardClasses = [], array $redactedKeys = [], diff --git a/Gemfile b/Gemfile index 57d8631..c205c35 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,4 @@ source 'https://rubygems.org' -gem 'bugsnag-maze-runner', git: 'https://github.com/bugsnag/maze-runner', tag: 'v6.9.0' +gem 'bugsnag-maze-runner', git: 'https://github.com/bugsnag/maze-runner', tag: 'v9.22.0' gem 'webrick' diff --git a/features/custom-guzzle.feature b/features/custom-guzzle.feature index 09e93ec..78e268a 100644 --- a/features/custom-guzzle.feature +++ b/features/custom-guzzle.feature @@ -5,7 +5,7 @@ Scenario: Custom Guzzle client is not used when config is not setup When I navigate to the route "/unhandled/controller/exception" And I wait to receive an error Then the error is valid for the error reporting API version "4.0" for the "Bugsnag Symfony" notifier - And the error "X-Custom-Guzzle" header is null + And the error "X-Custom-Guzzle" header is not present Scenario: A custom Guzzle client can be used Given I set environment variable "BUGSNAG_GUZZLE" to "custom_guzzle" diff --git a/features/fixtures/symfony-5/src/Controller/OomController.php b/features/fixtures/symfony-5/src/Controller/OomController.php index 6940310..73e5060 100644 --- a/features/fixtures/symfony-5/src/Controller/OomController.php +++ b/features/fixtures/symfony-5/src/Controller/OomController.php @@ -23,7 +23,7 @@ public function bigOom(): Response */ public function smallOom(): Response { - ini_set('memory_limit', memory_get_usage() + (1024 * 1024 * 5)); + ini_set('memory_limit', memory_get_usage() + (1024 * 1024 * 10)); ini_set('display_errors', true); $i = 0; diff --git a/features/fixtures/symfony-6/Dockerfile b/features/fixtures/symfony-6/Dockerfile index 3025745..a0d6600 100644 --- a/features/fixtures/symfony-6/Dockerfile +++ b/features/fixtures/symfony-6/Dockerfile @@ -18,12 +18,13 @@ ENV BUGSNAG_DISCARD_CLASSES $BUGSNAG_DISCARD_CLASSES ENV BUGSNAG_GUZZLE $BUGSNAG_GUZZLE ENV BUGSNAG_FEATURE_FLAGS $BUGSNAG_FEATURE_FLAGS ENV COMPOSER_GITHUB_TOKEN $COMPOSER_GITHUB_TOKEN +ENV BUGSNAG_MEMORY_LIMIT_INCREASE 10485760 RUN apt-get update && \ - apt-get install -y --no-install-recommends \ - git \ - zip \ - unzip + apt-get install -y --no-install-recommends \ + git \ + zip \ + unzip COPY . . COPY --from=composer:2.2 /usr/bin/composer /usr/local/bin/composer diff --git a/features/ooms.feature b/features/ooms.feature index 2333c0f..a050acd 100644 --- a/features/ooms.feature +++ b/features/ooms.feature @@ -4,8 +4,7 @@ Feature: Out of memory error support Scenario: OOM from a single large allocation Given I start the symfony fixture When I navigate to the route "/oom/big" - Then the Symfony response matches "Allowed memory size of \d+ bytes exhausted \(tried to allocate \d+ bytes\)" - When I wait to receive an error + And I wait to receive an error Then the error is valid for the error reporting API version "4.0" for the "Bugsnag Symfony" notifier And the exception "errorClass" equals "Symfony\Component\ErrorHandler\Error\OutOfMemoryError" And the exception "message" matches "Allowed memory size of \d+ bytes exhausted \(tried to allocate \d+ bytes\)" @@ -26,8 +25,7 @@ Scenario: OOM from many small allocations Given I set environment variable "APP_DEBUG" to "0" And I start the symfony fixture When I navigate to the route "/oom/small" - Then the Symfony response matches "Allowed memory size of \d+ bytes exhausted \(tried to allocate \d+ bytes\)" - When I wait to receive an error + And I wait to receive an error Then the error is valid for the error reporting API version "4.0" for the "Bugsnag Symfony" notifier And the exception "errorClass" equals "Symfony\Component\ErrorHandler\Error\OutOfMemoryError" And the exception "message" matches "Allowed memory size of \d+ bytes exhausted \(tried to allocate \d+ bytes\)"