Skip to content
This repository was archived by the owner on Oct 23, 2026. It is now read-only.

fix(schema): report no-match searches instead of dumping the full list - #1466

Merged
BYK merged 2 commits into
mainfrom
issue-1424-schema-no-match
Aug 25, 2026
Merged

BYK merged 2 commits into
mainfrom
issue-1424-schema-no-match

Conversation

@jared-outpost

@jared-outpost jared-outpost Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

sentry schema committers (a term that matches no resource) printed the
full 79-line resource table — byte-identical to a garbage term and to a
successful sentry schema browse — giving no signal the term matched
nothing. This actively misled agents using sentry schema <resource> for
endpoint discovery.

Root cause

In resolveResourceQuery (packages/cli/src/commands/schema.ts), every
"not found" branch threw OutputError carrying getResourceSummaries() —
the entire resource list. OutputError renders its data to stdout through
the normal output system, so a no-match looked exactly like a full browse.

Fix

  • No-match resource / glob-pattern paths now throw 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 / --search recovery hints.
  • The "valid resource, unknown operation" branch is unchanged in spirit: it
    still shows that resource's endpoints (scoped to the resource, not the full
    list, so it isn't misleading).
  • Exported resolveResourceQuery and added test/commands/schema.test.ts
    covering: 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 passed
  • vitest run test/lib/api-schema.test.ts — 19 passed (unchanged)
  • tsc --noEmit — no new errors in touched files
  • biome check — clean on touched files

Closes #1424

`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
@vercel

vercel Bot commented Aug 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cli Ready Ready Preview Aug 25, 2026 8:19am

Request Review

@jared-outpost

jared-outpost Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

fix-ci: attempt 1 — the Unit Tests job failed but all 9324 tests passed; the failure is 2 vitest worker-teardown races (EnvironmentTeardownError: Closing rpc while "onUserConsoleLog" was pending) originating in test/lib/index.test.ts, unrelated to this schema change. re-running the failed jobs.

@jared-outpost
jared-outpost Bot marked this pull request as ready for review August 25, 2026 08:14
@jared-outpost
jared-outpost Bot requested a review from sergical August 25, 2026 08:14
@jared-outpost

jared-outpost Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

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 sentry schema <nonexistent>.

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

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.

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.

Comment thread packages/cli/src/commands/schema.ts Resolved
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 BYK left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good Jared, merge at will once we have green CI and no Seer/BugBot comments left

@BYK
BYK merged commit 1f46192 into main Aug 25, 2026
32 checks passed
@BYK
BYK deleted the issue-1424-schema-no-match branch August 25, 2026 10:42

This branch was successfully deployed

1 active deployment
Preview — 9670c6ce Deployed Aug 25, 2026 by vercel[bot]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sentry schema <term>: a no-match search prints the full resource list instead of reporting no match

1 participant