Repository navigation
feat(cli): Support magic selectors in event view, defaulting to @latest - #1793
Merged
Merged
Conversation
…ject without event ID
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
`sentry event view` now takes the issue selectors `@latest` and `@most_frequent` (also as `<org>/@sel`, `<org>/<project>/@sel`, or after a separate target) and shows the selected issue's latest event. Without an event ID it defaults to `@latest`, so `sentry event view`, `sentry event view <org>/`, and `sentry event view <org>/<project>` all work instead of failing with "Event ID is required". Project-scoped selectors pick the project by numeric ID, so projects that are not actively selected still match (#1317). This replaces the errors-dataset lookup for `<org>/<project>`, which is no longer needed. Co-Authored-By: BYK <[email protected]> Co-Authored-By: Claude <[email protected]>
BYK
requested changes
Nov 2, 2026
Describe `@latest` and `@most_frequent` once in `ISSUE_SELECTORS`, next to the selector parser, and render the help lines of `event view`, `event list`, and the issue commands from it. Shell completion now suggests the selectors for a word that starts one, bare or after `org/`, in every issue argument. `event view` completes as an issue argument, so it also suggests cached issue short IDs. Co-Authored-By: BYK <[email protected]> Co-Authored-By: Claude <[email protected]>
BYK
approved these changes
Nov 2, 2026
This branch was previously deployed
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.
sentry event viewwithout an event ID used to fail withContextError: Event ID is required. AI agents hit this a lot. Nowevent viewaccepts the issue selectors the other commands already take, and with no event ID it falls back to@latest.@latestand@most_frequent(and the existing aliases such as@most-frequent) show the selected issue's latest event.issue view @latestuses),<org>/@sel,<org>/<project>/@sel, or a bare selector before or after a separate target (my-org/my-project @latest).@latest:sentry event view,sentry event view <org>/, andsentry event view <org>/<project>all work.<org>/<project>/(an empty ID typed after the slash) and""still raise the missing-event-ID error.ValidationError.Project-scoped selectors go through a new
findSelectorIssuehelper inissue/utils.ts, whichresolveSelectornow uses too. It picks the project by numeric ID (resolveProjectIdsInOrg), so projects that are not actively selected still match (#1317).The selectors are now described once, in
ISSUE_SELECTORSnext toparseSelector.issueSelectorHelp()renders the--helplines forevent view,event list, and the issue commands from it, and their existing help text is unchanged. Shell completion now suggests the selectors for a word that starts with@, bare or afterorg/, in every issue argument.event viewnow completes as an issue argument, so it also suggests cached issue short IDs.This PR first added a separate
errors-dataset lookup for<org>/<project>. That lookup is gone, along with theprojectparam it added toexplore.ts. One behavior difference: the old lookup returned the project's newest error event of any kind, while@latestreturns the latest event of the most recently seen unresolved issue. That matches what@latestmeans everywhere else.When no target is given, the selector searches the auto-detected org (the same scope
issue view @latestuses). It is not narrowed to a DSN-detected project. If a project-scoped default would be better there, that's a small follow-up.Fixes CLI-CG
--
View Session in Sentry