Skip to content

feat(issue-list): add search syntax docs, case-insensitive AND/OR, and JSON syntax reference#738

Merged
BYK merged 3 commits intomainfrom
fix/issue-list-query-auto-correct
Apr 13, 2026
Merged

feat(issue-list): add search syntax docs, case-insensitive AND/OR, and JSON syntax reference#738
BYK merged 3 commits intomainfrom
fix/issue-list-query-auto-correct

Conversation

@BYK
Copy link
Copy Markdown
Member

@BYK BYK commented Apr 13, 2026

Summary

Follow-up to PR #727 — three improvements to issue list query handling.

1. Search syntax documentation

  • Added query syntax reference to fullDescription help text: implicit AND, no OR/AND, alternatives, common filters, docs link
  • Updated --query flag brief to mention key constraints upfront
  • Added search examples and syntax caution to docs/src/fragments/commands/issue.md

2. Case-insensitive AND/OR detection

  • Changed token === "OR" to token.toUpperCase() === "OR" to match the PEG grammar's "OR"i / "AND"i rules
  • Added tests for Or, or, And, and variants

3. JSON search syntax reference (easter egg for agents)

  • --json output envelope now includes _searchSyntax with machine-readable query capabilities: supported operators, filter types, common filters, and links to PEG grammar source
  • Only injected into paginated envelope objects, not flat arrays

4. Code references for future work

  • Added JSDoc linking to Sentry's actual parser implementations (PEG grammar, backend tokenizer)
  • Documented equivalence between our regex and split_query_into_tokens
  • Notes on future work: full PEG port via Peggy if needed

Verification

Our tokenizer regex (?:[^\s"]*"[^"]*"[^\s"]*)|[^\s]+ is functionally equivalent to split_query_into_tokens() in src/sentry/search/utils.py for the purpose of detecting standalone boolean operators. Minor differences (single quotes, colon-space joining, escaped quotes) don't affect AND/OR detection.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 13, 2026

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

  • (cli) Add sentry cli defaults command for persistent settings by BYK in #721
  • (docs) Auto-generate driftable documentation sections by BYK in #739
  • (issue-list) Add search syntax docs, case-insensitive AND/OR, and JSON syntax reference by BYK in #738

Bug Fixes 🐛

Init

  • Treat no-op edits as passthrough instead of throwing by betegon in #731
  • Remove JSON minification that breaks edit-based codemods by betegon in #719

Resolve

  • Address review comments and add tests for fuzzy project recovery by BYK in #732
  • Fuzzy auto-recovery for project slug resolution by BYK in #728

Upgrade

  • Detect npm install method from node_modules path by BYK in #723
  • Add shell option on Windows for .cmd package managers by BYK in #722

Other

  • (dashboard) Remove overly restrictive dataset-display cross-validation by BYK in #720
  • (errors) Improve ContextError wording for auto-detect failures by BYK in #726
  • (issue) Support share issue URLs by BYK in #718
  • (issue-list) Auto-correct AND and reject OR in --query to prevent 400 by BYK in #727
  • (telemetry) Rename isClientApiError to isUserApiError and exclude 400 by BYK in #729
  • Bug fixes from Sentry error monitoring (CLI-FR, CLI-RN) + auth default by BYK in #740

Internal Changes 🔧

  • Regenerate skill files by github-actions[bot] in ca16b2ff

🤖 This preview updates automatically when you update the PR.

@BYK BYK force-pushed the fix/issue-list-query-auto-correct branch from 8bc5abf to f1cd984 Compare April 13, 2026 20:44
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 13, 2026

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://cli.sentry.dev/_preview/pr-738/

Built to branch gh-pages at 2026-04-13 21:49 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 13, 2026

Codecov Results 📊

134 passed | Total: 134 | Pass Rate: 100% | Execution Time: 0ms

📊 Comparison with Base Branch

Metric Change
Total Tests
Passed Tests
Failed Tests
Skipped Tests

✨ No test changes detected

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 1632 uncovered lines.
❌ Project coverage is 95.26%. Comparing base (base) to head (head).

Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
- Coverage    95.27%    95.26%    -0.01%
==========================================
  Files          234       234         —
  Lines        34386     34442       +56
  Branches         0         0         —
==========================================
+ Hits         32761     32810       +49
- Misses        1625      1632        +7
- Partials         0         0         —

Generated by Codecov Action

Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

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.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f1cd984. Configure here.

@BYK BYK force-pushed the fix/issue-list-query-auto-correct branch from 3ac2c4d to 56b4b12 Compare April 13, 2026 21:18
BYK added 3 commits April 13, 2026 21:47
…d JSON syntax reference

- Document Sentry search syntax in --query flag help text and
  fullDescription: implicit AND, no OR/AND operators, alternatives
  (in-list key:[val1,val2], wildcards), common filters, docs link

- Make AND/OR detection case-insensitive (token.toUpperCase()) to match
  the PEG grammar's 'OR'i / 'AND'i rules

- Add SEARCH_SYNTAX_REFERENCE object to --json output envelope as
  _searchSyntax field — gives agents machine-readable query capabilities

- Add code references to Sentry's parser implementations:
  - PEG grammar: getsentry/sentry grammar.pegjs (Peggy frontend)
  - Backend tokenizer: search/utils.py split_query_into_tokens
  - Notes on equivalence and future work (full PEG port if needed)

- Add search syntax examples to docs/fragments/commands/issue.md

- Add in-list syntax (key:[val1,val2]) to OR ValidationError alternatives
Address Cursor Bugbot: the old JSDoc that documented the removed
jsonTransformIssueList alias was left orphaned above the new constant.
Avoids bloating every successful --json response with static metadata.
The syntax reference is most useful when a query returned zero results —
likely a syntax issue — so agents and users get help exactly when needed.
@BYK BYK force-pushed the fix/issue-list-query-auto-correct branch from 95b6c03 to 89017a5 Compare April 13, 2026 21:48
@BYK BYK merged commit 1e2da19 into main Apr 13, 2026
26 checks passed
@BYK BYK deleted the fix/issue-list-query-auto-correct branch April 13, 2026 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant