Ensure complete mappings are generated from old taxonomy versions to l… - #887
Open
katbailey wants to merge 2 commits into
Open
Ensure complete mappings are generated from old taxonomy versions to l…#887katbailey wants to merge 2 commits into
katbailey wants to merge 2 commits into
Conversation
katbailey
force-pushed
the
generate-full-mappings
branch
from
March 16, 2026 15:15
c2ab92d to
33c8ec2
Compare
katbailey
marked this pull request as ready for review
March 16, 2026 15:19
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
When generating dist mapping files (e.g.,
shopify_2025-09_to_shopify_2026-02.json), the chain resolution only resolves the outputs of existing rules forward through newer versions. It does not propagate rules from intermediate versions backward to older versions.This means if a category ID existed in an older version but was only remapped in a later version, the older version's mapping file would have no entry for it — even though that ID is now invalid in the latest version. The mapping files claim to map old version → latest but are incomplete.
Approach
Modified
resolve_to_shopify_mappingsinIntegrationVersionto propagate rules backward after resolving existing rules. Sinceresolve_to_shopify_mappings_chainprocesses newest-to-oldest, by the time we process an older version, all newer versions' rules already have their outputs resolved to the latest taxonomyCategoryobjects.After the existing resolution loop, we now iterate through all newer versions'
to_shopify_mappingsand for each rule:full_names_by_idMappingRulemapping from the older version's category entry to the newer rule's already-resolved outputExisting rules always take precedence — propagation only fills gaps.
Test plan
full_names_by_idfull_names_by_idload_all_from_sourcechain test to verify propagated rule countaa-2to 2020-01 fixture'sfull_names.ymlto cover the propagation scenariogenerate_distand verify mapping file completeness