Skip to content

replace deprecated escaper #38135

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

Open
wants to merge 2 commits into
base: 2.4-develop
Choose a base branch
from

Conversation

Morgy93
Copy link
Member

@Morgy93 Morgy93 commented Oct 31, 2023

Description (*)

The getEscaper is deprecated so it has been replaced by dependency injection.

Manual testing scenarios (*)

  1. ./vendor/bin/phpunit -c dev/tests/unit/phpunit.xml.dist app/code/Magento/Cms/Test/Unit

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)

@m2-assistant
Copy link

m2-assistant bot commented Oct 31, 2023

Hi @Morgy93. Thank you for your contribution!
Here are some useful tips on 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

❗ 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.

@Morgy93 Morgy93 force-pushed the replace-deprecated-escaper branch from f46a30b to fd3664e Compare October 31, 2023 07:45
@Morgy93
Copy link
Member Author

Morgy93 commented Oct 31, 2023

@magento run all tests

@magento-automated-testing
Copy link

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.

@Morgy93 Morgy93 force-pushed the replace-deprecated-escaper branch from fd3664e to 59600cd Compare October 31, 2023 09:49
@Morgy93
Copy link
Member Author

Morgy93 commented Oct 31, 2023

I fixed the additional phpcs errors that came up.

@Morgy93
Copy link
Member Author

Morgy93 commented Oct 31, 2023

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

@magento-automated-testing
Copy link

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.

@engcom-Bravo engcom-Bravo added the Priority: P2 A defect with this priority could have functionality issues which are not to expectations. label Oct 31, 2023
@Morgy93
Copy link
Member Author

Morgy93 commented Nov 1, 2023

@magento run Database Compare,Functional Tests EE,Functional Tests B2B,Integration Tests,Magento Health Index,Sample Data Tests CE,Sample Data Tests EE,Sample Data Tests B2B,Static Tests,Unit Tests,WebAPI Tests,Semantic Version Checker

Copy link

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.

@Morgy93
Copy link
Member Author

Morgy93 commented Nov 1, 2023

@magento run Sample Data Tests CE,Sample Data Tests B2B,Sample Data Tests EE

Copy link

Failed to run the builds. Please try to re-run them later.

@Morgy93
Copy link
Member Author

Morgy93 commented Nov 1, 2023

@magento run Sample Data Tests CE,Sample Data Tests B2B,Sample Data Tests EE

Copy link

Failed to run the builds. Please try to re-run them later.

@Morgy93
Copy link
Member Author

Morgy93 commented Nov 1, 2023

What a great developer experience. 🙄

Will leave it as it is until someone gets in touch.

Copy link
Contributor

@Den4ik Den4ik left a comment

Choose a reason for hiding this comment

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

Hi @Morgy93
Thanks for your contribution.
Please follow backward compatibility documentation for adding new constructor params.

@Morgy93
Copy link
Member Author

Morgy93 commented Nov 3, 2023

Hi @Morgy93 Thanks for your contribution. Please follow backward compatibility documentation for adding new constructor params.

Interesting, that's why I see this approach used everywhere.
I don't like it but can understand it.

@Den4ik Changed the files accordingly. Please review.

Copy link

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.

@@ -32,24 +32,27 @@ class BlockActions extends Column
/**
* @var Escaper
*/
private $escaper;
protected $escaper;
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the reason for changing this? I don't immediately see why this would be needed? I think this can be put back to private, no?

Same remark goes for the other class.

Copy link
Contributor

Choose a reason for hiding this comment

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

@hostep I'm agree with you, but at the same time I don't see any restrictions to use protected access type

Copy link
Member Author

Choose a reason for hiding this comment

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

Purely because the UrlBuilder was protected as well. I thought that is some kind of coding standard.

I'd be happy to change it to private if you agree to this change.

Copy link
Contributor

@hostep hostep Nov 9, 2023

Choose a reason for hiding this comment

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

@Den4ik: Magento encourages composition over inheritance, if we make members protected again, we are pushing people in the direction of using inheritance again.

I would suggest we change it back to private.

Copy link
Contributor

Choose a reason for hiding this comment

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

@hostep It make sense 👍

Copy link
Member Author

Choose a reason for hiding this comment

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

@hostep Great. I updated the files accordingly. Please review.

@Morgy93 Morgy93 force-pushed the replace-deprecated-escaper branch 3 times, most recently from c41a2a3 to 3a1cefa Compare November 9, 2023 17:32
Copy link
Contributor

@Den4ik Den4ik left a comment

Choose a reason for hiding this comment

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

✅ Approved.
@Morgy93 Thanks for contribution, changes looks good for me.

Let's run tests to get things done.
@magento run all tests

@Den4ik
Copy link
Contributor

Den4ik commented Nov 9, 2023

@magento run all tests

Copy link

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.

@Morgy93 Morgy93 force-pushed the replace-deprecated-escaper branch 3 times, most recently from 0b62db7 to 0a0341c Compare November 10, 2023 07:22
@Den4ik
Copy link
Contributor

Den4ik commented Nov 13, 2023

@magento run all tests

Run tests again

Copy link

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.

@Morgy93
Copy link
Member Author

Morgy93 commented Dec 20, 2023

@magento run all tests

Copy link

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.

@Morgy93 Morgy93 force-pushed the replace-deprecated-escaper branch from 0a0341c to 341601a Compare December 20, 2023 10:19
@Morgy93 Morgy93 force-pushed the replace-deprecated-escaper branch from 341601a to e767817 Compare January 18, 2024 12:58
@Morgy93
Copy link
Member Author

Morgy93 commented Jan 18, 2024

@magento run all tests

Copy link

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.

@Morgy93
Copy link
Member Author

Morgy93 commented Jan 18, 2024

Facebook\WebDriver\Exception\NoSuchElementException I don't think that the current errors are related to changes in this PR.

@Den4ik Any idea?

@Den4ik
Copy link
Contributor

Den4ik commented Feb 14, 2024

@magento run all tests

@Den4ik
Copy link
Contributor

Den4ik commented Feb 15, 2024

@magento run WebAPI Tests

@Den4ik
Copy link
Contributor

Den4ik commented Feb 15, 2024

@magento run Functional Tests B2B

@Den4ik
Copy link
Contributor

Den4ik commented Feb 16, 2024

I see that failed tests is not related to PR changes.
@engcom-Bravo can you please proceed this PR

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: review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants