magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

magento/magento2#37796: Fixed issue with adding new country regions

Open Yaroslav1301 opened this issue 1 year ago • 49 comments

Fixed issue when the configuration 'general/region/state_required' gets reset to the default countries with a required states.

Description (*)

According to #37796 in \Magento\Directory\Setup\DataInstaller::class weren't declared proper logic of saving configuration 'general/region/state_required'. That could lead to problems for the web-site if you changed that configuration from the admin panel previously and then decided to add some new regions for some specific country. Based on that I've fixed the bug with the help of getting current configuration value before any DB updates, then I'm merging it with new data that should be added and finally updating the configuration with proper value.

Fixed Issues (if relevant)

  1. Fixes magento/magento2#37796

Manual testing scenarios (*)

  1. Go to the admin panel and open Stores > Settings > Configuration > General > General > State Options
  2. Unselect US from "State is Required for" and save configuration. image 3.Then go to the project root and check with CLI command config value and make sure that US is not in there. image 4.Then use this custom module to add Japan with regions to state_required config. RequiredVendor.zip 5.In case if my fix is applied you would get a proper result for config - including JP but still excluding US.

Contribution checklist (*)

  • [x] Pull request has a meaningful description of its purpose
  • [x] All commits are accompanied by meaningful commit messages
  • [x] All new or changed code is covered with unit/integration tests (if applicable)
  • [x] 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)

Yaroslav1301 avatar Oct 13 '23 13:10 Yaroslav1301

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

: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 Code Contributions documentation. Join Magento Community Engineering Slack and ask your questions in #github channel.

m2-assistant[bot] avatar Oct 13 '23 13:10 m2-assistant[bot]

@magento run all tests

Yaroslav1301 avatar Oct 13 '23 13:10 Yaroslav1301

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.

@magento run all tests

Yaroslav1301 avatar Oct 14 '23 08:10 Yaroslav1301

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.

@magento run all tests

shikhamis11 avatar Oct 15 '23 03:10 shikhamis11

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.

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

engcom-Hotel avatar Oct 19 '23 09:10 engcom-Hotel

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.

@magento run all tests

Yaroslav1301 avatar Oct 23 '23 16:10 Yaroslav1301

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.

Hello @Yaroslav1301,

Thanks for the contribution!

Please check the static test failure.

Other, B2B and CE failures are different in 2 consecutive runs so they might be flaky.

Thanks

Hello @engcom-Hotel I've made an update for static tests.

Yaroslav1301 avatar Oct 23 '23 16:10 Yaroslav1301

@magento run all tests

engcom-Hotel avatar Oct 25 '23 06:10 engcom-Hotel

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.

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

engcom-Hotel avatar Oct 25 '23 10:10 engcom-Hotel

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.

@magento run Functional Tests EE

engcom-Hotel avatar Oct 25 '23 11:10 engcom-Hotel

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.

@magento run Functional Tests B2B, Functional Tests CE

engcom-Hotel avatar Oct 25 '23 13:10 engcom-Hotel

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.

@magento run all tests

engcom-Delta avatar Oct 26 '23 14:10 engcom-Delta

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.

@magento run Functional Tests B2B

engcom-Echo avatar Nov 08 '23 15:11 engcom-Echo

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.

:heavy_check_mark: QA Passed

Preconditions:

  • Install fresh Magento 2.4-develop

Manual testing scenario:

  1. We have follow steps from comment

Before: :heavy_multiplication_x:  Screenshot 2023-11-09 at 12 47 41 PM

After: :heavy_check_mark:   Screenshot 2023-11-09 at 1 06 25 PM

Hence moving it to Merge In Progress

engcom-Echo avatar Nov 09 '23 07:11 engcom-Echo

@magento run Integration Tests

engcom-Charlie avatar Dec 05 '23 02:12 engcom-Charlie

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.

@magento run Functional Tests EE

Indraniks avatar Dec 07 '23 06:12 Indraniks

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.

@magento run all tests

engcom-Echo avatar Dec 07 '23 10:12 engcom-Echo