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

Plugins in \Magento\Framework namespace #27962

Closed
lbajsarowicz opened this issue Apr 24, 2020 · 12 comments · Fixed by #27965
Closed

Plugins in \Magento\Framework namespace #27962

lbajsarowicz opened this issue Apr 24, 2020 · 12 comments · Fixed by #27965
Assignees
Labels
Component: Framework/App Component: Framework/Module Fixed in 2.4.x The issue has been fixed in 2.4-develop branch Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Priority: P3 May be fixed according to the position in the backlog. Progress: done Reported on 2.4.0 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it

Comments

@lbajsarowicz
Copy link
Contributor

lbajsarowicz commented Apr 24, 2020

Preconditions (*)

One of Magento Architects contacted me in private message blaming me for introducing Plugin to the Core that is not allowed in Magento and couldn't have been done by Magento Employees due to Quality Standards.

namespace Magento\Framework\App\Action\Plugin;
use Magento\Framework\Message\MessageInterface;
class Design

lol.

As I've introduced another 2 plugins and renamed existing one to follow the naming convention, there are 3 plugins in the \Magento\Framework namespace. As the architect wasn't so nice to tell me where outside \Magento\Framework` I should put these plugins, I create issue to satisfy "Quality Standards" of Magento.

The plugins to be moved:
https://github.com/magento/magento2/tree/2.4-develop/lib/internal/Magento/Framework/App/Action/Plugin

Before you continue, please remember that plugins in \Magento\Framework were never allowed!

🤦 🤦‍♂️ 🤦‍♀️ 🤦 🤦‍♂️ 🤦‍♀️ 🤦 🤦‍♂️ 🤦‍♀️ 🤦 🤦‍♂️ 🤦‍♀️

namespace Magento\Framework\Module\Plugin;
use Magento\Framework\Cache\FrontendInterface as FrontendCacheInterface;
use Magento\Framework\Module\DbVersionInfo;
use Magento\Framework\App\FrontController;
use Magento\Framework\App\RequestInterface;
use Magento\Framework\Exception\LocalizedException;
use Magento\Framework\Phrase;
/**
* Validation of DB up to date state
*/
class DbStatusValidator

magento2/app/etc/di.xml

Lines 1805 to 1807 in 892dee4

<type name="Magento\Framework\DB\Adapter\AdapterInterface">
<plugin name="execute_commit_callbacks" type="Magento\Framework\Model\ExecuteCommitCallbacks" />
</type>

https://github.com/magento/partners-magento2ee/blob/6d49dacca99f5276f09bbddd50866440f3d3fccc/app/code/Magento/ScalableCheckout/etc/di.xml#L34-L36
<type name="Magento\Framework\MessageQueue\Consumer\Config\CompositeReader">
<plugin name="queueConfigPlugin" type="Magento\Framework\MessageQueue\Config\Consumer\ConfigReaderPlugin" />
</type>
<type name="Magento\Framework\MessageQueue\Publisher\Config\CompositeReader">
<plugin name="queueConfigPlugin" type="Magento\Framework\MessageQueue\Config\Publisher\ConfigReaderPlugin" />
</type>
<type name="Magento\Framework\MessageQueue\Topology\Config\CompositeReader">
<plugin name="queueConfigPlugin" type="Magento\Framework\MessageQueue\Config\Topology\ConfigReaderPlugin" />
</type>

<type name="Magento\Eav\Model\Entity\AbstractEntity">
<plugin name="clean_cache" type="Magento\Framework\App\Cache\FlushCacheByTags" />
</type>

<type name="Magento\Framework\App\Response\Http">
<plugin name="genericHeaderPlugin" type="Magento\Framework\App\Response\HeaderManager"/>
</type>

Steps to reproduce (*)

N/A

Expected result (*)

Magento Framework shouldn't contain any plugins

Actual result (*)

  1. Magento Framework contains plugins, that should be misplaced in different modules, see description
@m2-assistant
Copy link

m2-assistant bot commented Apr 24, 2020

Hi @lbajsarowicz. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

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

@lbajsarowicz do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@ghost ghost added this to Ready for QA in Community Backlog Apr 24, 2020
@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Apr 24, 2020
@ghost ghost assigned lbajsarowicz Apr 24, 2020
@ghost ghost moved this from Ready for QA to PR In Progress in Community Backlog Apr 24, 2020
@ihor-sviziev ihor-sviziev self-assigned this Apr 24, 2020
@m2-assistant
Copy link

m2-assistant bot commented Apr 24, 2020

Hi @ihor-sviziev. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Add label Issue: Confirmed once verification is complete.

  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@ihor-sviziev ihor-sviziev added Component: Framework/App Component: Framework/Module Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Apr 24, 2020
@magento-engcom-team magento-engcom-team removed the Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed label Apr 24, 2020
@magento-engcom-team
Copy link
Contributor

magento-engcom-team commented Apr 24, 2020

@ihor-sviziev Thank you for verifying the issue.

Unfortunately, not enough information was provided to acknowledge ticket. Please consider adding the following:

  • Add "Reproduced on " label(s) to this ticket based on verification result

Once all required information is added, please add label "Issue: Confirmed" again.
Thanks!

@ghost ghost moved this from PR In Progress to Ready for QA in Community Backlog Apr 24, 2020
@ihor-sviziev ihor-sviziev added Progress: PR in progress Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed and removed Progress: ready for QA labels Apr 24, 2020
@ghost ghost moved this from Ready for QA to Ready for Dev in Community Backlog Apr 24, 2020
@magento-engcom-team
Copy link
Contributor

✅ Confirmed by @ihor-sviziev
Thank you for verifying the issue. Based on the provided information internal tickets MC-33718 were created

Issue Available: @ihor-sviziev, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@magento-engcom-team magento-engcom-team added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Apr 24, 2020
@sdzhepa sdzhepa added the Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it label Apr 29, 2020
@ghost ghost added the Priority: P3 May be fixed according to the position in the backlog. label May 7, 2020
@lbajsarowicz lbajsarowicz removed their assignment May 8, 2020
@ghost ghost moved this from PR In Progress to Ready for Dev in Community Backlog May 8, 2020
@m2-assistant
Copy link

m2-assistant bot commented May 8, 2020

Hi @maghamed. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:

  • 1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 2. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 3. If the issue is not relevant or is not reproducible any more, feel free to close it.


@ghost ghost moved this from Ready for Dev to Dev in Progress in Community Backlog May 8, 2020
@lbajsarowicz
Copy link
Contributor Author

Fixed the ActionInterface plugins. If you @maghamed care about the other plugins - assign it internally, otherwise close the ticket.

@magento-engcom-team magento-engcom-team added the Fixed in 2.4.x The issue has been fixed in 2.4-develop branch label Jun 24, 2020
@magento-engcom-team
Copy link
Contributor

Hi @lbajsarowicz. Thank you for your report.
The issue has been fixed in #27965 by @lbajsarowicz in 2.4-develop branch
Related commit(s):

The fix will be available with the upcoming 2.4.1 release.

@ghost ghost moved this from Dev in Progress to Done (last 30 days) in Community Backlog Jun 24, 2020
magento-engcom-team added a commit that referenced this issue Jun 24, 2020
…27965

 - Merge Pull Request #27965 from lbajsarowicz/magento2:bugfix/move-plugin
 - Merged commits:
   1. d938e7b
   2. ae58f56
   3. 02aae13
   4. a84633e
   5. 7ff6063
@magento-engcom-team magento-engcom-team added the Reported on 2.4.0 Indicates original Magento version for the Issue report. label Nov 13, 2020
@m2-community-project m2-community-project bot removed this from Done (last 30 days) in Community Backlog Nov 13, 2020
@DmitryFurs
Copy link
Contributor

I also found 2 plugins in the commerce edition, and they are exactly the same

vendor/magento/module-scalable-checkout/etc/di.xml

<type name="Magento\Framework\Model\ResourceModel\Db\ObjectRelationProcessor">
    <plugin name="object_constraints_resolver" type="Magento\Framework\ForeignKey\ObjectRelationProcessor\Plugin" />
</type>

vendor/magento/module-scalable-oms/etc/di.xml

<type name="Magento\Framework\Model\ResourceModel\Db\ObjectRelationProcessor">
    <plugin name="object_constraints_resolver" type="Magento\Framework\ForeignKey\ObjectRelationProcessor\Plugin" />
</type>

@ihor-sviziev
Copy link
Contributor

@DmitryFurs feel free to fill the separate issue in corresponding repository and / or create Pull Request

@DmitryFurs
Copy link
Contributor

@ihor-sviziev this applies to commerce edition. Is this the right place to create a issue?

@ihor-sviziev
Copy link
Contributor

@sidolov @gabrieldagama could you help with reporting issue to Commerce version?

@lbajsarowicz
Copy link
Contributor Author

@DmitryFurs As long as you are Magento partner, you are able to access:

If you don't have access, working with Magento partner, please reach out to @magento/community-engineering-team

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Framework/App Component: Framework/Module Fixed in 2.4.x The issue has been fixed in 2.4-develop branch Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Priority: P3 May be fixed according to the position in the backlog. Progress: done Reported on 2.4.0 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
Projects
Development

Successfully merging a pull request may close this issue.

6 participants