feat(event): add 'sentry event list' command for issue-scoped event listing#671
feat(event): add 'sentry event list' command for issue-scoped event listing#671
Conversation
…isting (#632) Add a top-level 'event list' command that lists events for a Sentry issue, equivalent to 'issue events' but living in the event route. The 'sentry events' plural alias now points to this list command (Pattern A). Changes: - Extract shared types, formatters, and flag defs into event/shared-events.ts - Create event/list.ts with its own command identity (pagination hints, pagination key, and error messages say 'sentry event list') - Make buildCommandHint and resolveIssue accept optional commandBase param - Update event route to include list alongside view - Switch events plural alias from eventRoute to eventListCommand - Remove stale event/list synonym from command-suggestions.ts - Add 6 func tests verifying output, pagination hints, and command identity
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Bug Fixes 🐛Init
Other
Internal Changes 🔧Init
Other
Other
🤖 This preview updates automatically when you update the PR. |
|
…_MIN_LIMIT/LIST_DEFAULT_LIMIT Every list command duplicated MAX_LIMIT (1000), MIN_LIMIT (1), and DEFAULT_LIMIT (varying 20-100) locally. Move them to list-command.ts as LIST_MAX_LIMIT, LIST_MIN_LIMIT, and LIST_DEFAULT_LIMIT (standardized to 25). - trace list default: 20 → 25 - trace logs default: 100 → 25 - log list default: 100 → 25 - buildListLimitFlag default: 30 → 25 - issue list: remove redundant explicit "25" (now the default)
- Add 'event list' to ORG_PROJECT_COMMANDS (uses issue positional) - Update command-suggestions test: event/list is now a real command, no longer a synonym suggesting issue view
Codecov Results 📊✅ 134 passed | Total: 134 | Pass Rate: 100% | Execution Time: 0ms 📊 Comparison with Base Branch
✨ No test changes detected All tests are passing successfully. ✅ Patch coverage is 100.00%. Project has 1423 uncovered lines. Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 95.56% 95.57% +0.01%
==========================================
Files 220 222 +2
Lines 32011 32110 +99
Branches 0 0 —
==========================================
+ Hits 30588 30687 +99
- Misses 1423 1423 —
- Partials 0 0 —Generated by Codecov Action |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 5c011bd. Configure here.
…mmand When a user types 'sentry events view', the plural alias routes to eventListCommand and interceptSubcommand replaces 'view' with undefined (after printing a redirect tip). Without this guard, resolveIssue would crash on the undefined value. Now we bail out early since the tip message already guides the user to the correct command.
Log commands (log list, trace logs) benefit from larger result sets since logs are high-volume and users need more context when debugging. Keep LIST_DEFAULT_LIMIT=25 as the standard but override to 100 for log-specific commands.
resolveNumericIssue hardcoded 'sentry issue' in its 404 error hints. Now accepts commandBase param (default: 'sentry issue') so that 'sentry event list 999' shows 'sentry event list <org>/999' in errors instead of 'sentry issue list <org>/999'.

Summary
Adds
sentry event list <issue-id>as a top-level command for listing events belonging to a Sentry issue. This is functionally equivalent tosentry issue eventsbut lives in theeventroute with its own command identity.The
sentry eventsplural alias now uses Pattern A (points to the list command directly), matching howsentry issues→issue list,sentry traces→trace list, etc.Changes
src/commands/event/shared-events.ts(new) — Shared types, constants, formatters, table columns, and flag definitions extracted fromissue/events.tssrc/commands/event/list.ts(new) — Theevent listcommand with correct command identity (pagination hints, error messages)src/commands/issue/events.ts— Refactored to import shared parts (no behavior change)src/commands/issue/utils.ts—buildCommandHintandresolveIssueaccept optionalcommandBaseparametersrc/commands/event/index.ts— Addedlistroute alongsideviewsrc/app.ts— Changedeventsalias fromeventRoute(Pattern B) toeventListCommand(Pattern A)src/lib/command-suggestions.ts— Removedevent/listsynonym (now a real command)Usage
Follow-up: org-scoped event listing
This PR covers issue-scoped event listing only. A follow-up issue will track expanding
event listto support org-scoped queries via the Discover/Events API (/organizations/{org}/events/), enabling patterns likesentry event list <org>/ --dataset errors.Closes #632