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

Feature/update di container #21905

Open
wants to merge 6 commits into
base: trunk
Choose a base branch
from
Open

Conversation

thijsoo
Copy link
Contributor

@thijsoo thijsoo commented Dec 9, 2024

Context

  • We want our packages to stay up to date.
  • This pr updates our DI container to the highest version of the Symfony DI package before it requires PHP 8.0.

Important

Take not this PR needs to be merged together with https://github.com/Yoast/wordpress-seo-local/pull/2554
Also take a look at the source issue for linked in this PR for more next steps when we are merging this.

Summary

This PR can be summarized in the following changelog entry:

  • Updates the symfony/dependency-injection package to version 5.4

Relevant technical choices:

To make this work I needed to make a couple of changes. The first change was to also include some new files in our php-scoper which are located in config/php-scoper/service-contracts.inc.php these files are needed for the DI container to compile so we need them to be copied over in our scoper.

The second change made was to mark src/introductions/infrastructure/introductions-seen-repository.php as @makePublic. This is needed because with this update the default behavior for new classes that live in Free and are used in any addon + premium is to be marked as public(false). This means that they are not included in the DI containers public classes. Which in practical terms means that YoastSEO()->classes->get('...') no longer works. We want this since we do not want our entire codebase to be public API.
This has no affect on existing classes which are located in folders that are included in the list in /config/dependency-injection/loader-pass.php in the process_definition method.

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

  • This change should have no impact. But we need to smoke test premium + all addons to make sure everything still functions as expected. To do this you need to include this feature branch in the addon with the command:
    composer require yoast/wordpress-seo:"dev-feature/update-di-container@dev as dev-release/24.1@dev" --dev
    For premium you just need:
    composer require yoast/wordpress-seo:"dev-feature/update-di-container@dev as dev-release/24.1@dev"

Relevant test scenarios

  • Changes should be tested with the browser console open
  • Changes should be tested on different posts/pages/taxonomies/custom post types/custom taxonomies
  • Changes should be tested on different editors (Default Block/Gutenberg/Classic/Elementor/other)
  • Changes should be tested on different browsers
  • Changes should be tested on multisite

Test instructions for QA when the code is in the RC

  • QA should use the same steps as above.

QA can test this PR by following these steps:

Impact check

This PR affects the following parts of the plugin, which may require extra testing:

UI changes

  • This PR changes the UI in the plugin. I have added the 'UI change' label to this PR.

Other environments

  • This PR also affects Shopify. I have added a changelog entry starting with [shopify-seo], added test instructions for Shopify and attached the Shopify label to this PR.

Documentation

  • I have written documentation for this change. For example, comments in the Relevant technical choices, comments in the code, documentation on Confluence / shared Google Drive / Yoast developer portal, or other.

Quality assurance

  • I have tested this code to the best of my abilities.
  • During testing, I had activated all plugins that Yoast SEO provides integrations for.
  • I have added unit tests to verify the code works as intended.
  • If any part of the code is behind a feature flag, my test instructions also cover cases where the feature flag is switched off.
  • I have written this PR in accordance with my team's definition of done.
  • I have checked that the base branch is correctly set.

Innovation

  • No innovation project is applicable for this PR.
  • This PR falls under an innovation project. I have attached the innovation label.
  • I have added my hours to the WBSO document.

Fixes #

@thijsoo thijsoo added the changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog label Dec 9, 2024
Copy link

composer.lock

Dev Package changes

Package Operation From To About
symfony/polyfill-php81 add - v1.31.0 view code - License: MIT License
psr/container upgrade 1.0.0 1.1.1 diff
symfony/config upgrade v3.4.32 v5.4.40 diff
symfony/dependency-injection upgrade v3.4.47 v5.4.44 diff
symfony/deprecation-contracts upgrade v2.5.2 v2.5.3 diff
symfony/filesystem upgrade v3.4.47 v4.4.42 diff
symfony/polyfill-ctype upgrade v1.29.0 v1.31.0 diff
symfony/polyfill-mbstring upgrade v1.27.0 v1.31.0 diff
symfony/polyfill-php80 upgrade v1.29.0 v1.31.0 diff
symfony/service-contracts upgrade v2.2.0 v2.5.3 diff

Settings · Docs · Powered by Private Packagist

@coveralls
Copy link

Pull Request Test Coverage Report for Build 65167cc30f069b6ea6b4a4d1940e63de466fdd3e

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 1062 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.004%) to 54.385%

Files with Coverage Reduction New Missed Lines %
src/dashboard/application/endpoints/endpoints-repository.php 5 0.0%
src/generated/container.php 1057 0.39%
Totals Coverage Status
Change from base Build cdb39e617d23ad4904ee5fae0ba4d5998754f886: -0.004%
Covered Lines: 29926
Relevant Lines: 55443

💛 - Coveralls

@thijsoo thijsoo force-pushed the feature/update-di-container branch from a6de0f5 to a67113f Compare December 10, 2024 10:17
@thijsoo thijsoo marked this pull request as ready for review December 10, 2024 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants