fix(explore): Translate --environment to query for non-replays - #1442
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
looks good. verified locally: all 38 explore tests pass and lint is clean (the CI-ish failures i first hit were just a missing generated api-schema.json, unrelated to this change).
the translation mirrors the existing --project → project: handling, filters empty parts, and collapses to undefined correctly. logic is sound.
one non-blocking note: environment values with spaces won't be quoted (env:my env would split the query), but envs rarely contain spaces and this matches how buildProjectQuery treats projects, so fine to leave as-is.
|
Jared, let's implement that quoting gap you identified and also address BugBot's finding, push those changes to the PR and then merge. |
1 similar comment
|
Jared, let's implement that quoting gap you identified and also address BugBot's finding, push those changes to the PR and then merge. |
|
fixes pushed: multi-env now uses |
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.
Reviewed by Cursor Bugbot for commit 5278a36. Configure here.
|
fix-ci: attempt 1 — the multi-env change pushed |
|
Jared, revert all your unrelated changes: |
|
Jared, |
e64f466 to
d3524c3
Compare

Previously, the
sentry explorecommand's--environmentflag was only supported for thereplaysdataset. When used with other datasets (e.g.,errors,spans,logs), it would incorrectly throw aValidationError, instructing users to manually addenvironment:...to their--querystring.This change modifies
resolveDatasetConfiginpackages/cli/src/commands/explore.tsto automatically translate--environmentflag values intoenvironment:<value>query terms for non-replay datasets. These terms are now prepended to the existing--querystring, aligning the behavior with how the--projectflag is handled and improving the user experience.Additionally, this PR addresses:
lint/style/noNestedTernary) by refactoring the query string construction.test/commands/explore.test.ts) that expected aValidationError. The test is updated to verify the correct translation of--environmentinto the query string and ensures thequeryEventsSpymock returns data in the expected format to prevent runtime errors.Fixes CLI-1QX
This PR was automatically generated by Sentry. You can adjust this setting at any time.