Skip to content

Conversation

thomas-kl1
Copy link
Member

@thomas-kl1 thomas-kl1 commented Jul 18, 2025

Description (*)

Developer may disable a plugin from module (A) with a third party module (B).
The plugin is referenced in di.xml thanks to its name and the attribute "disabled" is set to 'true'. The attribute "type" is not set.
If the module (A) is removed, and the referenced plugin in module (B) is not removed, Magento will report this as an error (info level) in the logs. This has effect to flood the logs with false positive cases.
Indeed, we should only log the plugin who are actually undeclared and not used (enabled and missing instance).

Manual testing scenarios (*)

Module A:

<type name="Magento\SalesRule\Model\Rule\Condition\Product">
    <plugin name="Foo_Bar::Conditions" type="Foo\Bar\Plugin\Condition\Product"/>
</type>

Remove the plugin declaration from module A (above declaration).

Module B (with sequence on Module A):

<type name="Magento\SalesRule\Model\Rule\Condition\Product">
    <plugin name="Foo_Bar::Conditions" disabled="true"/>
</type>

Expected: no logs.

Actual: logs entries:

[2025-07-18T12:18:49.535562+00:00] main.INFO: Reference to undeclared plugin with name 'Foo_Bar::Conditions'. [] []

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)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)

Resolved issues:

  1. resolves [Issue] Log undeclared plugin only if it is not disabled #40086: Log undeclared plugin only if it is not disabled

Copy link

m2-assistant bot commented Jul 18, 2025

Hi @thomas-kl1. Thank you for your contribution!
Here are some useful tips on how you can test your changes using Magento test environment.
❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names.

Allowed build names are:
  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests
  13. Semantic Version Checker

You can find more information about the builds here
ℹ️ Run only required test builds during development. Run all test builds before sending your pull request for review.


For more details, review the Code Contributions documentation.
Join Magento Community Engineering Slack and ask your questions in #github channel.

@lbajsarowicz
Copy link
Contributor

  1. I think this should be debug
  2. In a perfect world, I'd prefer this to be triggered only in DEV mode.

We already have tons of completely unnecessary logs about Admin menu rendering, that noone needs.

@thomas-kl1
Copy link
Member Author

Hello @lbajsarowicz I totally agree.

My description was not clear and I've tried to updated it in hope to be more understandable.
I've updated the condition to log as debug level only if the app is in developer mode, or if the actual plugin is enabled, but its instance is missing.

Thanks for your feedback!

@engcom-Hotel engcom-Hotel added Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it Priority: P2 A defect with this priority could have functionality issues which are not to expectations. labels Jul 21, 2025
@engcom-Hotel
Copy link
Contributor

@magento create issue

Copy link
Contributor

@engcom-Hotel engcom-Hotel left a comment

Choose a reason for hiding this comment

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

Hello @thomas-kl1,

Thanks for the contribution!

The changes looks good to us, but please add some automated test in accordance to DOD.

Thanks

@engcom-Hotel
Copy link
Contributor

@magento run all tests

@thomas-kl1
Copy link
Member Author

The changes looks good to us, but please add some automated test in accordance to DOD.

OFC. I'll check the existing tests and add new ones if necessary.

@thomas-kl1
Copy link
Member Author

@magento run all tests

@engcom-Hotel
Copy link
Contributor

@magento run Database Compare, Functional Tests B2B, Functional Tests CE, Functional Tests EE

1 similar comment
@engcom-Hotel
Copy link
Contributor

@magento run Database Compare, Functional Tests B2B, Functional Tests CE, Functional Tests EE

Copy link
Contributor

@engcom-Hotel engcom-Hotel left a comment

Choose a reason for hiding this comment

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

Hello @thomas-kl1,

Thanks for the changes!

Please refer to the below review comment. Apart from this please refer this #40086 (comment). We are unable to reproduce the issue mentioned here.

Thanks

@ct-prd-projects-boards-automation ct-prd-projects-boards-automation bot moved this from Changes Requested to Ready for Testing in Community Dashboard Aug 18, 2025
@ct-prd-projects-boards-automation ct-prd-projects-boards-automation bot moved this from Ready for Testing to Review in Progress in Community Dashboard Aug 18, 2025
@engcom-Hotel engcom-Hotel moved this from Review in Progress to Ready for Testing in Community Dashboard Aug 18, 2025
@engcom-Charlie
Copy link
Contributor

@magento run all tests

@engcom-Charlie
Copy link
Contributor

✔️ QA Passed

Steps to reproduce

  1. Created 2 modules as mentioned in [Issue] Log undeclared plugin only if it is not disabled #40086 (comment).
  2. php bin/magento module:enable Magz_Issue40086 Magz_Issue40086B
  3. php bin/magento setup:upgrade
  4. php bin/magento module:disable Magz_Issue40086
  5. php bin/magento setup:upgrade
  6. rm -rf generated/code/*
  7. Create Cart price rule

Before: ❌
The system.log shows entries for " main.INFO: Reference to undeclared plugin with name " hence confirming the issue.
image

After: ✔️
No log found.

Moving this PR to Extended Testing to look into the build failures.

@engcom-Charlie engcom-Charlie moved this from Testing in Progress to Extended testing (optional) in Community Dashboard Aug 25, 2025
@engcom-Charlie
Copy link
Contributor

@magento run all tests

@engcom-Charlie
Copy link
Contributor

@magento run Functional Tests B2B, Functional Tests CE, Functional Tests EE

@engcom-Charlie
Copy link
Contributor

Few of the Functional CE, B2B, EE failures are not consistent. They seems to be flaky, neither part of this PR nor failing because of the PR changes. The rest consistent once are known issues. Hence moving this PR to Merge in Progress.

Functional B2B: Run 1:
https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/40081/c847a7b5fb056610cc328801efc56538/Functional/allure-report-b2b/index.html#categories/494aa5610e07373f0a3ae73eacf3dae2/10a395589048ad6c/

image

Run 2:
https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/40081/a8533f970bce91cbc75794cceca11d3a/Functional/allure-report-b2b/index.html#categories/8f0831c1d06562890f5ec21062dae309/36f037d9fa67a847/

image

Known Issues:
ACQE-8610: AdminStagingDashboardProvideAbilityToViewEditForUpdatesWithCartPriceRuleTest
ACQE-8608:ViewportSwitcherMobileHTMLThroughBlockContentTypeTest
ACQE-8609:
BlockRenderHTMLThroughBlockContentTypeTest
ACQE-8490:
AssignCustomOrderStatusNotVisibleOnStorefrontTest

Functional CE: Run 1:

https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/40081/797e23608259165f5ea67759e5803a47/Functional/allure-report-ce/index.html#categories

image

Run 2:

https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/40081/7092c149bbfdebf2be034b1a9171ab23/Functional/allure-report-ce/index.html#categories

image

Known Issues:
ACQE-8610: AdminStagingDashboardProvideAbilityToViewEditForUpdatesWithCartPriceRuleTest
ACQE-8608:ViewportSwitcherMobileHTMLThroughBlockContentTypeTest
ACQE-8609:
BlockRenderHTMLThroughBlockContentTypeTest

Functional EE: Run 1:
https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/40081/dfad8a6d6a59205cb0e9945ef2ab87d3/Functional/allure-report-ee/index.html#categories/494aa5610e07373f0a3ae73eacf3dae2/82badda85a4c393b/

image

Run 2:
https://public-results-storage-prod.magento-testing-service.engineering/reports/magento/magento2/pull/40081/3ee80e3d0696e078db7943be9d46e417/Functional/allure-report-ee/index.html#categories

image

Known Issues:
ACQE-8610: AdminStagingDashboardProvideAbilityToViewEditForUpdatesWithCartPriceRuleTest
ACQE-8608:ViewportSwitcherMobileHTMLThroughBlockContentTypeTest
ACQE-8609:
BlockRenderHTMLThroughBlockContentTypeTest
ACQE-8490:
AssignCustomOrderStatusNotVisibleOnStorefrontTest

@engcom-Charlie engcom-Charlie moved this from Extended testing (optional) to Merge in Progress in Community Dashboard Aug 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: testing in progress Project: Community Picked PRs upvoted by the community Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
Projects
Status: Merge in Progress
Development

Successfully merging this pull request may close these issues.

[Issue] Log undeclared plugin only if it is not disabled
4 participants