Migrate fields parser and transformers module from Javascript to Rust
-
Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA. As a benefit of being a GitLab Community Contributor, you receive complimentary access to GitLab Duo.
What does this MR do and why?
This merge request implements the migration of fields parser and transformers in the GLQL Rust implementation. The changes include:
-
Fields Parser Migration:
- Implemented a robust parser for field names and field lists using
nom
parser combinator - Added support for field transformers through function syntax (e.g.
labels("workflow::*")
) - Enhanced error handling for invalid field formats and missing fields
- Added comprehensive test coverage for field parsing scenarios
- Implemented a robust parser for field names and field lists using
-
Field Transformers:
- Implemented field transformation logic for various field types (string, number, date, boolean)
- Added support for field aliasing and field type validation
- Implemented field function transformers (e.g. label pattern matching)
- Added context-aware field transformation based on source type (Issues/MRs)
Related to #27 (closed)
The changes can be validated by:
- Running the test suite which includes new test cases for field parsing and transformation
- Testing complex queries with field transformers
- Verifying error messages for invalid field usage
- Checking integration with both Issues and Merge Requests queries
Edited by Himanshu Kapoor