Conversation
…s for event view Migrate event view command from --org/--project flags to use the <org>/<project> positional argument syntax for consistency with other commands like issue list and project list. Changes: - event view now uses: sentry event view [<org>/<project>] <event-id> - Updated error messages and hints to use positional syntax - Updated documentation (CONTRIBUTING.md, issue.md, features.md) - Added unit tests for parsePositionalArgs - Regenerated SKILL.md
Contributor
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. Internal Changes 🔧
Other
🤖 This preview updates automatically when you update the PR. |
Contributor
|
Contributor
Codecov Results 📊❌ Patch coverage is 33.33%. Project has 2018 uncovered lines. Files with missing lines (40)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
- Coverage 77.99% 75.64% -2.35%
==========================================
Files 58 65 +7
Lines 7933 8285 +352
Branches 0 0 —
==========================================
+ Hits 6187 6267 +80
- Misses 1746 2018 +272
- Partials 0 0 —Generated by Codecov Action |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
- Fix foundProject.organization?.slug bug (use orgSlug instead) - Make formatMultipleProjectsFooter generic (not hardcoded to issue list) - Fix ContextError misuse producing garbled messages: - Use ValidationError for 'multiple orgs' error - Use ValidationError for 'invalid target' error - Use noun phrase 'Specific project' for OrgAll case - Update dsn/errors.ts to use generic 'sentry <command>' in hints - Update test expectations to match new messages
BYK
added a commit
that referenced
this pull request
Feb 6, 2026
## Summary Adds unit tests for the `resolveFromProjectSearch` function in `src/commands/event/view.ts` to improve patch coverage. ## Changes **`src/commands/event/view.ts`:** - Export `resolveFromProjectSearch` function for testing - Export `ResolvedEventTarget` type for testing - Add JSDoc documentation for the exported function **`test/commands/event/view.test.ts`:** - Add 8 new tests for `resolveFromProjectSearch`: - **No projects found:** throws `ContextError` with project name and usage hint - **Multiple projects found:** throws `ValidationError` with list of orgs and usage example - **Single project found:** returns resolved target with org/project info - Use `spyOn` to mock `findProjectsBySlug` without complex module mocking ## Testing ```bash bun test test/commands/event/view.test.ts # 18 pass, 0 fail ``` ## Motivation PR #205 had 33% patch coverage, below the 80% threshold. This PR adds tests for the `resolveFromProjectSearch` function which handles the project-search case when users specify just a project slug without an org.
3 tasks
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.
Summary
event viewcommand from--org/--projectflags to<org>/<project>positional argument syntaxMotivation
Ensures consistency with other commands like
issue listandproject listwhich already use positional args. The<org>/<project>syntax is more concise and followsghCLI conventions.Changes
Command updated:
sentry event view [<org>/<project>] <event-id>- now takes optional positional targetError messages updated:
src/lib/dsn/errors.ts- 4 hints updatedsrc/lib/resolve-target.ts- JSDoc and defaultusageHintvalues updatedsrc/lib/dsn/resolver.ts- Error message updatedsrc/commands/project/view.ts- Error message updatedDocumentation updated:
CONTRIBUTING.md- Command patterns documentationdocs/src/content/docs/commands/issue.md- Plan command sectiondocs/src/content/docs/features.md- Examplesplugins/sentry-cli/skills/sentry-cli/SKILL.md- RegeneratedTesting