Skip to content

feat(cli): add --watch to coder exp sync timeline#27152

Draft
SasSwart wants to merge 1 commit into
sync-unit-timelinefrom
sync-timeline-watch
Draft

feat(cli): add --watch to coder exp sync timeline#27152
SasSwart wants to merge 1 commit into
sync-unit-timelinefrom
sync-timeline-watch

Conversation

@SasSwart

Copy link
Copy Markdown
Contributor

Adds --watch / -w to coder exp sync timeline (PR 3 of the Script Coordination timing stack, based on #27150).

Summary

  • The one-shot graph renderer is refactored into a stateful timelineRenderer whose renderEvents consumes a growing event log incrementally, skipping already-seen events by sequence number. Lane assignment, active-lane tracking, and readiness state persist across calls, so streamed rows are byte-identical to a one-shot render of the same log. renderTimeline (one-shot) is now a thin wrapper.
  • --watch renders the events recorded so far, then polls the agent every second and prints only newly produced rows until interrupted. Interruption (Ctrl+C) exits cleanly.
  • --watch is text-only; combining it with --output json returns an error.

Testing

  • Renderer: chunked/overlapping incremental feeding asserted byte-identical to one-shot rendering, including across a connector-row boundary.
  • CLI: pty-based integration test covering pre-watch backlog rendering, live streaming of new events, and clean exit on interrupt; error-path test for --watch --output json; regenerated help golden.

Generated by Coder Agents on behalf of @SasSwart.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant