Skip to content

feat(event): add 'sentry event list' command for issue-scoped event listing#671

Merged
BYK merged 10 commits intomainfrom
feat/event-list
Apr 6, 2026
Merged

feat(event): add 'sentry event list' command for issue-scoped event listing#671
BYK merged 10 commits intomainfrom
feat/event-list

Conversation

@BYK
Copy link
Copy Markdown
Member

@BYK BYK commented Apr 6, 2026

Summary

Adds sentry event list <issue-id> as a top-level command for listing events belonging to a Sentry issue. This is functionally equivalent to sentry issue events but lives in the event route with its own command identity.

The sentry events plural alias now uses Pattern A (points to the list command directly), matching how sentry issuesissue list, sentry tracestrace list, etc.

Changes

  • src/commands/event/shared-events.ts (new) — Shared types, constants, formatters, table columns, and flag definitions extracted from issue/events.ts
  • src/commands/event/list.ts (new) — The event list command 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.tsbuildCommandHint and resolveIssue accept optional commandBase parameter
  • src/commands/event/index.ts — Added list route alongside view
  • src/app.ts — Changed events alias from eventRoute (Pattern B) to eventListCommand (Pattern A)
  • src/lib/command-suggestions.ts — Removed event/list synonym (now a real command)

Usage

sentry event list CLI-G5
sentry event list @latest --limit 50
sentry event list CLI-G5 --full --json
sentry event list CLI-G5 -q "user.email:foo@bar.com"
sentry events CLI-G5          # plural alias → event list

Follow-up: org-scoped event listing

This PR covers issue-scoped event listing only. A follow-up issue will track expanding event list to support org-scoped queries via the Discover/Events API (/organizations/{org}/events/), enabling patterns like sentry event list <org>/ --dataset errors.

Closes #632

…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
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 6, 2026

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

  • (event) Add 'sentry event list' command for issue-scoped event listing by BYK in #671

Bug Fixes 🐛

Init

  • Run commands without shell to eliminate injection surface by betegon in #665
  • Use opendir for listDir and validate symlinks during traversal by betegon in #663
  • Rename 'Custom Metrics' feature label to 'Metrics' by MathurAditya724 in #659
  • Add reactFeatures to feature display info by MathurAditya724 in #658
  • Generate spinner messages from payload params instead of server detail by MathurAditya724 in #655

Other

  • (errors) Separate informational notes from actionable alternatives in ContextError by BYK in #651
  • (skill-gen) Eliminate manual maps to prevent undocumented commands by BYK in #670
  • Three bug fixes from Sentry telemetry (CLI-SC, CLI-QZ, CLI-WD) by cursor in #664
  • Fix set-commits --auto, document release workflow pitfalls by BYK in #650

Internal Changes 🔧

Init

  • Reuse resolveOrg for offline-first org detection by betegon in #666
  • Use mdKvTable and renderMarkdown for wizard summary by betegon in #661

Other

  • Extract createProjectWithDsn to deduplicate project creation by betegon in #667
  • Regenerate skill files and command docs by github-actions[bot] in eb1b19e7

Other

  • Update custom.css by stevenplewis in #653

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 6, 2026

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://cli.sentry.dev/pr-preview/pr-671/

Built to branch gh-pages at 2026-04-06 20:59 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@BYK BYK marked this pull request as ready for review April 6, 2026 20:20
BYK and others added 2 commits April 6, 2026 20:28
…_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
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 6, 2026

Codecov Results 📊

134 passed | Total: 134 | Pass Rate: 100% | Execution Time: 0ms

📊 Comparison with Base Branch

Metric Change
Total Tests
Passed Tests
Failed Tests
Skipped Tests

✨ No test changes detected

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 1423 uncovered lines.
✅ Project coverage is 95.57%. Comparing base (base) to head (head).

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

Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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.
BYK and others added 2 commits April 6, 2026 20:49
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'.
@BYK BYK merged commit ca14e7c into main Apr 6, 2026
27 checks passed
@BYK BYK deleted the feat/event-list branch April 6, 2026 21:10
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.

feat: add sentry issue events command to list events for an issue

1 participant