feat(search): add support for saved search terms in grammar#2418
Open
jcscottiii wants to merge 1 commit intomainfrom
Open
feat(search): add support for saved search terms in grammar#2418jcscottiii wants to merge 1 commit intomainfrom
jcscottiii wants to merge 1 commit intomainfrom
Conversation
Updates the ANTLR grammar to support 'saved' terms (e.g., saved:ID) in feature searches. Includes the necessary visitor implementations and tests to parse and handle these new terms. Also updates the search grammar skill documentation to reflect these changes.
f3801cf to
e4b8703
Compare
jrobbins
approved these changes
Apr 15, 2026
neilv-g
reviewed
Apr 15, 2026
| if err == nil { | ||
| t.Fatal("expected error for unexpanded saved search, got nil") | ||
| } | ||
| expectedErr := "unexpected unexpanded search identifier: saved" |
Collaborator
There was a problem hiding this comment.
The smallest of nits and honestly more of a comment/discussion point for future CLs rather than this one.
We use fmt.Errorf already in a ton of places in the codebase, but it would probably be good if over time we moved toward defined error types to avoid string matching on error messages in UTs. I'll try to be aware of this going forward myself, but I thought I would mention it as well.
Collaborator
Author
There was a problem hiding this comment.
Good catch. The rest of the errors in this file use the errors.Is method to check. This one definitely should not be doing something brittle like that. Will update!
neilv-g
approved these changes
Apr 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(search): add
saved:andhotlist:terms to search grammarThis PR updates the search grammar to support
saved:andhotlist:search terms. It implements the necessary parser visitor methods and adds unit tests to verify parsing.These terms are intended to be expanded upstream (e.g., in the backend before SQL generation), so they are currently added as no-ops in the filter builder with documentation noting they are handled upstream.
Additionally, this PR updates the search grammar skill documentation to include guidelines on error handling and query validation, emphasizing that semantic errors should return 400 Bad Request instead of 500.
Changes:
antlr/FeatureSearch.g4: Addedsavedandhotlistterms to the grammar.lib/gcpspanner/searchtypes/: Updated visitor and constants for new terms.lib/gcpspanner/feature_search_query.go: Added stub handling for new terms, noting they are handled upstream.lib/gcpspanner/searchtypes/features_search_parse_test.go: Added unit tests for the new terms..agent/skills/webstatus-search-grammar/SKILL.md: Added error handling guidelines and a note about the ANTLR generation environment.