Repository navigation
Scan extension and web directories outside the app directory - #8767
Merged
jek merged 1 commit intoOct 6, 2026
Merged
Conversation
jek
added this pull request to stack #8768
October 5, 2026 22:01
jek
force-pushed
the
app-security/extension-directories
branch
from
October 5, 2026 22:24
9e1f196 to
8f4ba0d
Compare
jek
force-pushed
the
app-security/extension-directories
branch
2 times, most recently
from
October 6, 2026 02:55
a0178fc to
406163b
Compare
gonzaloriestra
approved these changes
Oct 6, 2026
| } | ||
| const {scanDirectories, requestedScanDirectories} = mergeScanDirectories(appDirectory, includeDirectories) | ||
| const appConfigDirectories = selection.kind === 'config' ? (selection.appConfigDirectories ?? []) : [] | ||
| const {scanDirectories, requestedScanDirectories} = mergeScanDirectories( |
Contributor
There was a problem hiding this comment.
Same issue of the previous PR. With web_directories = ["../backend"], running with --exclude '../backend' still scans that directory’s files. The walker checks exclusions against entries inside each scan root, so it never matches the root itself
Contributor
Author
jplhomer
approved these changes
Oct 6, 2026
jek
force-pushed
the
app-security/extension-directories
branch
from
October 6, 2026 13:19
406163b to
26edd8f
Compare
The selected app configuration file can point extension_directories and web_directories outside the app directory, for example "../shared-extensions/*". The CLI loads those extensions and webs as part of the app, but App Security only scanned the app directory, so their files were skipped unless they were passed with --include-dir. Add the directory of each extension and web TOML that the selected file's globs match, as the CLI's loader matches them, when it's outside the app directory. A glob that matches no TOML adds nothing, and neither does an absolute entry, which the CLI never loads from. These directories are implicit, so unlike an --include-dir directory, one reached through a symbolic link outside the app directory is left out. Coverage records them with a new scan-directory origin, app_config_directory. The scope and the generated commands don't change, since running the same command again finds the same directories.
jek
force-pushed
the
app-security/extension-directories
branch
from
October 6, 2026 13:27
26edd8f to
9cb585b
Compare
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.
WHY are these changes introduced?
The selected app configuration file can point
extension_directoriesandweb_directoriesoutside the app directory, for example../shared-extensions/*.devanddeployload those extensions and webs as part of the app, butapp security checkonly scanned the app directory, so their files were skipped unless they were passed with--include-dir.WHAT is this pull request doing?
--include-dirdirectory. The matching is the CLI loader's own (extensionFilesForConfigandwebFilesForConfig), so only module directories are added, not every directory a glob starts from. A glob that matches no TOML adds nothing.--include-dir.app_config_directory, in the--jsonselection and in coverage. The scope and the generated commands don't change, since running the same command again finds the same directories.Stacked on #8763: extensions in these directories count as this app's, and only another
shopify.app*.tomltriggers its warning.How to manually test your changes?
The output lists
../shared-extensions/theme/assets/theme.jsand../shared-extensions/theme/shopify.extension.toml. It doesn't list../shared-extensions/README.md, which isn't in an extension directory, or../not-extensions/tools/build.ts, whose glob matches no TOML.Run the same command with
--json --skip-instructionsinstead of--list-files:selection.scan_directorieslists theshared-extensions/themedirectory with the originapp_config_directory.Checklist
patchfor bug fixes ·minorfor new features ·majorfor breaking changes) and added a changeset withpnpm changeset add