Automatically resolve to_shopify
mapping chain from oldest to current version
#517
+541
−113
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.
TL;DR
Changes how integration mappings are defined from older Shopify taxonomy versions.
Before:
data
, old Shopify integration versions were defined relative to the current/latest version (ex. 2022-01 is defined relative to 2025-01-unstable)to_shopify
mapping, we needed to also add it individually to each older version.dist
, old Shopify integration versions were generated relative to the current versionAfter:
data
, old Shopify integration versions are defined relative to the immediately next version (ex. 2022-01 is defined relative to 2024-07)dist
, old Shopify integration versions are generated relative to the current versionHow it works
Category
objects using the current taxonomy. Instead, the raw category ID is stored.Category
objects, taking into account any mappings that appear in newer versions.Breakdown of changes
The PR is big, but most of the changes are test fixtures. The actual implementation changes are mostly in:
IntegrationVersion#load_all_from_source
IntegrationVersion#resolve_to_shopify_mappings
The other notable change is extracting out one of the tests from
IntegrationVersionTest
into a dedicated integration test (GenerateMappingsDistTest
). Instead of heavily relying on mocking like the old test, the new dedicated test compares generated file contents against fixtures. This approach is more straightforward and easier to maintain.