You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: support numeric project IDs in project slug resolution (#284)
## Summary
- Fixes **CLI-7W**: Users passing a numeric Sentry project ID (e.g.,
`sentry event view 7275560680 <event-id>`) got a confusing "Project not
found" error
- Also resolves **CLI-80** as already fixed by PR #279 (cursor format
validation)
## Changes
**`findProjectsBySlug` (api-client.ts):** When the input is all-digits,
accept the API result even when the returned slug differs from the
input. The Sentry API's `project_id_or_slug` parameter already resolves
numeric IDs — the CLI just wasn't accepting those results.
**`resolveProjectBySlug` (resolve-target.ts):**
- When a numeric ID resolves successfully, prints a stderr hint: `Tip:
Resolved project ID 7275560680 to acme/frontend. Use the slug form for
faster lookups.`
- When resolution fails with an all-digit input, the error message says
"Numeric project IDs are not supported" instead of the generic "Check
that you have access"
**View commands:** Pass `this.stderr` to `resolveProjectBySlug` so the
hint can be displayed.
## Testing
- 2 new tests for `findProjectsBySlug`: numeric ID resolution accepted,
non-numeric slug mismatch still rejected
- 1 updated test for `project view` func (new `stderr` parameter)
- All 2010 tests pass
0 commit comments