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

Indexation improvement #141

Merged
merged 16 commits into from
Nov 20, 2017
Merged

Indexation improvement #141

merged 16 commits into from
Nov 20, 2017

Conversation

vgoncharenko
Copy link
Contributor

@vgoncharenko vgoncharenko commented Oct 23, 2017

Create Plugins to invalidate StockItem indexes when Stock-to-Source assignments have been changed

Description

Create Plugins to invalidate StockItem indexes when Stock-to-Source assignments have been changed

Fixed Issues (if relevant)

  1. Create Plugins to invalidate StockItem indexes when Stock-to-Source assignments have been changed #68: Create Plugins to invalidate StockItem indexes when Stock-to-Source assignments have been changed

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)

…MSI-invalidate-stockItem-indexes

# Conflicts:
#	app/code/Magento/Inventory/Indexer/StockItem/Mview/Action.php
#	app/code/Magento/Inventory/Indexer/StockItem/StockItem.php
#	app/code/Magento/Inventory/etc/di.xml
#	app/code/Magento/Inventory/etc/mview.xml
…MSI-invalidate-stockItem-indexes

# Conflicts:
#	app/code/Magento/Inventory/Indexer/StockItem/Mview/Action.php
#	app/code/Magento/Inventory/Indexer/StockItem/StockItem.php
#	app/code/Magento/Inventory/etc/di.xml
#	app/code/Magento/Inventory/etc/mview.xml
…rce assignments have been changed

- add integration test for 3 indexers
- change logic during testing
- disable trigger for stock_item MVIEW by default
@vgoncharenko vgoncharenko changed the title Msi invalidate stock item indexes v2 Create Plugins to invalidate StockItem indexes when Stock-to-Source assignments have been changed Oct 23, 2017
Copy link
Member

@larsroettig larsroettig left a comment

Choose a reason for hiding this comment

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

Looks good pls add only the static typing

@@ -0,0 +1,100 @@
<?php
Copy link
Member

Choose a reason for hiding this comment

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

Please add static PHP static typing to all files
declare(strict_types=1);

…rce assignments have been changed

- add ability to hiding indexers
@naydav naydav changed the title Create Plugins to invalidate StockItem indexes when Stock-to-Source assignments have been changed Indexation improvement Nov 10, 2017
…MSI-invalidate-stockItem-indexes-v2

# Conflicts:
#	app/code/Magento/Inventory/Test/Integration/Indexer/IndexationTest.php
…rce assignments have been changed

- revert ability to hiding indexers
@naydav naydav self-assigned this Nov 20, 2017
Valeriy Nayda added 2 commits November 20, 2017 18:28
-- builds fixing
-- builds fixing
* @param array $conditions
* @return \ArrayIterator|\Magento\Framework\DB\Select
*/
private function prepareSelect($stockId, array $conditions = [])
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add type hints to the method declaration

@@ -76,12 +113,14 @@ public function getData(int $stockId, array $skuList = []): \ArrayIterator
->where('stock_source_link.' . StockSourceLink::STOCK_ID . ' = ?', $stockId)
->where('stock_source_link.' . StockSourceLink::SOURCE_ID . ' IN (?)', $sourceIds);

if (count($skuList) !== 0) {
$select->where('source_item.' . SourceItemInterface::SKU . ' IN (?)', $skuList);
if (!empty($conditions)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

!empty seems to be redundant here

*
* @param int $stockId
* @param array $conditions
* @return \ArrayIterator|\Magento\Framework\DB\Select
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be much more "defensive" to return just one of the types

magento-devops-reposync-svc pushed a commit that referenced this pull request Sep 1, 2021
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