Skip to content

Move additional dependencies from private getters to constructor - Magento_PageCache #26684

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

Conversation

Bartlomiejsz
Copy link
Contributor

@Bartlomiejsz Bartlomiejsz commented Feb 3, 2020

Description (*)

This PR moves additionally introduced dependencies from private getter methods into constructor in Magento_PageCache module.

Related Pull Requests

Manual testing scenarios (*)

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

@m2-assistant
Copy link

m2-assistant bot commented Feb 3, 2020

Hi @Bartlomiejsz. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Guide documentation.

@magento-engcom-team magento-engcom-team added Partner: Fast White Cat partners-contribution Pull Request is created by Magento Partner labels Feb 3, 2020
@Bartlomiejsz Bartlomiejsz force-pushed the feature/dependencies_into_constructor_pagecache branch from 746b13f to c1a8ead Compare February 3, 2020 23:46
@rogyar rogyar self-assigned this Feb 4, 2020
$this->_config = $config;
$this->_cache = $cache;
$this->fullPageCache = $fullPageCache;
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @Bartlomiejsz. We can consider this change as backward incompatible. If some other class inherits the current class in some Magento based project, we will have an error upon calling parent::construct(..) in a child class because the child class is not supposed to pass $fullPageCache and $tagResolver arguments.

What I suggest here is to instantiate the corresponding object if it's not being passed as an argument. See the following instantiation as an example.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @rogyar, I asked similar question in one of my previous PRs, such non-backward compatible changes I'm doing in those PRs are based on info I received in #26269, where I was asked to replace backward-compatible change with one that doesn't use ObjectManager, since we're developing for 2.4 now.
Also such changes are being directly merged to core by Magento core team 4e6f6ae

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @Bartlomiejsz. You are right, that's fair since we are editing a non-API class. That's rather a professional habit avoid bringing backward-incompatible changes :)

$this->_config = $config;
$this->_cache = $cache;
$this->fullPageCache = $fullPageCache;
Copy link
Contributor

Choose a reason for hiding this comment

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

Please, check my previous comment regarding the backward compatibility

@rogyar
Copy link
Contributor

rogyar commented Feb 8, 2020

For QA. Looks like we have a couple of fluky functional tests since changes in the current PR are not related to order creation process somehow.

@rogyar rogyar added the Auto-Tests: Covered All changes in Pull Request is covered by auto-tests label Feb 8, 2020
@magento-engcom-team
Copy link
Contributor

Hi @rogyar, thank you for the review.
ENGCOM-6828 has been created to process this Pull Request

@engcom-Delta
Copy link
Contributor

✔️ QA passed

@engcom-Delta engcom-Delta mentioned this pull request Feb 11, 2020
4 tasks
@engcom-Charlie
Copy link
Contributor

Failed functional test not related to the changes in this PR test fails in 2.4-develop with MSI modules.
image

magento-engcom-team pushed a commit that referenced this pull request Feb 13, 2020
@magento-engcom-team magento-engcom-team merged commit a05803e into magento:2.4-develop Feb 13, 2020
@m2-assistant
Copy link

m2-assistant bot commented Feb 13, 2020

Hi @Bartlomiejsz, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@Bartlomiejsz Bartlomiejsz deleted the feature/dependencies_into_constructor_pagecache branch June 23, 2020 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Component: PageCache Partner: Fast White Cat partners-contribution Pull Request is created by Magento Partner Progress: accept Release Line: 2.4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants