Conversation
There was a problem hiding this comment.
Pull request overview
Adds HTTPQL request header filtering so queries can match on header name/value, including a shorthand bracket form that expands to an AND between header-name equality and header-value filtering.
Changes:
- Extend Rust + JS grammars/parsers to support
req.header.name|value.<stringExpr>andreq.header["<Name>"].<stringExpr>. - Add request header primitives + serialization support in both Rust and JS implementations.
- Add AST golden tests for the explicit and shorthand header syntaxes.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/httpql/ast/20/input.httpql | New golden input covering explicit req.header.name + req.header.value filtering. |
| tests/httpql/ast/20/output.ast | Expected canonical AST string for explicit header filtering. |
| tests/httpql/ast/21/input.httpql | New golden input covering shorthand req.header["..."] syntax. |
| tests/httpql/ast/21/output.ast | Expected canonical AST string for shorthand syntax (expanded to AND). |
| rust/httpql/src/primitives.rs | Adds request header clause primitive and display formatting (`req.header.name |
| rust/httpql/src/parser.rs | Parses header filtering, including shorthand expansion into an and Query. |
| rust/httpql/src/lib.rs | Adds Rust golden test cases 20 and 21. |
| rust/httpql/httpql.pest | Extends Pest grammar with header field/subfields and bracket syntax. |
| js/httpql/src/primitives.ts | Adds ClauseRequestHeader to the JS AST types. |
| js/httpql/src/serialize.ts | Serializes request header name/value filters. |
| js/httpql/src/deserialize/clause.ts | Adjusts request clause deserialization to return a full Query (needed for shorthand AND expansion). |
| js/httpql/src/deserialize/clause.request.ts | Implements header long-form and shorthand parsing (shorthand expands to AND). |
| js/httpql/httpql.grammar | Extends Lezer grammar with header field/subfields and bracket syntax. |
| js/httpql/src/parser/parser.ts | Regenerated Lezer parser output to reflect grammar changes. |
| js/httpql/src/parser/parser.terms.ts | Regenerated term IDs/names to include new header/bracket tokens. |
| js/httpql/src/index.spec.ts | Adds JS golden test cases 20 and 21. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.