Repository navigation
Expand app configuration through extension specifications - #8686
Conversation
a63015f to
6809ca7
Compare
Keep event subscription expansion and identity in the events specification. Use the shared loader validation path for each expanded module and validate subscription handles before resolving identity. Co-authored-by: Rezaan Syed <rezaan.syed@shopify.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
6809ca7 to
2241ebd
Compare
Rename the flag to f_single_subscription_events_modules and drop the SHOPIFY_CLI_EVENTS_SUBSCRIPTION_FANOUT environment opt-in.
Business Platform resolves hashed client handles rather than readable Verdict handles, so the readable name always evaluated to false.
The platform is removing the nested handle from the single-subscription contract, so an expanded configuration that still carried it inside the subscription failed validation before the deploy transform stripped it. Expand each subscription into a module with its handle at the top level, like every other module, and derive identity and target from there.
|
/snapit |
| const EventsSchema = BaseSchemaWithoutHandle.extend({ | ||
| events: zod.any().optional(), | ||
| handle: ModuleHandleSchema.optional(), | ||
| events: EventsSectionSchema.optional(), | ||
| }).superRefine((config, context) => { |
There was a problem hiding this comment.
We can't include handle here outside of events. This will receive the full app toml config, and handle is a field belonging to the branding module. We can only validate events and its children here.
There was a problem hiding this comment.
@rezaansyed this is a limitation of the expansion approach, i'm looking on ways to improve this.
Differences in type declarationsWe detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:
New type declarationsWe found no new type declarations in this PR Existing type declarationspackages/cli-kit/dist/public/node/cli.d.ts@@ -35,7 +35,6 @@ export declare function runCreateCLI(options: RunCLIOptions, launchCLI?: (option
export declare const globalFlags: {
'no-color': import("@oclif/core/interfaces").BooleanFlag<boolean>;
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
- 'no-input': import("@oclif/core/interfaces").BooleanFlag<boolean>;
};
export declare const jsonFlag: {
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
/snapit |
|
🫰✨ Thanks @isaacroldan! Your snapshot has been published to npm. Built from Test the snapshot by installing your package globally: pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20261002155739Caution After installing, validate the version by running |
gonzaloriestra
left a comment
There was a problem hiding this comment.
I've been playing around and everything looks good 👍
WHY are these changes introduced?
Alternative to #8426, built on #8425. Deploying one events module per subscription needs support for multiple modules from one app configuration section. The events contract and identity rules belong in its specification.
WHAT is this pull request doing?
Add optional specification hooks for configuration expansion, module identity, and module target. The loader creates and validates every result through the same path, while the events specification owns the subscription split.
Expand event subscriptions by default, without an organization flag lookup. Require valid, unique subscription handles and reject the reserved legacy handle
events. Keep app branding handles out of events validation, preserve extra subscription fields, and return no modules for an empty subscription list.Validated with 350 tests across eight files, app type checking, lint on changed files, and Knip for the app workspace. Includes deploy/config-link round trips, identity stability, and invalid configuration cases. A live deploy has not been tested. The server must support single-subscription events modules before this CLI change is released.
How to manually test your changes?
Checklist