-
Notifications
You must be signed in to change notification settings - Fork 13
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
IBX-7149: Refactored content type-based indexing to rely on a dedicated strategy #296
Conversation
21bfd4d
to
cbbd512
Compare
Quality Gate passedKudos, no new issues were introduced! 0 New issues |
cbbd512
to
3418542
Compare
src/bundle/Core/Command/Indexer/ContentIdList/ContentTypeInputGeneratorStrategy.php
Outdated
Show resolved
Hide resolved
src/bundle/Core/Command/Indexer/ContentIdList/ContentTypeInputGeneratorStrategy.php
Outdated
Show resolved
Hide resolved
src/bundle/Core/Command/Indexer/ContentIdListGeneratorStrategyInterface.php
Outdated
Show resolved
Hide resolved
Quality Gate passedIssues Measures |
Update: Introducing To achieve uniform handling of iterable arrays, Generators, and Traversable objects, the |
static function (SearchHit $searchHit): Content { | ||
self::assertInstanceOf(Content::class, $searchHit->valueObject); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally, I'd leave the mapping function as is, and use self::assertContainsOnlyInstancesOf()
to prevent test framework from increasing it's assertion count. But that is only a detail 😅
Co-authored-by: Paweł Niedzielski <pawel.niedzielski@ibexa.co>
Co-Authored-By: Paweł Niedzielski <Steveb-p@users.noreply.github.com>
13fbe41
to
4419bbf
Compare
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QA approved on IbexaDXP 4.5 exp.
v4.5
+Maintainer update:
Given how complex and error-prone content id batch generating logic is, the fix includes the first portion of refactoring, introducing internal, command-dedicated
\Ibexa\Bundle\Core\Command\Indexer\ContentIdListGeneratorStrategyInterface
which produces\Ibexa\Core\Search\Indexer\ContentIdBatchList
result wrapper object containing iterable batches of content Ids (meaning content id list chunks/slices) and total count of content ids.This is the first in a series of refactoring steps, making the command more stable, as reindexing is mission-critical part of content delivery system. The refactoring allows for better test coverage of crucial parts of the logic, aiming towards more single-responsibility-oriented approach.
QA
Sanity check of
ibexa:reindex
command for various argument lists of the command, including different iteration count (meaning really different batch sizes) on an instance with test fixtures data.There are foremost 2 edge cases:
--content-type=folder
option? - see that before the fix they weren't)--subtree
, but should be tested against--content-type
as well)Checklist:
$ composer fix-cs
).@ibexa/engineering
).