[eas-cli] Add simulator session activity command - #4001
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4001 +/- ##
==========================================
+ Coverage 61.93% 62.06% +0.14%
==========================================
Files 990 993 +3
Lines 44447 44622 +175
Branches 9340 9390 +50
==========================================
+ Hits 27524 27691 +167
- Misses 15471 15479 +8
Partials 1452 1452 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
7ba68b4 to
21855da
Compare
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
|
Subscribed to pull request
Generated by CodeMention Warning: The preamble and epilogue options in commentConfiguration are deprecated. Use template instead. |
| import fetch, { RequestError } from '../fetch'; | ||
| import { formatMilliseconds } from '../utils/timer'; | ||
|
|
||
| const DeviceRunSessionEventSchema = z |
There was a problem hiding this comment.
i start to think this should be in eas-build-job, shared across the three projects we use it in
There was a problem hiding this comment.
moved it there
Move the DeviceRunSession session-events record schema, type, and NDJSON parser out of eas-cli into @expo/eas-build-job so producers (worker, agent-device) and consumers (eas-cli, website) share a single source of truth for the wire format. eas-cli re-exports the type and keeps the CLI-only display, formatting, and download logic. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
4fe4db9 to
2146159
Compare
Run `yarn generate-graphql-code` to refresh the committed schema snapshot and generated types against the current API. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
✅ Thank you for adding the changelog entry! |
Why
Users running remote simulator sessions from EAS CLI need a terminal view of the same structured activity available on the Website.
How
eas simulator:eventscommand.--idor the simulator dotenv file.__eas_type: session-eventsmetadata and parse its NDJSON records with Zod.@expo/eas-build-job(deviceRunSession.ts) so producers (worker, agent-device) and consumers (CLI, Website) use a single source of truth; the CLI keeps only the display projection, formatting, and download logic.--jsonas a raw, lossless snapshot of the canonical event records.--followwith five-second updates, withholding incomplete operations until they finish and refreshing twice after the session stops so the worker's final upload is included. Transient poll failures are retried, the first Ctrl-C wakes polling and flushes incomplete events, and a second Ctrl-C force-exits.yarn generate-graphql-code; the only query this PR adds isDeviceRunSessionEventsByIdQuery, which uses pre-existing schema fields.The command does not read or alter worker runtime logs.
Test Plan
yarn test src/simulator/__tests__/events.test.ts src/commands/simulator/__tests__/events.test.ts --runInBand(inpackages/eas-cli)yarn test src/__tests__/deviceRunSession.test.ts(inpackages/eas-build-job)yarn typecheckyarn lintyarn fmtCoverage includes artifact discovery, empty snapshots, NDJSON parsing and deduplication, malformed records and timestamps, operation grouping across producers, compact and terminal-safe formatting, screenshot basename handling, post-stop refreshes, transient query and download retries, immediate interrupt wakeup and final flushing, second-interrupt force exit, and the absence of custom SIGINT handling outside follow mode.
Manual staging verification
Tested from
~/expo/testapp-stagingagainst stopped agent-device session019f8ecd-f874-70ec-8f5d-ef18197681d4, withEXPO_STAGING=1on every CLI invocation.Representative output (55 canonical records condensed to 21 lines):
Verified that
--jsonreturned all 55 canonical records without applying the text projection:{ "deviceRunSessionId": "019f8ecd-f874-70ec-8f5d-ef18197681d4", "eventCount": 55 }Also ran
--followagainst the stopped session. It printed the same final 21-line snapshot and exited successfully.Rollout
Release after expo/universe#28937 and #3999 are deployed. The richer producer summaries from callstack/agent-device#1379 can ship independently and will be displayed automatically.