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

Cleanup, refactor and cover with tests section-config module #25764

Merged

Conversation

krzksz
Copy link
Contributor

@krzksz krzksz commented Nov 26, 2019

Description (*)

I decided to create this PR as a follow up to my previous attempt at fixing errors that were caused by 3rd party modules doing POST requests or requesting customer data directly before the module was initialized by data-mage-init.

I also added unit tests for all the public methods and to make sure no errors are thrown if some code incorrectly calls the module before is has a chance to initialize.

Fixed Issues (if relevant)

  1. x-magento-init initialisation not bound to happen in the right order. #17125: x-magento-init initialisation not bound to happen in the right order.

Manual testing scenarios (*)

  1. Reload the shop.
  2. Trigger customer data or sections data module at the very beginning for example by running the following code:
require(['Magento_Customer/js/section-config'], function(sectionsConfig) {
    console.log(sectionsConfig.getAffectedSections('test'));
});
  1. TypeError: sections is undefined is being thrown without this changes.

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)
  • All automated tests passed successfully (all builds are green)

@krzksz krzksz requested a review from DrewML as a code owner November 26, 2019 18:54
@m2-assistant
Copy link

m2-assistant bot commented Nov 26, 2019

Hi @krzksz. 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.3-develop instance - deploy vanilla Magento instance

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

@ihor-sviziev
Copy link
Contributor

Hi @krzksz,
Please check functional tests failures, looks like your changes break some functionality.

@krzksz
Copy link
Contributor Author

krzksz commented Nov 28, 2019

@magento give me 2.3-develop instance

@magento-engcom-team
Copy link
Contributor

Hi @krzksz. Thank you for your request. I'm working on Magento 2.3-develop instance for you

@magento-engcom-team
Copy link
Contributor

Hi @krzksz, here is your Magento instance.
Admin access: https://i-25764-2-3-develop.instances.magento-community.engineering/admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

@krzksz krzksz force-pushed the refactor-section-config branch from c95b8b3 to 3459150 Compare December 1, 2019 11:23
@krzksz krzksz requested a review from ihor-sviziev December 1, 2019 18:03
@sidolov sidolov changed the base branch from 2.3-develop to 2.4-develop December 5, 2019 17:12
@krzksz
Copy link
Contributor Author

krzksz commented Jan 17, 2020

@magento run all tests

@krzksz krzksz requested a review from ptylek January 22, 2020 12:48
@ghost ghost assigned ptylek Jan 23, 2020
@magento-engcom-team
Copy link
Contributor

Hi @ptylek, thank you for the review.
ENGCOM-6666 has been created to process this Pull Request
✳️ @ptylek, could you please add one of the following labels to the Pull Request?

Label Description
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests
Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests
Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests

@engcom-Alfa engcom-Alfa self-assigned this Jan 23, 2020
@engcom-Alfa engcom-Alfa added the Auto-Tests: Covered All changes in Pull Request is covered by auto-tests label Jan 23, 2020
Copy link
Contributor

@omiroshnichenko omiroshnichenko left a comment

Choose a reason for hiding this comment

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

1 tiny comment, but everything else looks good. Thank you for cleanup and especially for covering it with the unit test.

@krzksz krzksz force-pushed the refactor-section-config branch from 3459150 to 5be754b Compare January 31, 2020 11:01
@magento-engcom-team
Copy link
Contributor

Hi @VladimirZaets, thank you for the review.
ENGCOM-6666 has been created to process this Pull Request

@engcom-Alfa
Copy link
Contributor

✔️ QA Passed

@engcom-Kilo
Copy link
Contributor

Functional tests CE - not successful on remote test server,
but not depends by changes in Pull Request.
Remote Test server - with some fails with Create test data.

@m2-assistant
Copy link

m2-assistant bot commented Feb 8, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants