Skip to content

[eas-cli] Add simulator session activity command#4001

Draft
szdziedzic wants to merge 1 commit into
mainfrom
szdziedzic-codex/device-run-session-events-cli
Draft

[eas-cli] Add simulator session activity command#4001
szdziedzic wants to merge 1 commit into
mainfrom
szdziedzic-codex/device-run-session-events-cli

Conversation

@szdziedzic

Copy link
Copy Markdown
Contributor

Why

Device run session activity is being persisted as structured events, but users also need a terminal-friendly way to inspect and follow that activity without opening expo.dev.

This adds the EAS CLI consumer for:

The parallel website consumer is https://github.com/expo/universe/pull/28938.

The www and collection PRs must deploy before this command is released.

How

  • Added the hidden experimental eas simulator:events command. It supports an explicit session ID or the local simulator environment, repeatable producer filters, a bounded history limit, --follow, JSON snapshots, human output, and parseable NDJSON streaming.
  • Expanded the DeviceRunSession GraphQL query helper to fetch the producer-neutral event-log descriptor and signed worker log URLs.
  • Added abort-signal support through GraphQL and signed-file downloads so Ctrl+C immediately cancels in-flight requests and pending poll timers without stopping the remote session.
  • Added a bounded, defensive NDJSON parser with device-session validation, revision-aware deduplication, unknown schema/producer support, malformed and oversized record handling, and recursive secret redaction.
  • Keeps NDJSON stdout machine-parseable during transient failures; diagnostics go to stderr and incomplete terminal snapshots set a non-zero exit code.
  • Verifies terminal completeness per registered producer and observed stream, requiring the appropriate successful stream.completed or stream.snapshot marker.

Example usage:

eas simulator:events --id <device-run-session-id>
eas simulator:events --id <device-run-session-id> --follow --format ndjson

Test Plan

  • Focused command, parser/downloader, GraphQL client, and DeviceRunSession query suites (38 tests)
  • corepack yarn typecheck in packages/eas-cli
  • corepack yarn fmt:check
  • Focused type-aware oxlint checks with zero warnings/errors
  • git diff --check

This remains a draft until the www API and collection PR are available in a test environment for end-to-end verification with a real remote session.

@szdziedzic szdziedzic added the no changelog PR that doesn't require a changelog entry label Jul 11, 2026
@github-actions

Copy link
Copy Markdown

⏩ The changelog entry check has been skipped since the "no changelog" label is present.

@codecov

codecov Bot commented Jul 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.13445% with 66 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.97%. Comparing base (4b1f785) to head (b77ac3d).

Files with missing lines Patch % Lines
packages/eas-cli/src/commands/simulator/events.ts 84.12% 44 Missing ⚠️
packages/eas-cli/src/simulator/events.ts 88.67% 17 Missing ⚠️
packages/eas-cli/src/graphql/client.ts 85.30% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4001      +/-   ##
==========================================
+ Coverage   59.67%   59.97%   +0.30%     
==========================================
  Files         941      943       +2     
  Lines       41319    41793     +474     
  Branches     8675     8850     +175     
==========================================
+ Hits        24654    25062     +408     
- Misses      16571    16637      +66     
  Partials       94       94              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

no changelog PR that doesn't require a changelog entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant