Skip to content

[Data Importer] Add optional path to the Attribute loading strategy - #717

Merged
fashxp merged 6 commits into
2026.xfrom
improvement/284-attribute-strategy-path
Oct 21, 2026
Merged

fashxp merged 6 commits into
2026.xfrom
improvement/284-attribute-strategy-path

Conversation

@fashxp

@fashxp fashxp commented Oct 21, 2026

Copy link
Copy Markdown
Member

What

Adds an optional path setting 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

  • Unit/regression: AttributeStrategyPathTest (11 tests: plain, localized and key lookup, 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.
  • Static: php-cs-fixer clean on the changed PHP, eslint and tsc clean on the Studio code; PHPStan (level 5) reports nothing on the loader (the two findings on the strategy only appear because PHPStan loads the base loader from vendor).
  • E2E (Studio edit -> save -> reload): on dev-2026.x the Resolver form has no field on base; with this change the path is set, saved and still there after reload, and an import updates only the object inside the path (on base the same configuration updated the object in the other folder).

Not verified

  • Object brick attributes with a path (same query route as the tested empty-identifier case, not exercised with a real brick); the "Load Data Object" operator and the parent finder share the loader but do not pass a path.
  • Other languages' translations are hand-written, not reviewed by a native speaker.

fashxp and others added 2 commits October 21, 2026 08:50
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>
fashxp and others added 4 commits October 21, 2026 09:40
…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>
@sonarqubecloud

Copy link
Copy Markdown

@fashxp
fashxp marked this pull request as ready for review October 21, 2026 15:19
Copilot AI balanced review requested due to automatic review settings October 21, 2026 15:19
@fashxp fashxp self-assigned this Oct 21, 2026
@fashxp fashxp added this to the 2026.4.0 milestone Oct 21, 2026
@fashxp
fashxp merged commit 89ca0c2 into 2026.x Oct 21, 2026
32 of 33 checks passed
@fashxp
fashxp deleted the improvement/284-attribute-strategy-path branch October 21, 2026 15:19
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Improvement]: Combine the attribute for the import loading strategy with a defined object tree path

1 participant