-
-
Notifications
You must be signed in to change notification settings - Fork 5
feat: add sentry issue events command to list events for an issue #632
Copy link
Copy link
Open
Description
Summary
Add an events subcommand to sentry issue to list events for a specific issue. This is the most requested unknown command in CLI-Q3 telemetry (~20 events from users trying sentry issue events <issue-id>).
Implementation Details
API Endpoint
GET /api/0/organizations/{org}/issues/{issue_id}/events/
New API Function
Add listIssueEvents to src/lib/api/events.ts:
- Paginated response using
apiRequestToRegion+parseLinkHeader - Return type:
PaginatedResponse<SentryEvent[]> - Accept org slug, issue ID, and standard pagination options (perPage, cursor)
- The
SentryEventtype already exists insrc/types/sentry.ts
New Command
Create src/commands/issue/events.ts:
- Register as
eventsinsrc/commands/issue/index.tsroute map - Accept the same issue ID positional as
issue view(reuseissueIdPositionalfrom./utils.ts) - Support
--limit,--cursor(next/prev),--json,--fieldsflags - Follow the cursor-stack pagination pattern (
resolveCursor,advancePaginationState,hasPreviousPage,paginationHint) - Use
PAGINATION_KEY = "issue-events-list"
Human Output
- Table format showing: event ID, timestamp, message/title, platform, tags
- Reuse formatting helpers from
src/lib/formatters/(e.g.,formatEventDetailsfor individual events) - Include pagination navigation hints
JSON Output
- Standard list envelope with
nextCursorandhasPrev - Each event as a
SentryEventobject
References
- List command pattern:
src/commands/trace/list.ts,src/commands/span/list.ts - Issue resolution:
src/commands/issue/utils.ts(resolveIssue) - Event types:
src/types/sentry.ts(SentryEvent) - Pagination:
src/lib/db/pagination.ts,src/lib/list-command.ts
Context
A temporary synonym suggestion for issue/events → sentry issue view exists in src/lib/command-suggestions.ts. Remove that entry once this command is implemented.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Fields
Give feedbackNo fields configured for issues without a type.