Repository navigation
fix(schema): report no-match searches instead of dumping the full list - #1466
Conversation
`sentry schema <term>` for a term that matched no resource threw an OutputError carrying the entire resource summary list, which rendered byte-identical to a successful `sentry schema` browse — no signal that the term matched nothing. Replace those not-found branches with a ResolutionError (exit 23) that states the resource does not exist, offers a fuzzy "did you mean" suggestion, and points at `sentry schema` / `--search` to recover. The "known resource, unknown operation" branch still shows that resource's endpoints (scoped, not misleading). Fixes #1424
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
fix-ci: attempt 1 — the Unit Tests job failed but all 9324 tests passed; the failure is 2 vitest worker-teardown races ( |
|
CI is green (re-run passed after a flaky vitest teardown race in an unrelated test file) and self-review is clean — marking ready for review. sergical, this should address the misleading full-list output on |
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.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 013f9fe. Configure here.
When no fuzzy match exists, the 'Try:' line now always shows the bare `sentry schema` command instead of prose. The descriptive 'Browse all resources' text stays in the 'Or:' suggestions only. Fixes the bugbot report that agents copying the hint would hit the same no-match path.
BYK
left a comment
There was a problem hiding this comment.
Looks good Jared, merge at will once we have green CI and no Seer/BugBot comments left

Summary
sentry schema committers(a term that matches no resource) printed thefull 79-line resource table — byte-identical to a garbage term and to a
successful
sentry schemabrowse — giving no signal the term matchednothing. This actively misled agents using
sentry schema <resource>forendpoint discovery.
Root cause
In
resolveResourceQuery(packages/cli/src/commands/schema.ts), every"not found" branch threw
OutputErrorcarryinggetResourceSummaries()—the entire resource list.
OutputErrorrenders its data to stdout throughthe normal output system, so a no-match looked exactly like a full browse.
Fix
ResolutionError(exit 23) with a clear "Resource "" does not exist in the schema"
message, a fuzzy "did you mean" suggestion (e.g.
committers→commits),and
sentry schema/--searchrecovery hints.still shows that resource's endpoints (scoped to the resource, not the full
list, so it isn't misleading).
resolveResourceQueryand addedtest/commands/schema.test.tscovering: known resource, no-match (ResolutionError not OutputError),
typo suggestion, garbage term, unknown-operation, valid operation, glob
match, glob no-match.
Testing
vitest run test/commands/schema.test.ts— 8 passedvitest run test/lib/api-schema.test.ts— 19 passed (unchanged)tsc --noEmit— no new errors in touched filesbiome check— clean on touched filesCloses #1424