[eas-cli] Display build logs when --wait flag is set - #4303
[eas-cli] Display build logs when --wait flag is set#4303AHGIJMKLKKZNPJKQR wants to merge 1 commit into
Conversation
|
Subscribed to pull request
Generated by CodeMention Warning: The preamble and epilogue options in commentConfiguration are deprecated. Use template instead. |
There was a problem hiding this comment.
Pull request overview
This PR enhances eas build --wait UX by streaming build progress logs into the CLI while waiting, reusing the existing workflow log polling + realtime (Centrifugo) infrastructure and extracting shared log-parsing/state logic into reusable utilities under commandUtils/logs.
Changes:
- Extracted reusable log parsing/formatting/state + realtime watching into
packages/eas-cli/src/commandUtils/logs/*. - Refactored workflow log handling to use the shared logs utilities (
LogsWatcher, shared types, shared formatting helpers). - Updated
waitForBuildEndAsyncto track log state and re-render spinner text when logs change (including realtime publications), with new build-log formatting helpers.
Reviewed changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/eas-cli/src/ora.ts | Adds isSpinnerEnabled() helper and reuses it in ora() to centralize spinner enablement logic. |
| packages/eas-cli/src/commandUtils/workflow/utils.ts | Switches workflow log rendering to shared logs utilities (choicesFromJobLogs, stepLogTail, LogsWatcher). |
| packages/eas-cli/src/commandUtils/workflow/types.ts | Removes workflow-specific log type aliases (migrated to shared commandUtils/logs/types). |
| packages/eas-cli/src/commandUtils/workflow/stateMachine.ts | Updates selection state to use shared JobLogs and formatting helpers. |
| packages/eas-cli/src/commandUtils/workflow/logs/watcher.ts | Removes workflow-specific watcher (replaced by shared commandUtils/logs/watcher). |
| packages/eas-cli/src/commandUtils/workflow/logs/parseLogs.ts | Removes workflow-specific parsing/grouping (replaced by shared commandUtils/logs/parseLogs). |
| packages/eas-cli/src/commandUtils/workflow/logs/tests/watcher-test.ts | Removes workflow watcher tests (replaced by shared watcher/state tests). |
| packages/eas-cli/src/commandUtils/workflow/logs.ts | New workflow log facade: fetch/parse/process job logs + create LogSource for shared watcher. |
| packages/eas-cli/src/commandUtils/workflow/fetchLogs.ts | Adjusts imports/paths after workflow logging refactor. |
| packages/eas-cli/src/commandUtils/workflow/tests/utils-test.ts | Updates tests to use shared parse/types. |
| packages/eas-cli/src/commandUtils/workflow/tests/logs-test.ts | Adds tests for logSourceForWorkflowJob behavior (target selection, in-progress detection, parsing). |
| packages/eas-cli/src/commandUtils/logs/watcher.ts | New shared LogsWatcher that manages polling + realtime subscriptions for arbitrary log sources. |
| packages/eas-cli/src/commandUtils/logs/types.ts | New shared raw/processed log types (RawLogLine, LogLine, JobLogs). |
| packages/eas-cli/src/commandUtils/logs/state.ts | New shared LogsState that merges file snapshots with buffered realtime publications. |
| packages/eas-cli/src/commandUtils/logs/parseLogs.ts | New shared JSONL parsing + log grouping + dedupe/merge helpers. |
| packages/eas-cli/src/commandUtils/logs/format.ts | New shared helpers to format grouped logs into prompt choices and tail log lines. |
| packages/eas-cli/src/commandUtils/logs/tests/watcher-test.ts | Adds shared watcher tests (subscription lifecycle, polling behavior, publication handling). |
| packages/eas-cli/src/commandUtils/logs/tests/state-test.ts | Adds shared state tests (buffering/reveal semantics, dedupe behavior). |
| packages/eas-cli/src/commandUtils/logs/tests/parseLogs-test.ts | Updates existing parse/group/merge tests to use shared RawLogLine types. |
| packages/eas-cli/src/commands/workflow/logs.ts | Updates workflow logs command to use shared log types (JobLogs, LogLine) and remove unsafe casts. |
| packages/eas-cli/src/build/logs.ts | Adds build-specific LogSource + “active build(s)” spinner text formatting driven by shared grouped logs. |
| packages/eas-cli/src/build/build.ts | Integrates shared watcher/state into --wait loop; re-renders spinner text on log changes. |
| packages/eas-cli/src/build/tests/waitForBuildEndAsync-test.ts | Adds regression tests ensuring watcher creation is gated by spinner enablement and spinner text updates on publications. |
| packages/eas-cli/src/build/tests/logs-test.ts | Adds unit tests for build log source + formatting functions (formatActiveBuildText, formatActiveBuildsText, isBuildCompleted). |
| packages/eas-cli/src/tests/commands/workflow-logs-test.ts | Updates import path for workflow log fetching to match new module structure. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
580fae2 to
25e7ed3
Compare
25e7ed3 to
ad22920
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## AHGIJMKLKKZNPJKQR/incremental-realtime-logs #4303 +/- ##
==============================================================================
Coverage ? 64.88%
==============================================================================
Files ? 1056
Lines ? 48804
Branches ? 10278
==============================================================================
Hits ? 31663
Misses ? 17024
Partials ? 117 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
ad22920 to
fcbb4e7
Compare
fcbb4e7 to
cb8204f
Compare
cb8204f to
e7afb1e
Compare
|
✅ Thank you for adding the changelog entry! |
Why
Tracking progress of builds created with
eas buildrequires going to the web UI.The
--waitflag only displays a spinner, which is in contrast to workflows, which display logs and steps as they progress.How
We use the existing log polling and realtime log centrifugo clients used by workflows to ingest logs as they appear.
packages/eas-cli/src/commandUtils/workflow/logsintopackages/eas-cli/src/commandUtils/logs.packages/eas-cli/src/build/buildto store the log state and rerender the spinner text when logs change (same as workflows).Test Plan
CI passes, manual testing with local build of eas cli
Stack created with GitHub Stacks CLI • Give Feedback 💬