Repository navigation
[Data Importer] Add optional path to the Attribute loading strategy - #717
Merged
Merged
Conversation
Limits the attribute lookup and the cleanup identifier list to a folder and its sub folders, so equal values in other parts of the tree are ignored. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Fall back to a list query when the class has its own static getter, add tests for the list route and getter fallback, reuse one path condition for lookup and cleanup, and document that new objects must land in the path. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…tant Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What
Adds an optional
pathsetting to the Attribute loading strategy. When set, the lookup by attribute (and the identifier list used by the cleanup) only considers objects in that folder and its sub folders. Studio gets a "Limit to path" field in the Attribute settings; docs and all Studio translations are updated.Why
The strategy searched the whole tree and took the first match, so equal attribute values in different parts of the tree (for example the same SKU for two vendors) could lead to updating or cleaning up the wrong object. Without a path the behaviour is unchanged, existing configurations stay valid. Element Creation should place new objects inside the path (documented), otherwise they are not found again.
Fixes #284
Verification
AttributeStrategyPathTest(11 tests: plain, localized andkeylookup, empty identifier, a class with its own static getter, sub folders, sibling folder with the same prefix, LIKE wildcards in the path, cleanup identifier list): 7 of the first 9 fail on base 3d43f44, all 11 pass on 9601957.Not verified