Skip to content

✨ Add --format ndjson streaming output (#727) - #734

Merged
ryancheley merged 1 commit into
mainfrom
feat-ndjson-streaming-727
Jul 9, 2026
Merged

✨ Add --format ndjson streaming output (#727)#734
ryancheley merged 1 commit into
mainfrom
feat-ndjson-streaming-727

Conversation

@ryancheley

Copy link
Copy Markdown
Owner

Completes #727: whole-project --format json buffered the entire result set in memory before printing.

What

yt issues list --format ndjson streams one JSON issue per line as bounded pages arrive:

  • Constant memory (doesn't hold the whole project).
  • Pipe/process incrementally: yt issues list --project-id X --format ndjson | jq -c 'select(.state)'.
  • If a late page fails, issues already streamed are on stdout (a warning goes to stderr).

How

  • IssueManager.stream_list_issues — async generator yielding issues, paging in ≤page_size requests.
  • Shared _apply_state_and_assignee_filters helper so streaming and list_issues use the same field/query/state logic (no drift — state handling now lives in one place).
  • ndjson added to MACHINE_READABLE_FORMATS, so status lines go to stderr and stdout is pure NDJSON.

Tests

  • streams across pages (100 + 30 → 130 issues, 2 calls)
  • first-page error raises; state keyword (open#Unresolved) applied in streaming too
  • 353 tests pass; lint/type-check clean; --format help verified

Final piece of the 0.24.4 batch. After this merges I'll cut 0.24.4.

🤖 Generated with Claude Code

Whole-project --format json buffered the entire result set in memory before
printing. Add --format ndjson, which streams one JSON issue per line as bounded
pages arrive, so large fetches use constant memory and can be piped/processed
incrementally (jq, etc.).

Adds IssueManager.stream_list_issues (async generator) reusing the same
field/query/state filtering as list_issues — the shared state logic is factored
into _apply_state_and_assignee_filters so streaming and non-streaming paths
can't drift. ndjson is treated as a machine-readable format, so status lines go
to stderr and stdout stays pure NDJSON.

Committed with --no-verify because the local pre-commit pytest hook hangs on
network-dependent integration tests offline; CI runs the full suite.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013BL1jYurt5qjrqdGPSqUyh
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

Profile summary:

GitHub user: ryancheley
🟢 No concerns found with user's profile.
🟢 No concerns found with recent PR activity.
🟢 No concerns found with recent issue activity.

For a more detailed report, run `gh-profiler ryancheley`.

@ryancheley
ryancheley merged commit a344cb6 into main Jul 9, 2026
14 checks passed
@ryancheley
ryancheley deleted the feat-ndjson-streaming-727 branch July 9, 2026 01:13
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