Skip to content

feat(issue): add sentry issue events command (#632)#654

Merged
BYK merged 5 commits intomainfrom
feat/issue-events-command
Apr 4, 2026
Merged

feat(issue): add sentry issue events command (#632)#654
BYK merged 5 commits intomainfrom
feat/issue-events-command

Conversation

@BYK
Copy link
Copy Markdown
Member

@BYK BYK commented Apr 4, 2026

Summary

Add sentry issue events <issue> subcommand to list events for a specific Sentry issue. This was the most requested unknown command in CLI telemetry (~20 events from users trying sentry issue events <issue-id>).

Closes #632

Changes

  • Types: IssueEvent type + IssueEventSchema in src/types/sentry.ts — lightweight type matching the list endpoint response (not the full SentryEvent)
  • API: listIssueEvents() in src/lib/api/events.ts — uses @sentry/api's listAnIssue_sEvents with auto-pagination when limit > 100
  • Command: src/commands/issue/events.ts — built with buildListCommand, standard cursor-stack pagination, table output
  • Route: Registered in src/commands/issue/index.ts
  • Tests: 16 unit tests in test/commands/issue/events.func.test.ts
  • Skill: Regenerated SKILL.md

Flags

Flag Alias Default Description
--limit -n 25 Number of events (1-1000)
--query -q Sentry search syntax
--full false Include full event body (stacktraces)
--period -t "7d" Time period (e.g., "1h", "24h", "7d")
--cursor -c Pagination: next, prev, first
--fresh -f false Bypass cache

Table Output

Events for CLI-G5:

  EVENT ID       TIMESTAMP   TITLE                          PLATFORM     USER
  abcdef123456   5m ago      TypeError: Cannot read...      javascript   user@example.com
  123456abcdef   2h ago      ReferenceError: x is not...    python       bob

Note on time range filtering

The API supports start/end (absolute ISO-8601) in addition to statsPeriod (relative). A user requested date/time window filtering in the issue comments. --period is included since it's standard across 6 existing commands. --start/--end is deferred as a cross-cutting feature (no CLI command has it today).

…issue (#632)

Add a new subcommand `sentry issue events <issue>` that lists events
belonging to a specific Sentry issue. This was the most requested
unknown command in CLI telemetry.

- Add IssueEvent type and IssueEventSchema for the list endpoint response
- Add listIssueEvents() API function with auto-pagination support
- Create events command with table output (EVENT ID, TIMESTAMP, TITLE,
  PLATFORM, USER) and standard JSON envelope
- Support all issue ID formats (@latest, short IDs, numeric, org/ID)
- Include --limit, --query, --full, --period, --cursor, --fresh flags
- Bidirectional pagination via cursor-stack infrastructure
- 16 unit tests covering JSON/human output, pagination, and edge cases
- Regenerate SKILL.md with new command documentation
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 4, 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 ✨

Bug Fixes 🐛

  • (errors) Separate informational notes from actionable alternatives in ContextError by BYK in #651
  • Fix set-commits --auto, document release workflow pitfalls by BYK in #650

Internal Changes 🔧

  • Regenerate skill files and command docs by github-actions[bot] in eb1b19e7

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 4, 2026

PR Preview Action v1.8.1

QR code for preview link

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

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

The drift detection test requires all commands with org-positional
parameters to be registered in the completion set.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 4, 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 82.94%. Project has 1433 uncovered lines.
❌ Project coverage is 95.5%. Comparing base (base) to head (head).

Files with missing lines (1)
File Patch % Lines
src/lib/api/events.ts 0.00% ⚠️ 51 Missing
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
- Coverage    95.62%    95.50%    -0.12%
==========================================
  Files          219       220        +1
  Lines        31570     31870      +300
  Branches         0         0         —
==========================================
+ Hits         30189     30437      +248
- Misses        1381      1433       +52
- Partials         0         0         —

Generated by Codecov Action

@BYK BYK marked this pull request as ready for review April 4, 2026 10:16
…ueEvents

When the API returns more events than the requested limit, the function
now returns without nextCursor to prevent cursor-position skips. This
matches the pattern in listIssuesAllPages.
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 01ce094. Configure here.

The issue events API has no per-page limit parameter, so the server
may return more events than requested. Preserve nextCursor so the
command-level cursor stack can navigate to subsequent API pages.
@BYK BYK merged commit d5806b4 into main Apr 4, 2026
27 checks passed
@BYK BYK deleted the feat/issue-events-command branch April 4, 2026 11:39
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