Filter Shopify-proprietary metafields from schema dumps#27
Merged
Conversation
Shopify-managed metafields (namespace 'shopify' or 'shopify--*') are now excluded from schema dumps as they are system-managed and should not be recreated from migrations. Also allow selecting shop via SHOPIFY_DOMAIN env var in CLI commands. Co-Authored-By: GitHub Copilot <noreply@github.com>
elia
force-pushed
the
filter-shopify-proprietary-metafields
branch
from
February 10, 2026 12:01
83752eb to
b4b6553
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates ShopifyToolkit’s schema dumping and CLI behavior to avoid treating Shopify-managed metafields as portable schema/migration artifacts, while also allowing CLI commands to target a specific shop via SHOPIFY_DOMAIN.
Changes:
- Filter metafield definitions from schema dumps when the namespace is
shopifyor starts withshopify--. - Add spec coverage to ensure Shopify-proprietary metafields are excluded from dumped schema output.
- Update CLI commands to use a selected shop (optionally via
SHOPIFY_DOMAIN) instead of alwaysShop.sole.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
spec/shopify_toolkit/schema_spec.rb |
Adds a test context verifying Shopify-proprietary namespaces are excluded from schema dumps. |
lib/shopify_toolkit/schema.rb |
Introduces shopify_proprietary? filtering in generate_schema_content prior to sorting/dumping metafields. |
lib/shopify_toolkit/command_line.rb |
Routes migrate/rollback/redo/schema load/dump through a shop selector supporting SHOPIFY_DOMAIN. |
.gitignore |
Ignores .tool-versions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Replaces find_by with find_by! to raise ActiveRecord::RecordNotFound immediately - Uses .presence to treat blank SHOPIFY_DOMAIN env var as unset - Prevents NoMethodError on nil shop and improves CLI error diagnostics
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.
Fixes the issue where Shopify-managed metafields were being included in schema dumps.
Changes
shopifyorshopify--*namespaces from schema dumpsSHOPIFY_DOMAINenv var in CLI commandsExamples of filtered metafields
Co-Authored-By: GitHub Copilot noreply@github.com