Repository navigation
Add JSON streaming to app function replay watch mode - #9007
Draft
gonzaloriestra wants to merge 1 commit into
Draft
gonzaloriestra wants to merge 1 commit into
gonzaloriestra wants to merge 1 commit into
Conversation
This branch has not been deployed
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?
Fixes https://github.com/shop/issues-develop/issues/24315.
Function replay watches by default, but currently rejects
--jsonunless--no-watchis supplied.WHAT is this pull request doing?
Add a typed JSONL watch stream with lifecycle, rebuild, and execution records. Keep diagnostics on stderr and preserve native runner fields and numeric tokens inside execution results. Recoverable build and Function failures keep watching; fatal failures stop the session. Cancellation waits for the watcher, builds, and runner to finish.
The finite
--no-watch --jsonresult and text watch UI stay compatible. Help and schema discovery describe both output modes.Representative text output:
JSON watch output:
{"type":"status","timestamp":"2026-10-26T09:00:00Z","status":"watching"} {"type":"execution","timestamp":"2026-10-26T09:00:00Z","result":{"name":"function.wasm","size":1,"memory_usage":64,"instructions":1000,"logs":"","input":{},"output":{"operations":[]},"success":true},"exitCode":0}Validation: 154 focused tests, affected TypeScript and lint checks, CLI build, schema discovery, and generated command artifacts. Regression checks also fail when native numeric tokens are re-encoded. Watch events and runner operations are controlled in contract tests; no live-store replay was run.
How to manually test your changes?
pnpm shopify app function replay --path <function-directory> --log <log-identifier> --json --no-input > replay.jsonl 2> replay.stderr.--no-watch --jsonto inspect the single native result, and without--jsonto inspect the terminal UI.pnpm shopify app function replay --json-schemato inspect both contracts without starting replay.Checklist
minorfor CLI streaming support,patchfor CLI Kit process cancellation).