Skip to content

Fix apps failing validation when a configuration module contract requires its own section - #8387

Open
kutaysahindev wants to merge 1 commit into
Shopify:mainfrom
kutaysahindev:kutay/fix-config-contract-root-required
Open

Fix apps failing validation when a configuration module contract requires its own section#8387
kutaysahindev wants to merge 1 commit into
Shopify:mainfrom
kutaysahindev:kutay/fix-config-contract-root-required

Conversation

@kutaysahindev

Copy link
Copy Markdown

WHY are these changes introduced?

Fixes #8386

Since 2026-08-24, shopify app deploy, shopify app dev, and shopify app config validate fail with [events]: Required for apps whose shopify.app.toml has never had an [events] section. Adding the section only produces a contradictory pair of errors ([events.subscription]: Required + Unsupported section(s) in app configuration: events), so no toml content can pass. The failure reproduces identically on CLI 3.94.3 through 4.7.0, which points at the remote specification contracts rather than any single release.

Root cause: unifiedConfigurationParserFactory validates the whole app config object against every configuration-experience spec's remote JSON-schema contract, even when that spec's section is absent from the toml. The platform's events spec contract now ships a root-level "required": ["events"], so every app without an [events] section fails validation before the loader's existing "empty config → no module for this spec" short-circuit (createConfigExtensionInstances) can run. Any configuration spec shipping a root-level required for its own section would break all apps the same way.

WHAT is this pull request doing?

  • packages/app/src/cli/utilities/json-schema.ts: for configuration-experience specs, drop the contract's root-level required before compiling the AJV validator. Whether a config module exists is decided by the presence of its section in the toml (the loader's model), so the contract must not force the section into existence. Nested required properties (e.g. events.api_version, events.subscription) are still fully enforced once the section is present, and extension-experience specs — where the toml is the module config — are untouched.
  • packages/app/src/cli/models/extensions/specifications/transform/app_config_events.ts: the events reverse transform returned {events: {}} when there is no events config, instead of omitting the section like every other config transform (e.g. transformToWebhookConfig). That empty object leaked into linked configurations and deploy diffs. It now returns {}.
  • Tests for both changes, including an end-to-end one through fetchSpecifications using the existing remote_only_extension_schema_config_style fixture (configuration experience + root-level required).
  • Changeset (@shopify/cli, patch).

How to test your changes?

  1. pnpm vitest run packages/app/src/cli/utilities/json-schema.test.ts packages/app/src/cli/models/extensions/specifications/transform/app_config_events.test.ts packages/app/src/cli/services/generate/fetch-extension-specifications.test.ts
  2. To reproduce the incident end-to-end: with a development store app whose shopify.app.toml has no [events] section, run shopify app config validate on main (fails with [events]: Required while the platform serves the current events contract) and again with this branch (passes).
  3. Regression check: an app with an [events] section still gets nested contract validation ([events.api_version]: Required etc.).

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

An app config module is only part of an app when its section is present in
the toml, so a remote contract's root-level required properties must not
force a section into existence. This caused every app without an [events]
section to fail validation with "[events]: Required" once the platform
started shipping an events contract that requires its own section.

Also stop the events reverse transform from emitting an empty events object
when there is no events config, matching the other config transforms.

Fixes Shopify#8386
@kutaysahindev
kutaysahindev requested a review from a team as a code owner August 24, 2026 09:29
@kutaysahindev

Copy link
Copy Markdown
Author

I have signed the CLA!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

shopify app deploy blocked by phantom [events]: Required — Partner Dashboard shows no Events feature enabled

1 participant