feat(clone): gate category cloning behind CLONE_CATEGORIES_ENABLED - #29
Merged
Conversation
Add an env gate around the taxonomy and taxon duplicators in StoreCloneRunner. When CLONE_CATEGORIES_ENABLED=false the clone skips copying the template store's taxonomies/taxons, so newly cloned shops are born without the inherited category clutter (Categories, Collections, Categories 2) that appears in nav and footer. Defaults to enabled: when the variable is absent the clone behaves exactly as before, so the change is inert until deliberately switched off in an environment. The taxon duplicator is still constructed so its taxons_cache stays an empty hash when gated; the downstream product duplicator reads that cache null-safely, so no product->taxon links are orphaned.
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
willymwai
approved these changes
Jul 7, 2026
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.
What this solves
Every AI-generated shop shows several sets of categories (Categories,
Collections, Categories 2) in the storefront menu and footer. It reads as
broken and clutters the shop.
"Categories" in Spree are taxonomies/taxons. A new Spree store seeds no
taxonomies of its own (the built-in seeder is deprecated and unwired), so
the only source of a shop's categories is the clone: StoreCloneRunner's
TaxonomiesDuplicator copies every taxonomy from the template store
verbatim.
Taxonomy/taxon cloning ran unconditionally in StoreCloneRunner, with no
way to turn it off short of editing the template store (which we don't
want to require).
Solution
Gate the taxonomy and taxon duplicators behind a new
CLONE_CATEGORIES_ENABLEDenvironment variable, mirroring the existingPRODUCTS_CLONE_LIMITpattern. It defaults to enabled, so behavior isunchanged until an environment sets
CLONE_CATEGORIES_ENABLED=false,which makes newly cloned shops skip the inherited category trees.
The clone runs inside CloneStoreJob (Sidekiq), so the variable is read in
the worker environment. Product ->taxon links cannot be orphaned: the taxon
cache is left empty when gated and the product duplicator reads it
null-safely (and in production PRODUCTS_CLONE_LIMIT=0 means no products
clone anyway).