GLQL: Expose field, type, and parameters in REST API entity
Summary
API::Entities::Glql::Field currently only exposes key, label, and name. The GLQL compiler now emits additional properties that API consumers need:
field: the base field name, distinct fromkeyfor aliased parameterised fields (e.g.key: "p50",field: "durationQuantile")type:"dimension"or"metric", used by the frontend fordimensionsOf/metricsOffilteringparameters: resolved parameter metadata (e.g.{ granularity: "weekly" },{ quantile: 0.5 })
These properties are present in the compile output but silently dropped by the Grape entity whitelist.
What needs to change
- Add
expose :field,expose :type, andexpose :parameterstolib/api/entities/glql/field.rbwith appropriate documentation - Update
spec/lib/api/entities/glql/field_spec.rbwith test coverage for the new properties - Update
doc/api/glql.mdresponse attributes table to documentfields[].field,fields[].type, andfields[].parameters - Update the
gitlab_query_languagegem version to the release that includes glql!412 (closed)
Blocked on
- GLQL release including glql!412 (closed) (the
fieldproperty) - The gem version bump depends on that release being cut
Related: !241834 (merged), glql#130 (closed), glql#153 (closed)