Skip to content

Reuse Shopify CLI app identity and config schemas in App Doctor - #8514

Open
jplhomer wants to merge 1 commit into
app-doctor/encapsulate-enginefrom
app-doctor/reuse-cli-project-rules
Open

Reuse Shopify CLI app identity and config schemas in App Doctor#8514
jplhomer wants to merge 1 commit into
app-doctor/encapsulate-enginefrom
app-doctor/reuse-cli-project-rules

Conversation

@jplhomer

@jplhomer jplhomer commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

App Doctor walked up for shopify.app*.toml and 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 so INSECURE_WEBHOOK_URL can 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:

shopify app doctor
shopify app doctor --path ./shopify.app.toml

A directory that only has shopify.application.toml should not be treated as an app root.

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes
  • I've considered analytics changes to measure impact
  • The change is user-facing — I've identified the correct bump type (patch for bug fixes · minor for new features · major for breaking changes) and added a changeset with pnpm changeset add

@jplhomer
jplhomer added this pull request to stack #8515 September 9, 2026 20:40
@jplhomer jplhomer changed the title Reuse Shopify CLI app identity and config schemas in App Doctor. Reuse Shopify CLI app identity and config schemas in App Doctor Sep 9, 2026
@github-actions github-actions Bot added the no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. label Sep 9, 2026
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
jplhomer force-pushed the app-doctor/reuse-cli-project-rules branch from 54d874a to 43f85ce Compare September 9, 2026 20:44
@jplhomer
jplhomer marked this pull request as ready for review September 9, 2026 21:05
@jplhomer
jplhomer requested a review from a team as a code owner September 9, 2026 21:06
Copilot AI lite review requested due to automatic review settings September 9, 2026 21:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 preserve INSECURE_WEBHOOK_URL behavior.
  • 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}`)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants