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

FIX #25856 / Group Ordered Products report by SKU #25858

Conversation

lbajsarowicz
Copy link
Contributor

Description (*)

PR fixes the issue with multiple variations of the same product being reported as a single product.

Fixed Issues (if relevant)

  1. Ordered Products Report not grouping by configurable products variations #25856: Ordered Products Report not grouping by configurable products variations

Manual testing scenarios (*)

  1. Perform several orders for different variations of configurable product
  2. Generate products sales report
  3. Expect each variation to be counted separately.

Questions or comments

The additional index was added to reduce the overhead.

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)

@m2-assistant
Copy link

m2-assistant bot commented Nov 30, 2019

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

@buskamuza
Copy link
Contributor

The change makes sense for me. Though I'd add it to 2.4, not to 2.3 because:

  1. it changes the behavior of reports
  2. it might cause big impact on merchants with huge number of orders during upgrade (due to the new index added to the order items table). This should be validated before releasing to understand the impact.

@@ -596,6 +596,9 @@
<index referenceId="SALES_ORDER_ITEM_ORDER_ID" indexType="btree">
<column name="order_id"/>
</index>
<index referenceId="SALES_ORDER_ITEM_SKU" indexType="btree">
Copy link
Contributor

Choose a reason for hiding this comment

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

@lbajsarowicz could you provide MySQL EXPLAIN for queries which use this table before and after adding the index for SKU column?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Before changes:
image

After changes:
image

Adding index:
image

That is surprising for me, because actually - the change of column does not change anything. The index is also not necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As a result - it's fine to remove the index.

@sidolov sidolov changed the base branch from 2.3-develop to 2.4-develop December 5, 2019 17:09
@lbajsarowicz lbajsarowicz force-pushed the bugfix/25856-configurable-products-grouping branch from cb2ea46 to 840cec9 Compare December 17, 2019 15:48
@lbajsarowicz
Copy link
Contributor Author

Squashed changes, removed index. Final solution does not need any architectural changes.

@lbajsarowicz lbajsarowicz changed the title FIX #25856 / Group Ordered Products report by SKU. Add index to reduce the overhead. FIX #25856 / Group Ordered Products report by SKU Dec 17, 2019
@lbajsarowicz
Copy link
Contributor Author

@buskamuza @joni-jones Can I have your attention?

Copy link
Contributor

@aleron75 aleron75 left a comment

Choose a reason for hiding this comment

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

Go for me

@engcom-Delta
Copy link
Contributor

✔️ QA passed
Tested with latest commit 5fb9d49ac15f785ccede9a7df5bc01161f3ee5f5

@engcom-Foxtrot engcom-Foxtrot self-assigned this Jan 20, 2020
@engcom-Foxtrot engcom-Foxtrot added the Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests label Jan 20, 2020
@engcom-Echo engcom-Echo added the Auto-Tests: Covered All changes in Pull Request is covered by auto-tests label Feb 3, 2020
@engcom-Echo engcom-Echo requested a review from aleron75 February 3, 2020 12:27
@lbajsarowicz
Copy link
Contributor Author

In my personal opinion - it's really nice that @engcom-Echo wanted to cover change with tests, but it's just the block of concrete to the implementation: Tests provided does not test outcome, but only implementation and this is not bringing any value, except blocking further changes without changing also Unit Test.

@lbajsarowicz
Copy link
Contributor Author

@engcom-Echo Thanks for tests - these look really great!

@magento-engcom-team
Copy link
Contributor

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

@aleron75
Copy link
Contributor

Hello @engcom-Echo I approved the changes but a test still fails, can you please check it out? Thank you!

@engcom-Echo
Copy link
Contributor

engcom-Echo commented Feb 20, 2020

Hi @aleron75. Thank you for your comment. I try to do it.

@engcom-Echo engcom-Echo requested a review from aleron75 February 20, 2020 10:05
@magento-engcom-team
Copy link
Contributor

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

@engcom-Delta
Copy link
Contributor

✔️ QA passed

@m2-assistant
Copy link

m2-assistant bot commented Feb 22, 2020

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

@sdzhepa sdzhepa mentioned this pull request May 9, 2022
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.

10 participants