Reuse Shopify CLI app identity and config schemas in App Doctor - #8514
Open
jplhomer wants to merge 1 commit into
Open
Reuse Shopify CLI app identity and config schemas in App Doctor#8514jplhomer wants to merge 1 commit into
jplhomer wants to merge 1 commit into
Conversation
jplhomer
added this pull request to stack #8515
September 9, 2026 20:40
Walk-up discovery and config-file names now share isValidFormatAppConfigurationFileName. Access, auth, and webhook parsing use the CLI schemas, with URI strings kept only so INSECURE_WEBHOOK_URL can still report http. This is not Project.load(): bounded reads, coverage gaps, and unconfigured extensions stay Doctor-specific. Co-authored-by: AI (Pi/Grok 4.6) <noreply@pi.dev>
jplhomer
force-pushed
the
app-doctor/reuse-cli-project-rules
branch
from
September 9, 2026 20:44
54d874a to
43f85ce
Compare
jplhomer
marked this pull request as ready for review
September 9, 2026 21:05
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
A new validation check in findAppRoot makes an existing error message misleading for non-app .toml paths and should be updated before merging.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR aligns App Doctor’s app discovery and TOML parsing with Shopify CLI’s established app configuration identity and schemas, reducing drift as CLI rules evolve.
Changes:
- Reuse CLI app config file identity (
APP_CONFIG_FILE_GLOB+isValidFormatAppConfigurationFileName) in Project root discovery, config-file prompting, and App Doctor discovery. - Parse
access_scopes,auth, and webhook subscriptions using CLI schemas while keeping webhook URIs as strings to preserveINSECURE_WEBHOOK_URLbehavior. - Add/adjust tests to cover invalid “glob-matching but not CLI-shaped” config files and non-CLI-shaped webhook subscriptions.
File summaries
| File | Description |
|---|---|
| packages/app/src/cli/services/app-doctor-engine/tests/discovery-safety.test.ts | Adds coverage ensuring glob matches are filtered to CLI-valid app config filenames. |
| packages/app/src/cli/services/app-doctor-engine/tests/deterministic-rules.test.ts | Extends parsing contract tests for webhook URI handling and shape filtering. |
| packages/app/src/cli/services/app-doctor-engine/scanners/discover.ts | Switches discovery/parsing to CLI naming + schemas; keeps webhook URIs as strings. |
| packages/app/src/cli/prompts/config.ts | Filters config-file candidates using the CLI filename validator. |
| packages/app/src/cli/models/project/project.ts | Uses shared naming identity (glob + validator) for project root/config discovery. |
| packages/app/src/cli/models/app/config-file-naming.ts | Introduces a shared glob constant for app config discovery. |
| packages/app/src/cli/models/app/config-file-naming.test.ts | Adds filename validator test cases for near-miss filenames. |
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+39
to
41
| if (!isValidFormatAppConfigurationFileName(basename(requestedPath))) { | ||
| throw new AppRootDiscoveryError(`App path is not a directory or TOML file: ${startPath}`) | ||
| } |
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?
App Doctor walked up for
shopify.app*.tomland parsed access, auth, and webhooks with its own schemas and fallbacks. That can disagree with Shopify CLI as those rules change.Stacked on #8513.
WHAT is this pull request doing?
Share CLI app-config identity (
isValidFormatAppConfigurationFileName/APP_CONFIG_FILE_GLOB) in Project discovery, config-file prompts, and App Doctor. Parse access, auth, and webhook subscriptions with the CLI schemas. Keep webhook URIs as strings soINSECURE_WEBHOOK_URLcan still report http.This is not
Project.load(). Bounded reads, coverage gaps, no-cwd-fallback, and scanning unconfigured extensions stay Doctor-specific.No user-facing CLI command change.
How to manually test your changes?
From an app directory:
A directory that only has
shopify.application.tomlshould not be treated as an app root.Checklist
patchfor bug fixes ·minorfor new features ·majorfor breaking changes) and added a changeset withpnpm changeset add