Skip to content

[Forwardport] Correctly convert config integration api resources #18273

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

Merged
merged 5 commits into from
Oct 3, 2018
Merged

[Forwardport] Correctly convert config integration api resources #18273

merged 5 commits into from
Oct 3, 2018

Conversation

mage2pratik
Copy link
Contributor

Original Pull Request

#14065

Description

Correctly return config based integration api resources. Currently it does not append "root api resource" (Magento_Backend::admin) which causes the integrations to be reset all the time even when there are no data changes when the Magento\Integration\Setup\Recurring is run (setup:upgrade) because Magento\Authorization\Model\Acl\AclRetriever::getAllowedResourcesByUser returns resource tree including "root api resource" (Magento_Backend::admin) and when they are compared they do not match.

Detailed explanation:

  1. https://github.com/magento/magento2/blob/2.2-develop/app/code/Magento/Integration/Model/ConfigBasedIntegrationManager.php#L128 (Get existing integration)
  2. https://github.com/magento/magento2/blob/2.2-develop/app/code/Magento/Integration/Model/Plugin/Integration.php#L109 (Append integration api resources)
  3. https://github.com/magento/magento2/blob/2.2-develop/app/code/Magento/Integration/Model/Plugin/Integration.php#L123 (Append config based integration api resources)
  4. https://github.com/magento/magento2/blob/2.2-develop/app/code/Magento/Integration/Model/ConsolidatedConfig.php#L68 (Read config based integrations)
  5. https://github.com/magento/magento2/blob/2.2-develop/app/code/Magento/Integration/Model/Config/Consolidated/Reader.php#L36 (Converter used to convert api resources from `etc/integration.xml)
  6. https://github.com/magento/magento2/blob/2.2-develop/app/code/Magento/Integration/Model/Config/Consolidated/Converter.php#L41 (Converts config integrations api resources without "root api resource" (Magento_Backend::admin)
  7. https://github.com/magento/magento2/blob/2.2-develop/app/code/Magento/Integration/Model/ConfigBasedIntegrationManager.php#L130 (Returns resource tree including "root api resource" (Magento_Backend::admin)
  8. https://github.com/magento/magento2/blob/2.2-develop/app/code/Magento/Integration/Model/ConfigBasedIntegrationManager.php#L171 (Condition is true due one resource tree having "root api resource" (Magento_Backend::admin) and the other not)

Fixed Issues (if relevant)

  1. Update 2.2.1: One or more integrations have been reset because of a change to their xml configs. #12095: Update 2.2.1: One or more integrations have been reset because of a change to their xml configs

Manual testing scenarios

  1. Create config based integration etc/integration.xml with "Magento_Catalog::catalog" resource and without "endpoint_url", "identity_link_url"
  2. run setup:upgrade so the integration is created
  3. activate integration in admin area under "System -> Integrations"
  4. run setup:upgrade again - the integration should stay as "Authorized" but it is "Reset" due the issue described above

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 on Travis CI are green)

@magento-engcom-team
Copy link
Contributor

Hi @mage2pratik. 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-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me $VERSION instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

@magento-engcom-team
Copy link
Contributor

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

@magento-engcom-team
Copy link
Contributor

Hi @mage2pratik. Thank you for your contribution.
We will aim to release these changes as part of 2.3.1.
Please check the release notes for final confirmation.

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.

4 participants