Repository navigation
feat: stream the deploy output while it runs - #18
Conversation
The deploy phase ran under spawnSync and printed its captured stdout only after the process exited, so a long deploy showed nothing in the job log until the end. Phases now run with spawn: each stdout chunk is written to the log as it arrives and also collected for the result parsing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (3)
Included review availability: This review used your included allowance. 3 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 4 reviews per hour. Summary by CodeRabbit
WalkthroughAdded Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to No new merge-blocking issue was established; the change is ready for normal merge checks. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
Why
The action ran the deploy with
spawnSyncand printed its stdout only after the process exited. A long deploy showed nothing in the job log until the end.A production deploy of pdp-control-plane (run 37316359545) shows
$ bun run --bun prisma deploy module.mjsat 13:32:41. The next line appears at 13:37:06.What changed
run.mjsexportsrunCommand. It runs a command withchild_process.spawnand waits for it to exit.captureon (the deploy phase), stdout is piped. Each chunk goes to the job log as it arrives, and is also collected. The collected stdout is whatrunPhasereturns, so the result envelope, the URL outputs and the job summary table are parsed from the same text as before.::endgroup::. Before, a partial last line ran into the marker. The collected stdout is not changed.runPhaseinmain.mjscallsrunCommand. The exit status, signal and spawn error checks are the same, and so is the environment.runPhasecode, so they now also run throughspawn. Their output was already inherited and live, so nothing changes for them.maxBufferlimit is gone, becausespawnhas none.dist/.Tests
tests/run.test.mjsruns a fake command throughrunCommandin a separate Node process and records when each write reaches stdout.first, waits 500 ms, then printssecond. The test checks thatfirstarrives in its own write, at least 300 ms beforesecond. With the output held until exit, as in the old code, this test fails. I checked that.deployedUrlsFromOutputparses it into the sameurlsandurlas before.ENOENT) come back as before.On Node 24,
node --checkon the action scripts,node --test tests/*.test.mjs(62 pass) and theaction.ymlsanity check from CI all pass. I also ranmain.mjsend to end against a fakeprismabin that prints, waits 1.5 s, then prints a result line. The first line showed up in the log right away. Theurl,urlsandoutcomeoutputs came out as expected, and a failing exit still setoutcome=failed.Next
This is the first of two changes. With the output now passed through live, Composer's step events will then show in the job log as they happen.
🤖 Generated with Claude Code