Skip to content

Fixed use inconsistently viewModels in codebase #31503

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

Closed

Conversation

mrtuvn
Copy link
Contributor

@mrtuvn mrtuvn commented Jan 4, 2021

Description (*)

Replace viewModel by view_model in codebase! Somewhere in code developers use both approach view_model and viewModel. This can lead to inconsistent and make more noise for dev experience
Just refactor a little code

For make consistently in code we should refactor both in code base and devdocs! To guide developers/3rd-party extensions providers following standards and reduce confusing. We already have PR for devdocs in here

magento/devdocs#8459

This PR refactor inconsistenly parts from codebase

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes magento/magento2#<issue_number>

No issue available

Manual testing scenarios (*)

  1. ...
  2. ...

Questions or comments

CC @dmytro-ch pr update related docs update

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)

Resolved issues:

  1. resolves [Issue] Fixed use inconsistently viewModels in codebase #31525: Fixed use inconsistently viewModels in codebase

@m2-assistant
Copy link

m2-assistant bot commented Jan 4, 2021

Hi @mrtuvn. 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

❗ 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

You can find more information about the builds here

ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review.

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

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

🕙 You can find the schedule on the Magento Community Calendar page.

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

🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

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

@dmytro-ch
Copy link
Contributor

Related PR in DevDocs: magento/devdocs#8459

@sidolov sidolov added Priority: P3 May be fixed according to the position in the backlog. Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. labels Jan 4, 2021
@sidolov
Copy link
Contributor

sidolov commented Jan 4, 2021

@magento create issue

@hostep
Copy link
Contributor

hostep commented Jan 5, 2021

This is a backwards-incompatible change in my opinion. If you use the breadcrumbs.phtml template provided by Magento in your own xml layout for a new custom block, it will crash after the change of this PR is applied because you'd first need to update your own xml as well with this new name.

Consistency is good, but these are just names, in my opinion the first one should even be called breadcrumbs_view_model and not view_model which is too generic, I think we should leave these as-is and close the PR.

@nathanjosiah: have you guys already decided BiC rules around these sort of changes?

@nathanjosiah
Copy link
Contributor

Yes this is now considered BiC under our new policy. Unfortunately this hasn't been documented yet and has historically been a grey area. We have very large policy changes coming that would even further block this kind of change but at least for now this definitely wouldn't be allowed.

ℹ️ For internal reference this was decided in the dev guild in https://github.com/magento-commerce/development-guild/issues/23 we also have a related issue here https://github.com/magento-commerce/development-guild/issues/80

@mrtuvn mrtuvn closed this Jan 6, 2021
@m2-assistant
Copy link

m2-assistant bot commented Jan 6, 2021

Hi @mrtuvn, 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.

@mrtuvn mrtuvn deleted the fixed-inconsistent-use-viewModels branch January 6, 2021 11:59
@mrtuvn mrtuvn restored the fixed-inconsistent-use-viewModels branch January 8, 2021 08:06
@mrtuvn mrtuvn reopened this Jan 8, 2021
@m2-assistant
Copy link

m2-assistant bot commented Jan 8, 2021

Hi @mrtuvn. 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

❗ 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

ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review.

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

@mrtuvn mrtuvn changed the base branch from 2.4-develop to 2.5-develop January 8, 2021 08:24
@mrtuvn
Copy link
Contributor Author

mrtuvn commented Jan 8, 2021

re-target to 2.5-develop

@mrtuvn mrtuvn force-pushed the fixed-inconsistent-use-viewModels branch 2 times, most recently from d36ac81 to a5d420f Compare January 8, 2021 09:54
@mrtuvn
Copy link
Contributor Author

mrtuvn commented Jan 8, 2021

@magento run all tests

@mrtuvn
Copy link
Contributor Author

mrtuvn commented Jan 9, 2021

@magento run Functional Tests CE

1 similar comment
@ihor-sviziev
Copy link
Contributor

@magento run Functional Tests CE

Copy link
Contributor

@ihor-sviziev ihor-sviziev left a comment

Choose a reason for hiding this comment

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

Hi,
Can we add the same argument with 2 keys - as viewModel and as view_model for backward compatibility reasons? I think in such a case, it could be targeted even to 2.4-develop.

update code for backward compatible
@mrtuvn mrtuvn force-pushed the fixed-inconsistent-use-viewModels branch from a5d420f to 05233d5 Compare January 27, 2021 14:56
@mrtuvn mrtuvn changed the base branch from 2.5-develop to 2.4-develop January 27, 2021 14:57
@ihor-sviziev
Copy link
Contributor

@magento run all tests

@ihor-sviziev
Copy link
Contributor

@magento run Functional Tests B2B, Functional Tests EE

@mrtuvn
Copy link
Contributor Author

mrtuvn commented Jan 28, 2021

@magento run Functional Tests B2B

@ihor-sviziev
Copy link
Contributor

@magento run Functional Tests B2B

Copy link
Contributor

@dmytro-ch dmytro-ch left a comment

Choose a reason for hiding this comment

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

The functional test failures are not related to the changes introduced by this PR.

@ihor-sviziev
Copy link
Contributor

@magento run Functional Tests B2B

2 similar comments
@mrtuvn
Copy link
Contributor Author

mrtuvn commented Jan 30, 2021

@magento run Functional Tests B2B

@mrtuvn
Copy link
Contributor Author

mrtuvn commented Feb 1, 2021

@magento run Functional Tests B2B

@magento-engcom-team
Copy link
Contributor

Hi @dmytro-ch, thank you for the review.
ENGCOM-8712 has been created to process this Pull Request

@ihor-sviziev ihor-sviziev mentioned this pull request Mar 30, 2021
16 tasks
@mrtuvn mrtuvn marked this pull request as draft March 20, 2023 14:24
@engcom-Bravo
Copy link
Contributor

Hi @mrtuvn,

We are closing this PR.The PR is in Draft since longtime.

Once you are ready Please feel free to reopen it to process the PR further.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Frontend Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests Component: Catalog Component: Sales Component: View improvement Priority: P3 May be fixed according to the position in the backlog. Release Line: 2.4 Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Issue] Fixed use inconsistently viewModels in codebase
8 participants