-
Notifications
You must be signed in to change notification settings - Fork 224
Fix: Respect .gitignore when discovering web and extension configurations #6627
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
|
i signed CLA, but system doesn't recognize |
|
This PR seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action. |
|
Ping |
graygilmore
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Can you:
- Rebase your changes to fix merge conflicts and ensure you're basing this off of the latest code
- Remove some of the package.json changes and other manual version bump changes (this happens automatically in our CI when we release a new version of the package)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds .gitignore filtering to the discovery process for web and extension configurations, resolving an issue where shopify app deploy and shopify app dev commands fail when multiple configuration files exist in gitignored directories (e.g., git worktrees, build artifacts).
Key changes:
- Added a
filterIgnoredPathshelper function that reads and applies .gitignore patterns - Updated web configuration discovery to filter out gitignored paths
- Updated extension configuration discovery to filter out gitignored paths
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/app/src/cli/models/app/loader.ts | Implements gitignore filtering by adding the filterIgnoredPaths function and integrating it into both loadWebs and createExtensionInstances methods to exclude gitignored directories from discovery |
| packages/app/src/cli/models/app/loader.test.ts | Adds comprehensive test coverage for the new gitignore filtering functionality, including tests for web blocks and extensions in gitignored directories, plus backward compatibility tests when no .gitignore exists |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| test('ignores web blocks in gitignored directories', async () => { | ||
| // Given | ||
| const {webDirectory} = await writeConfig(appConfiguration) |
Copilot
AI
Jan 5, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused variable webDirectory.
| const {webDirectory} = await writeConfig(appConfiguration) | |
| await writeConfig(appConfiguration) |
|
|
||
| test('loads all web blocks when no .gitignore file exists', async () => { | ||
| // Given | ||
| const {webDirectory} = await writeConfig(appConfiguration) |
Copilot
AI
Jan 5, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused variable webDirectory.
| const {webDirectory} = await writeConfig(appConfiguration) | |
| await writeConfig(appConfiguration) |
graygilmore
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking better! Just need a changelog entry and this should be good to go. I'll run the CI in another PR.
|
Would you mind also cleaning up the commits so that we don't have both |
Fix: Respect .gitignore when discovering web and extension configurations
Resolves #6518
Problem
The
shopify app deployandshopify app devcommands fail when there are multipleshopify.web.tomlfiles in gitignored directories (e.g., git worktrees, build artifacts, tmp directories). The CLI currently searches through ALL subdirectories and only excludesnode_modules.Solution
Changes Made
Modified
packages/app/src/cli/models/app/loader.ts:filterIgnoredPathshelper function - Reads.gitignoreif it exists and filters paths using theignorepackageloadWebsfunction - Applies gitignore filtering before loading web configscreateExtensionInstancesfunction - Applies gitignore filtering before loading extensionsAdded tests in
packages/app/src/cli/models/app/loader.test.ts:Test Results
✅ Lint passes (0 errors, 38 pre-existing warnings)
✅ All 138 loader tests pass
✅ Manual verification confirms gitignored directories are properly excluded
Note on CI
Some CI jobs may fail due to infrastructure issues:
/opt/dev/bin/devnot available in CIThese are pre-existing environment issues unrelated to these changes.