Support single-subscription events modules when reading remote configuration - #8425
Draft
rezaansyed wants to merge 1 commit into
Draft
Support single-subscription events modules when reading remote configuration#8425rezaansyed wants to merge 1 commit into
rezaansyed wants to merge 1 commit into
Conversation
…uration Assisted-By: devx/aa56a38c-289a-416e-8a9a-0de281e4e3e7
Draft
3 tasks
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?
Shopify Core is adding a single-subscription shape for
eventsapp modules: the:eventsmodule config will accept either the existing subscription list (subscription: [...], one module with uid"events") or a new single-subscription object (subscription: {...}, one module per subscription, uid = subscription handle). This enables shop-scoped (imperative) event subscriptions and a migration from one list module to N single-subscription modules.The CLI's events transforms are currently hard-typed to the list shape:
transformToEventsConfigcalls.maponsubscriptionand crashes on an object, andconfig linkwould need N single-subscription modules to merge back into one[[events.subscription]]list in the local TOML.WHAT is this pull request doing?
transformToEventsConfig(remote → local): accepts a single-subscription object or the legacy array. Single objects are normalized to a one-element array (after stripping the server-managedidentifier), so merging N single-subscription modules viadeepMergeObjectsimplodes them into one subscription list in the TOML.transformFromEventsConfig(local → remote): resolves relative subscription URIs for both shapes, preserving the input shape.The local TOML format is unchanged:
[[events.subscription]]stays a list. This is read-side tolerance only.How to test your changes?
pnpm vitest run src/cli/models/extensions/specifications/transform/app_config_events.test.ts(14 tests, 5 new covering single-object stripping, multi-module merge, mixed-shape merge, and relative-URI resolution for the object shape).Post-release steps
None.
Measuring impact
Checklist