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

Dependency injection: fix Loader_Pass being broken on Windows #20503

Merged
merged 2 commits into from
Jul 17, 2023

Conversation

jrfnl
Copy link
Contributor

@jrfnl jrfnl commented Jul 13, 2023

Context

  • Bug fix: building DI container was broken for Windows.

Summary

This PR can be summarized in the following changelog entry:

  • Fixes a bug where building the DI container would silently fail when running on Windows.

Relevant technical choices:

Follow up on #20074, which changed the Loader_Pass class to compare paths against (other) paths with hard-coded forward slashes.

This silently broke the Dependency injection layer for anyone compiling on Windows, i.e. the DI container scripts would run without errors, but once the DI container is attempted to be used, everything breaks.

This commit should fix that in a similar way as a previous similar issue was fixed in another part of the DI container setup (PR #16364).

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

Easiest way to reproduce the original issue is as follows:
0. On a Windows computer....

  1. Check out trunk.
  2. Run composer install - the DI container will appear to be build without errors.
  3. Try running the integration tests vendor/bin/phpunit -c phpunit-integration.xml.dist and see it fail in the bootstrap before the test run even gets started.

Rinse & repeat with this branch & see things working again.

Recommendation: also test this PR on Mac and Linux just to make sure there is no regression on that side of things.

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:

  • N/A this is a fix only for devs using a Windows environment

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.

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 #

Follow up on 20074, which changed the `Loader_Pass` class to compare paths against (other) paths with hard-coded forward slashes.

This silently broke the Dependency injection layer for anyone compiling on Windows, i.e. the DI container scripts would run without errors, but once the DI container is attempted to be used, everything breaks.

This commit should fix that in a similar way as a previous similar issue was fixed in another part of the DI container setup (PR 16364).
@jrfnl jrfnl added yoast cs/qa changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog bug labels Jul 13, 2023
@jrfnl jrfnl requested a review from thijsoo July 13, 2023 13:32
@coveralls
Copy link

coveralls commented Jul 13, 2023

Pull Request Test Coverage Report for Build 5574393567

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 46.69%

Totals Coverage Status
Change from base Build 5553212711: 0.0%
Covered Lines: 12263
Relevant Lines: 26265

💛 - Coveralls

@jrfnl jrfnl added this to the 21.0 milestone Jul 13, 2023
@thijsoo thijsoo force-pushed the JRF/fix-dependency-injection-fail-on-windows branch from 3babb48 to 7030a3e Compare July 17, 2023 10:12
Copy link
Member

@enricobattocchi enricobattocchi left a comment

Choose a reason for hiding this comment

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

CR OK!
Confirmed to be fixing the issue on the Windows setup used by one of the Wincher devs.

@enricobattocchi enricobattocchi merged commit ed3961d into trunk Jul 17, 2023
21 checks passed
@enricobattocchi enricobattocchi deleted the JRF/fix-dependency-injection-fail-on-windows branch July 17, 2023 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog yoast cs/qa
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants