[eas-cli] Support drill-down from event lists in observe:session#3987
Draft
douglowder wants to merge 2 commits into
Draft
[eas-cli] Support drill-down from event lists in observe:session#3987douglowder wants to merge 2 commits into
douglowder wants to merge 2 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3987 +/- ##
==========================================
+ Coverage 59.43% 59.53% +0.10%
==========================================
Files 937 937
Lines 41286 41385 +99
Branches 8698 8732 +34
==========================================
+ Hits 24536 24634 +98
- Misses 16656 16657 +1
Partials 94 94 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
8c2e4bc to
554d347
Compare
Make the sessionId positional arg optional. When it's omitted and the command is running interactively, walk the user through picking an event whose session they want to inspect. Non-interactive without a session ID still errors as before. New flags on observe:session: - --event-name: metric alias/full-name or custom log event name. When it names a known metric (via isKnownMetricName from metricNames.ts) the picker queries fetchObserveEventsAsync; otherwise it queries fetchObserveCustomEventsAsync. - --sort: reuses EventsOrderPreset (fastest/slowest/newest/oldest) from observe/fetchEvents.ts. If omitted in interactive mode the user is prompted; the choice list adapts to the event kind (fastest/slowest are metric-only). - --days/--start/--end via ObserveTimeRangeFlags for the candidate window (default 60 days). Interactive picker flow when no session ID is given: 1. Event-name prompt (skipped if --event-name is passed). Options merge METRIC_SHORT_NAMES with ObserveQuery.customEventNamesAsync results, labelled per kind and with per-name counts for log events. 2. Sort-order prompt (skipped if --sort is passed). Log events see only newest/oldest. 3. Candidate-event prompt over the first 25 events fetched with that sort/window. Candidates without a sessionId are filtered out. On selection, the sessionId feeds the existing single-session timeline. Combining picker flags with a positional sessionId is now an explicit error since they describe how to find a session, not how to display one. The existing single-session path is unchanged. Also adds isKnownMetricName to observe/metricNames.ts — a non-throwing predicate over METRIC_ALIASES, NAVIGATION_METRIC_ALIASES, and their full name sets, used by the picker to route to metric- vs log-event fetchers without a try/catch around resolveMetricName. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
554d347 to
432128c
Compare
|
✅ Thank you for adding the changelog entry! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Why
When session ID is omitted and the
observe:sessioncommand is running interactively, walk the user through picking an event whose session they want to inspect. Non-interactive without a session ID still errors as before.The goal is to support a flow similar to that already available on our website, where a user can select an event from a displayed list, and navigate to the session timeline that contains that event.
How
Add new flags
--event-nameand--sort-order. If these are not provided, user will be prompted first to select from a list of event names (including custom events, if applicable), then select a sort order. The command also now takes the same time period flags as the other commands (--days,--start,--end).Once the user has made the above selections, the user can choose from the list of events shown (up to 25), and the session for that event will be shown.
Test Plan