Skip to content

[eas-cli] Add observe:event command to fetch a single event by ID - #4252

Open
douglowder wants to merge 4 commits into
mainfrom
doug/eng-26000-cli-fetch-a-single-observe-event-by-id-via-the-eas-cli
Open

[eas-cli] Add observe:event command to fetch a single event by ID#4252
douglowder wants to merge 4 commits into
mainfrom
doug/eng-26000-cli-fetch-a-single-observe-event-by-id-via-the-eas-cli

Conversation

@douglowder

@douglowder douglowder commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Why

Provide a new observe:event command for retrieving either metric or custom events by ID.

How

Add the new command, and associated queries that call the new event(id:) or customEvent(id:) GraphQL . The command returns whichever query finds the event, or throws if no event is found, similarly to observe:session.

Test Plan

  • New unit tests added
  • Testing on a real app in production

Stack created with GitHub Stacks CLIGive Feedback 💬

@linear-code

linear-code Bot commented Aug 21, 2026

Copy link
Copy Markdown

ENG-26000

@douglowder
douglowder requested a review from kadikraman August 21, 2026 22:44
@douglowder
douglowder force-pushed the doug/eng-26000-cli-fetch-a-single-observe-event-by-id-via-the-eas-cli branch from 5a60109 to a75a15a Compare August 21, 2026 23:03
@codecov

codecov Bot commented Aug 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.83333% with 29 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.27%. Comparing base (3f74ea3) to head (d7e881d).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
packages/eas-cli/src/observe/formatCustomEvents.ts 50.00% 11 Missing ⚠️
packages/eas-cli/src/observe/formatEvents.ts 53.34% 7 Missing ⚠️
...ckages/eas-cli/src/graphql/queries/ObserveQuery.ts 0.00% 6 Missing ⚠️
packages/eas-cli/src/commands/observe/event.ts 93.06% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4252      +/-   ##
==========================================
+ Coverage   64.05%   64.27%   +0.22%     
==========================================
  Files        1043     1047       +4     
  Lines       48017    48391     +374     
  Branches    10133    10214      +81     
==========================================
+ Hits        30753    31098     +345     
- Misses      17148    17177      +29     
  Partials      116      116              

☔ 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.

@douglowder
douglowder force-pushed the doug/eng-26000-cli-fetch-a-single-observe-event-by-id-via-the-eas-cli branch 2 times, most recently from c49a2f5 to 2b5c8c9 Compare August 24, 2026 20:10
Comment thread packages/eas-cli/src/graphql/queries/ObserveQuery.ts
@douglowder
douglowder requested a review from kadikraman August 24, 2026 21:33
Comment thread packages/eas-cli/src/commands/observe/event.ts Outdated
@douglowder
douglowder force-pushed the doug/eng-26000-cli-fetch-a-single-observe-event-by-id-via-the-eas-cli branch from 3add66d to 814ab4f Compare August 25, 2026 02:03
@douglowder
douglowder requested a review from kadikraman August 25, 2026 02:28
douglowder and others added 4 commits August 26, 2026 14:24
Add `eas observe:event <ID>` to display one Observe event (metric or log) by
its ID, using the new AppObserve.event and AppObserve.customEvent GraphQL
fields. The command looks up both in one request and renders whichever
resolves; a non-existent ID errors with a not-found message.

Regenerate GraphQL from the server for the new fields, add ObserveQuery.
eventByIdAsync, extract single-event JSON mappers, and add detail formatters.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
When the server returns an error (rather than null) for an unknown or
malformed event ID, observe:event surfaced an opaque "unexpected server
error" with a request ID. Wrap the lookup so plan-gate rejections still pass
through, and translate other server errors into an actionable message that
names the ID and preserves the underlying error and request ID for support.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…vent types

A custom (log) event ID is a UUID and a metric event ID is base64url-encoded
JSON, so querying both fields meant one always failed — and an unknown ID
surfaced as an opaque "unexpected server error". Classify the ID: a UUID uses
the custom-event query, a base64url value uses the metric-event query, and
anything else errors immediately as an invalid event ID. Split the combined
GraphQL lookup into two single-field queries accordingly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@douglowder
douglowder force-pushed the doug/eng-26000-cli-fetch-a-single-observe-event-by-id-via-the-eas-cli branch from 763552c to d7e881d Compare August 26, 2026 21:24
@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