magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

add phpstan-deprecation-rules

Open rogerdz opened this issue 3 years ago • 6 comments

Description (*)

Static Tests: add phpstan/phpstan-deprecation-rules for detecting usage of deprecated classes, methods, properties, constants and traits.

Related Pull Requests

Manual testing scenarios (*)

  1. ...
  2. ...

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)
  • [ ] 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. [x] resolves magento/magento2#36157: add phpstan-deprecation-rules

rogerdz avatar Sep 15 '22 17:09 rogerdz

Hi @rogerdz. Thank you for your contribution Here are 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

:exclamation: 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

:information_source: Run only required test builds during development. Run all test builds before sending your pull request for review.

For more details, review the Magento Contributor Guide documentation.

:warning: According to the Magento Contribution requirements, all Pull Requests must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

:clock10: You can find the schedule on the Magento Community Calendar page.

:telephone_receiver: The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

m2-assistant[bot] avatar Sep 15 '22 17:09 m2-assistant[bot]

@magento run all tests

rogerdz avatar Sep 15 '22 17:09 rogerdz

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@magento create issue

edenduong avatar Sep 19 '22 01:09 edenduong

@magento run Functional Tests EE

engcom-Lima avatar Sep 21 '22 10:09 engcom-Lima

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

Hi @rogerdz,

We have verify the package is installed correctly. image

But while verifying changes no warning is shown if deprecated function/class is being used. please refer to below screen shot and suggest if we are missing any steps here.

Before PR

we have checked using php vendor/bin/phpcs --standard=Magento2 to see if file contains any deprecated function/class. when we are using vendor/bin/phpstan analyse on same file no warning is shown. image

After PR

No changes are seen when we are using vendor/bin/phpstan analyse on same file image

Please let us know if we are missing any steps here or any other way to verify changes.

engcom-Echo avatar Nov 30 '22 09:11 engcom-Echo

Hi @engcom-Echo , right command is : vendor/bin/phpstan analyse --configuration dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/phpstan.neon --level 1 --memory-limit=4G --error-format=filtered app/code/Magento/BundleSampleData/Model/Product.php 2022-12-04_22-39

rogerdz avatar Dec 04 '22 15:12 rogerdz

@magento run all tests

rogerdz avatar Dec 04 '22 15:12 rogerdz

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@magento run all tests

engcom-Echo avatar Dec 05 '22 05:12 engcom-Echo

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@rogerdz @edenduong Thanks for the collaboration & contribution!

:heavy_check_mark: QA Passed

add phpstan-deprecation-rules

Manual Scenario Steps

  1. New Magento installation run command mention in comment

Before: :heavy_multiplication_x: before

After: :heavy_check_mark:

after

engcom-Echo avatar Dec 05 '22 05:12 engcom-Echo

@magento run WebAPI Tests,Functional Tests EE,Integration Tests,Functional Tests CE

engcom-Echo avatar Dec 05 '22 07:12 engcom-Echo

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

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

engcom-Echo avatar Dec 05 '22 09:12 engcom-Echo

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

It seems bot moved this PR from Merge in Progress to Ready for Testing hence moving it back.

engcom-Charlie avatar Jan 31 '23 17:01 engcom-Charlie

@magento run Static Tests

engcom-Charlie avatar Feb 07 '23 08:02 engcom-Charlie

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

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

engcom-Charlie avatar Feb 07 '23 09:02 engcom-Charlie

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@magento run Static Tests

engcom-Charlie avatar Feb 07 '23 14:02 engcom-Charlie

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

Moving this PR back to Changes Requested to update the PR branch with latest magento code and resolve the conflicts.

Thank you!

engcom-Charlie avatar Sep 07 '23 10:09 engcom-Charlie

@magento run all tests

rogerdz avatar Sep 10 '23 16:09 rogerdz

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.