Skip to content

Conversation

escopecz
Copy link
Member

@escopecz escopecz commented Mar 27, 2025

Q A
Bug fix? (use the a.b branch)
New feature/enhancement? (use the a.x branch) ✔️
Deprecations?
BC breaks? (use the c.x branch)
Automated tests included? ✔️ yea, if the e2e tests pass then we are good
Related user documentation PR URL mautic/user-documentation#...
Related developer documentation PR URL mautic/developer-documentation-new#...
Issue(s) addressed Fixes #...

Description

Codeception is one of the libraries we'll have to update to get to Symfony 7. See

composer why-not symfony/console 7.2
doctrine/migrations      3.5.5     requires  symfony/console (^4.4.16 || ^5.4 || ^6.0)      
mautic/core-lib          7.0.0-dev requires  symfony/console (^6.4)                         
psy/psysh                v0.11.22  requires  symfony/console (^6.0 || ^5.0 || ^4.0 || ^3.4) 
symfony/framework-bundle v6.4.13   conflicts symfony/console (<5.4|>=7.0) 

I run this: composer update codeception/* --dev -W

And then:

composer why-not symfony/console 7.2
doctrine/migrations      3.5.5     requires  symfony/console (^4.4.16 || ^5.4 || ^6.0) 
mautic/core-lib          7.0.0-dev requires  symfony/console (^6.4)                    
symfony/framework-bundle v6.4.13   conflicts symfony/console (<5.4|>=7.0)

Full list of dependency upgrades:

Lock file operations: 0 installs, 26 updates, 5 removals
  - Removing phpdocumentor/reflection-common (2.2.0)
  - Removing phpdocumentor/reflection-docblock (5.6.1)
  - Removing phpdocumentor/type-resolver (1.10.0)
  - Removing phpspec/prophecy (v1.18.0)
  - Removing webmozart/assert (1.11.0)
  - Upgrading behat/gherkin (v4.9.0 => v4.12.0)
  - Upgrading codeception/codeception (5.1.2 => 5.2.1)
  - Upgrading codeception/lib-asserts (2.1.0 => 2.2.0)
  - Upgrading codeception/lib-web (1.0.6 => 1.0.7)
  - Upgrading codeception/module-db (3.1.4 => 3.2.2)
  - Upgrading codeception/stub (4.1.3 => 4.1.4)
  - Upgrading doctrine/instantiator (1.5.0 => 2.0.0)
  - Upgrading guzzlehttp/psr7 (2.6.2 => 2.7.1)
  - Upgrading myclabs/deep-copy (1.11.1 => 1.13.0)
  - Upgrading nikic/php-parser (v4.19.4 => v5.4.0)
  - Upgrading phar-io/manifest (2.0.3 => 2.0.4)
  - Upgrading php-webdriver/webdriver (1.15.1 => 1.15.2)
  - Upgrading phpunit/php-code-coverage (9.2.15 => 9.2.32)
  - Upgrading phpunit/phpunit (9.5.20 => 9.6.22)
  - Upgrading psr/http-factory (1.0.2 => 1.1.0)
  - Upgrading psy/psysh (v0.11.22 => v0.12.8)
  - Upgrading sebastian/cli-parser (1.0.1 => 1.0.2)
  - Upgrading sebastian/exporter (4.0.5 => 4.0.6)
  - Upgrading sebastian/global-state (5.0.6 => 5.0.7)
  - Upgrading sebastian/resource-operations (3.0.3 => 3.0.4)
  - Upgrading symfony/console (v6.4.15 => v6.4.17)
  - Upgrading symfony/finder (v6.4.13 => v6.4.17)
  - Upgrading symfony/string (v6.4.15 => v7.2.0)
  - Upgrading symfony/var-dumper (v6.4.15 => v6.4.18)
  - Upgrading symfony/yaml (v6.4.13 => v6.4.18)
  - Upgrading theseer/tokenizer (1.2.2 => 1.2.3)

As this have updated also PHPUNIT then PHPSTAN started complaining about deprecated method. I found a Rector rule to refactor that. I created this Rector config just for tests because the tests are excluded from normal Rector config.

<?php

declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\PHPUnit\PHPUnit100\Rector\StmtsAwareInterface\WithConsecutiveRector;

return RectorConfig::configure()
    ->withPaths([
        __DIR__ . '/app/bundles',
        __DIR__ . '/plugins',
    ])
    ->withRules([
        WithConsecutiveRector::class,
    ]);

This helped with replacing the deprecated method. However, it also broke a lot of unit tests, so I had to manually fix them. That's the majority of changes in this PR>


📋 Steps to test this PR:

Most of the changes are in the unit tests, so no production code was changed.

  1. If the GH Actions are green then we are good.

@escopecz escopecz force-pushed the updating-codeception branch from 7ef35fd to 0a246af Compare March 27, 2025 18:58
@escopecz escopecz force-pushed the updating-codeception branch from 8cc6f64 to c5b1163 Compare March 30, 2025 18:53
@escopecz escopecz changed the title Bumping codeception/* to a newer version that supports Symfony 7 Upgrading several libraries to support Symfony 7 Mar 30, 2025
@escopecz escopecz marked this pull request as ready for review March 30, 2025 19:00
@escopecz escopecz added code-review-needed PR's that require a code review before merging dependencies Pull requests that update a dependency file composer Any bugs or PRs relating to composer labels Mar 30, 2025
@escopecz escopecz added this to the 7.0.0-alpha milestone Mar 30, 2025
@escopecz escopecz requested a review from Copilot March 30, 2025 19:07
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 79 out of 99 changed files in this pull request and generated no comments.

Files not reviewed (20)
  • app/bundles/ApiBundle/Tests/EventListener/ApiSubscriberTest.php: Language not supported
  • app/bundles/ApiBundle/Tests/Form/Type/ClientTypeTest.php: Language not supported
  • app/bundles/AssetBundle/Tests/Model/AssetModelTest.php: Language not supported
  • app/bundles/CampaignBundle/Tests/Executioner/Dispatcher/ActionDispatcherTest.php: Language not supported
  • app/bundles/CampaignBundle/Tests/Executioner/Dispatcher/ConditionDispatcherTest.php: Language not supported
  • app/bundles/CampaignBundle/Tests/Executioner/Dispatcher/LegacyEventDispatcherTest.php: Language not supported
  • app/bundles/CampaignBundle/Tests/Executioner/EventExecutionerTest.php: Language not supported
  • app/bundles/CampaignBundle/Tests/Executioner/KickoffExecutionerTest.php: Language not supported
  • app/bundles/CampaignBundle/Tests/Executioner/ScheduledExecutionerTest.php: Language not supported
  • app/bundles/CampaignBundle/Tests/Executioner/Scheduler/EventSchedulerTest.php: Language not supported
  • app/bundles/CampaignBundle/Tests/Helper/NotificationHelperTest.php: Language not supported
  • app/bundles/CampaignBundle/Tests/Membership/MembershipBuilderTest.php: Language not supported
  • app/bundles/CampaignBundle/Tests/Service/CampaignAuditServiceTest.php: Language not supported
  • app/bundles/CategoryBundle/Tests/Model/ContactActionModelTest.php: Language not supported
  • app/bundles/ChannelBundle/Tests/Model/ChannelActionModelTest.php: Language not supported
  • app/bundles/ChannelBundle/Tests/Model/FrequencyActionModelTest.php: Language not supported
  • app/bundles/CoreBundle/Tests/EventListener/DashboardSubscriberTest.php: Language not supported
  • app/bundles/CoreBundle/Tests/Unit/EventListener/CommonStatsSubscriberTest.php: Language not supported
  • app/bundles/CoreBundle/Tests/Unit/Form/Type/ContentPreviewSettingsTypeTest.php: Language not supported
  • app/bundles/CoreBundle/Tests/Unit/Form/Type/DynamicContentFilterEntryFiltersTypeTest.php: Language not supported

Copy link

codecov bot commented Mar 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.59%. Comparing base (622a33f) to head (4f07631).
⚠️ Report is 1909 commits behind head on 7.x.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##                7.x   #14810      +/-   ##
============================================
+ Coverage     65.06%   65.59%   +0.52%     
- Complexity    34873    34908      +35     
============================================
  Files          2294     2296       +2     
  Lines        103999   140433   +36434     
============================================
+ Hits          67666    92114   +24448     
- Misses        36333    48319   +11986     

see 1652 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@biozshock
Copy link
Contributor

@escopecz damn, i'm on the upgrade to phpunit 10, using my simple library: https://github.com/biozshock/phpunit-consecutive . Only phpstan is left to fix to release a PR :)

Copy link
Member

@patrykgruszka patrykgruszka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍 PR removes outdated test methods, making the tests clearer and easier to debug.

Copy link
Contributor

@matbcvo matbcvo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code changes look good to me. 👍

@matbcvo matbcvo added code-review-passed PRs which have passed code review ready-to-commit PR's with 2 successful tests, 1 approval, automated tests and docs and is ready to be merged and removed code-review-needed PR's that require a code review before merging labels Mar 31, 2025
@escopecz escopecz merged commit a72f4a3 into mautic:7.x Mar 31, 2025
15 checks passed
@escopecz escopecz added the enhancement Any improvement to an existing feature or functionality label Aug 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-review-passed PRs which have passed code review composer Any bugs or PRs relating to composer dependencies Pull requests that update a dependency file enhancement Any improvement to an existing feature or functionality ready-to-commit PR's with 2 successful tests, 1 approval, automated tests and docs and is ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants