Skip to content

[eas-cli] Display build logs when --wait flag is set - #4303

Open
AHGIJMKLKKZNPJKQR wants to merge 1 commit into
AHGIJMKLKKZNPJKQR/incremental-realtime-logsfrom
tom/realtime-build-logs
Open

[eas-cli] Display build logs when --wait flag is set#4303
AHGIJMKLKKZNPJKQR wants to merge 1 commit into
AHGIJMKLKKZNPJKQR/incremental-realtime-logsfrom
tom/realtime-build-logs

Conversation

@AHGIJMKLKKZNPJKQR

@AHGIJMKLKKZNPJKQR AHGIJMKLKKZNPJKQR commented Aug 28, 2026

Copy link
Copy Markdown
Member

Why

Tracking progress of builds created with eas build requires going to the web UI.
The --wait flag 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.

  • Extracted common logging types and logic from packages/eas-cli/src/commandUtils/workflow/logs into packages/eas-cli/src/commandUtils/logs.
  • Updated packages/eas-cli/src/build/build to 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 CLIGive Feedback 💬

@github-actions

Copy link
Copy Markdown

Subscribed to pull request

File Patterns Mentions
packages/eas-cli/** @douglowder
packages/eas-cli/src/build/** @sjchmiela
packages/eas-cli/src/commands/workflow/** @sjchmiela

Generated by CodeMention

Warning: The preamble and epilogue options in commentConfiguration are deprecated. Use template instead.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 waitForBuildEndAsync to 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.

@codecov

codecov Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.31833% with 27 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (AHGIJMKLKKZNPJKQR/incremental-realtime-logs@7318bc9). Learn more about missing BASE report.

Files with missing lines Patch % Lines
packages/eas-cli/src/build/build.ts 73.22% 15 Missing ⚠️
...ackages/eas-cli/src/commandUtils/workflow/utils.ts 66.67% 3 Missing ⚠️
packages/eas-cli/src/build/logs.ts 96.83% 2 Missing ⚠️
packages/eas-cli/src/commandUtils/logs/watcher.ts 95.75% 2 Missing ⚠️
packages/eas-cli/src/commands/workflow/logs.ts 33.34% 2 Missing ⚠️
packages/eas-cli/src/ora.ts 33.34% 2 Missing ⚠️
packages/eas-cli/src/commandUtils/workflow/logs.ts 96.43% 1 Missing ⚠️
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.
📢 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.

@github-actions

Copy link
Copy Markdown

✅ Thank you for adding the changelog entry!

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.

2 participants