Skip to content

ref(toolkit-core): Use the published @sentry/search-syntax package - #1689

Merged
BYK merged 1 commit into
mainfrom
feat/use-sentry-search-syntax-package
Oct 27, 2026
Merged

BYK merged 1 commit into
mainfrom
feat/use-sentry-search-syntax-package

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

@sentry/search-syntax@1.0.0 is now on npm, published from getsentry/sentry static/packages/search-syntax (getsentry/sentry#128514). This drops toolkit's vendored copy of the grammar and parser and uses the package instead, so the CLI, MCP and the Sentry frontend all run one grammar.

What changes

  • Deletes packages/toolkit-core/grammar/, the committed compiled parser in src/generated/, src/search-syntax.ts (the structural TokenConverter), its tests, and the copied test/fixtures/search-syntax cases. The package's parser.spec.ts is the port of those tests and runs the shared fixtures in getsentry/sentry.
  • toolkit-core/src/search-query.ts and MCP's search-events/utils.ts import parseSearch and the token types from @sentry/search-syntax/parser, and Token / TermOperator / FilterType from @sentry/search-syntax/tokens. The @sentry/toolkit-core/search-syntax export is removed; those two files were its only users.
  • Adds @sentry/search-syntax to the pnpm catalog (^1.0.0) as a dependency of toolkit-core and mcp-core. 1.0.0 is in minimumReleaseAgeExclude because it was published today, like the other first-party @sentry/* entries.
  • Removes the root generate:parsers script, its pre-commit task, the check:generated path for toolkit-core/src/generated, and the oxlint/oxfmt ignores for the deleted files. The CLI still compiles its own org-project-target grammar with scripts/generate-parsers.mjs.
  • Updates the toolkit-core README and two test comments that pointed at the deleted tests.

The package's API matches what toolkit had: the parser was ported from toolkit-core, with the #1534 size-filter fix. One type-level difference is that the token constants are TS enums instead of as const objects. Their runtime string values are unchanged.

Checks (local)

  • toolkit-core: 142 tests pass, tsc clean
  • mcp-core: 1877 tests pass; tsc only reports the existing @sentry/mcp-server-mocks resolution errors from the unbuilt mocks package
  • mcp-core and mcp-server tsdown builds pass, and both ESM and CJS outputs of mcp-server bundle the package
  • CLI: 1041 tests across search-query, issue, log, span, trace, replay, event and errors pass. explore.test.ts can't load here because sdk.generated.js doesn't build in this sandbox, so CI is the real check for it.
  • A CJS esbuild bundle of search-query.ts, which is how the CLI builds, resolves the package and rewrites level:error OR level:warning to level:[error,warning]
  • pnpm install --frozen-lockfile, check:generated, oxlint and oxfmt pass

Refs #1533

via @BYK.

--

View Junior Session [Sentry]

Replace the vendored copy of Sentry's search grammar, its compiled parser,
the structural TokenConverter, and the copied search-syntax fixtures with
@sentry/search-syntax 1.0.0, published from getsentry/sentry
static/packages/search-syntax (getsentry/sentry#128514).

toolkit-core's search-query and MCP's search-events utils import the parser
and token enums from the package directly, and the toolkit-core
./search-syntax export is removed. The grammar's tests, including the shared
fixtures/search-syntax cases, now live with the package.

The root generate:parsers script, its pre-commit task, its check:generated
path, and the oxlint/oxfmt ignores for the deleted files are removed. The
CLI still compiles its own org-project-target grammar with
scripts/generate-parsers.mjs.

Refs #1533

Co-Authored-By: Burak Yigit Kaya <126780+BYK@users.noreply.github.com>
@vercel

vercel Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
sentry-local Ready Ready Preview Oct 27, 2026 11:13pm UTC

Request Review

@BYK
BYK enabled auto-merge (squash) October 27, 2026 23:17
@BYK
BYK merged commit 7f0b810 into main Oct 27, 2026
43 checks passed
@BYK
BYK deleted the feat/use-sentry-search-syntax-package branch October 27, 2026 23:25

This branch was successfully deployed

2 active deployments
Preview — c269a80b Deployed Oct 27, 2026 by vercel[bot]
Actions — c269a80b Deployed Oct 27, 2026 by sentry-junior[bot] via eval #1387
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant