feat: real-time output streaming, npm publish pipeline, v0.9.0#15
feat: real-time output streaming, npm publish pipeline, v0.9.0#15
Conversation
…v0.9.0 Agent-Logs-Url: https://github.com/dev-dami/ignite/sessions/648136fe-a835-4ef3-814d-931ec34e03fd Co-authored-by: dev-dami <141376183+dev-dami@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR adds real-time streaming of Docker container output through the core execution pipeline, exposes it via the CLI (ignite run --stream), and updates release/publish automation and package metadata for the 0.9.0 release.
Changes:
- Add
onStdout/onStderrstreaming callbacks to core Docker runtime + execution options and wire them through todocker run. - Expose streaming via CLI
--streamforignite run, with unit/integration tests covering the new behavior. - Update CI to conditionally run Docker tests and add an npm publish job for tag-based releases; bump versions and add
publishConfig.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/core/src/runtime/runtime.types.ts | Adds streaming callback fields to DockerRunOptions. |
| packages/core/src/runtime/docker-runtime.ts | Implements streaming by forwarding stdout/stderr chunks to callbacks. |
| packages/core/src/execution/execute.ts | Propagates streaming callbacks from ExecuteOptions into dockerRun. |
| packages/cli/src/index.ts | Adds --stream flag and bumps CLI version string. |
| packages/cli/src/commands/run.ts | Wires --stream to stdout/stderr callbacks in executeService. |
| packages/core/src/tests/docker-runtime.test.ts | Adds unit coverage ensuring args are unaffected by streaming options. |
| packages/core/src/tests/docker-execution.test.ts | Adds Docker integration test asserting stdout streaming matches collected stdout. |
| .github/workflows/ci.yml | Makes Docker tests conditional and adds tag-triggered npm publish job. |
| package.json | Bumps repo version to 0.9.0. |
| packages/*/package.json | Bumps package versions and adds publishConfig.access=public for published packages. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| skipBuild: true, | ||
| audit: options.audit, | ||
| policy, | ||
| onStdout: options.stream ? (chunk) => process.stdout.write(chunk) : undefined, |
There was a problem hiding this comment.
--stream currently writes container output directly to stdout/stderr while --json later prints a JSON payload to stdout. If a user passes both flags, the streamed output will corrupt the JSON output (invalid JSON). Consider making --stream mutually exclusive with --json (validation in the CLI) or streaming to stderr when --json is enabled.
| onStdout: options.stream ? (chunk) => process.stdout.write(chunk) : undefined, | |
| onStdout: options.stream | |
| ? (chunk) => { | |
| if (options.json) { | |
| // When JSON output is requested, send streamed stdout to stderr | |
| // so that stdout remains valid JSON. | |
| process.stderr.write(chunk); | |
| } else { | |
| process.stdout.write(chunk); | |
| } | |
| } | |
| : undefined, |
| policy, | ||
| onStdout: options.stream ? (chunk) => process.stdout.write(chunk) : undefined, | ||
| onStderr: options.stream ? (chunk) => process.stderr.write(chunk) : undefined, | ||
| }); |
There was a problem hiding this comment.
With --stream enabled, stdout/stderr is printed in real time via the callbacks, but the subsequent human-readable report output (via formatReportAsText) includes a STDOUT: section that prints the captured stdout again. This will duplicate potentially large outputs and make the CLI output hard to read. Consider omitting stdout from the text report when streaming is enabled (e.g., add an option to the formatter, or clear/replace the displayed stdout while still keeping the raw stdout for audit parsing/JSON output).
| proc.stdout.on('data', (data: Buffer) => { | ||
| stdout += data.toString(); | ||
| const chunk = data.toString(); | ||
| stdout += chunk; | ||
| onStdout?.(chunk); | ||
| }); | ||
|
|
||
| proc.stderr.on('data', (data: Buffer) => { | ||
| stderr += data.toString(); | ||
| const chunk = data.toString(); | ||
| stderr += chunk; | ||
| onStderr?.(chunk); | ||
| }); |
There was a problem hiding this comment.
onStdout/onStderr are user-provided callbacks invoked from the data event handlers. If a callback throws, it will raise an unhandled exception from the event emitter and can crash the process (or cause the Promise to never resolve). Wrap callback invocations in a try/catch (and optionally log) so streaming cannot destabilize execution.
| if: startsWith(github.ref, 'refs/tags/v') | ||
| permissions: | ||
| contents: read | ||
| id-token: write |
There was a problem hiding this comment.
The publish-npm job grants id-token: write, but the workflow uses NODE_AUTH_TOKEN and does not appear to use OIDC/provenance publishing. Consider removing id-token: write to follow least-privilege, or switch to provenance/OIDC publishing so the permission is justified.
| id-token: write |
Adds live container output streaming as a differentiating capability, wires up automated npm publishing on release, and bumps all packages to 0.9.0.
Streaming execution output
Previously all container stdout/stderr was buffered until exit.
ExecuteOptionsnow acceptsonStdout/onStderrcallbacks that fire per-chunk as the container runs — no change to the bufferedmetrics.stdout/metrics.stderrreturn values.CLI gains a
--streamflag that wires those callbacks to the terminal:Affected files:
runtime.types.ts,docker-runtime.ts,execute.ts,commands/run.ts,cli/src/index.tsCI/CD
docker versionfirst and skips the full test suite gracefully when Docker isn't available in the runner.publish-npmjob — runs afterreleaseonv*tag pushes; publishes@ignite/shared→@ignite/core→@ignite/http→@ignite/cliin dependency order usingNPM_TOKEN. Each package gains"publishConfig": { "access": "public" }for scoped public publishing.Version bump
All packages (
shared,core,http,cli,runtime-bun, root) and the CLI.version()string moved from0.8.0→0.9.0.Original prompt
📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.