Add FieldParameterDef metadata to SourceAnalyzer trait
What does this MR do and why?
This is MR 1 of 5 for parameterised field syntax.
Analytics dimensions and metrics that accept backend parameters (granularity on time fields, quantile on duration metrics) currently use hardcoded values in the compiler. Before users can control these values through GLQL syntax, the compiler needs to know what parameters each field accepts, what values are valid, and what the default is.
This MR introduces that metadata layer. Each analytics source analyzer can now declare its parameterised fields with typed constraints and defaults, which later MRs will use for parsing, validation, and codegen. No existing behaviour changes -- the hardcoded values remain untouched until MR 4.
Only the two existing analytics sources are covered (Pipelines and CodeSuggestions). The other four engines (AiUsageEvents, AgentPlatformSessions, Contributions, Deployments) don't exist in the compiler yet; their metadata will be added when those sources are implemented. Standard mode sources are unaffected.
The slice-based return type (&[FieldParameterDef]) is deliberate: the length determines whether a field accepts positional syntax (single parameter) or requires named syntax (multiple parameters), which the resolution logic in MR 3 will use.
End-to-end tests (compiling parameterised syntax and verifying generated GraphQL) are not possible until the parser (MR 2) and resolution logic (MR 3) land. This MR covers unit tests for the metadata methods only.
References
- Parent issue: #130 (closed)
- Design resolution: comment
- Positional/named design: comment
How to set up and validate locally
cargo test-- all 707 tests should pass with no warningscargo clippy-- should be clean- Review the
field_parameters()implementations against the parameter tables in the work item