gitlab_query_language 0.43.0 → 0.44.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ad4338b8efb5395f729de68a438b47ddb0dc4a02ebaa6e787833f798cf30ebe0
4
- data.tar.gz: 55f4f586ca5de8b76cb450eb2294324ef020ce031066f18718ccaa00fd7b86dc
3
+ metadata.gz: f0c3c11c956aacebdab01705ebccca6fde51418766303429f914b43ac0995e03
4
+ data.tar.gz: 1b91cbe2611729aa4fd80036c2b85fd72b33d93f0c424bb8ba60092b6274bccf
5
5
  SHA512:
6
- metadata.gz: 3d10b7ad96e908003f5d52e370b6c4b5f288f8b1313f11a14477e8046c7dffda0e99c48bb354d32716dd055f983884e1c2444707bdd919cf2d1f9c3db05238e7
7
- data.tar.gz: 90cbe2ecf0d344fb2cc0d9aed54cfbf8bc075986efd99e69c50197dca8e8c507b8f374e557d9e65894c00df48641d56c3ca50e9ef8aadb045271742447cd1713
6
+ metadata.gz: e17b27d70307ad638be791cfa789bce680aa8076f56cf3b1540e08ce3ad3d5e46596d8bc2c8041e231b6ccd628568fac93732c4c7b12db4966226d5b1d5aaac5
7
+ data.tar.gz: 4d646298429e2f8e6db1f391713cf3196b605e0af468224995c66a24b62a93aceb67863ad0f6a4db9b0d59bfc205be5c10de6e13e5a7ccf7483a49b3a749592f
data/Cargo.lock CHANGED
@@ -233,7 +233,7 @@ checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280"
233
233
 
234
234
  [[package]]
235
235
  name = "glql"
236
- version = "0.43.0"
236
+ version = "0.44.0"
237
237
  dependencies = [
238
238
  "chrono",
239
239
  "graphql-parser",
@@ -320,6 +320,8 @@ checksum = "6717a8d2a5a929a1a2eb43a12812498ed141a0bcfb7e8f7844fbdbe4303bba9f"
320
320
  dependencies = [
321
321
  "equivalent",
322
322
  "hashbrown 0.16.0",
323
+ "serde",
324
+ "serde_core",
323
325
  ]
324
326
 
325
327
  [[package]]
@@ -10,4 +10,4 @@ crate-type = ["cdylib"]
10
10
 
11
11
  [dependencies]
12
12
  magnus = { version = "0.6.2" }
13
- glql = { git = "https://gitlab.com/gitlab-org/glql.git", tag = "v0.43.0" }
13
+ glql = { git = "https://gitlab.com/gitlab-org/glql.git", tag = "v0.44.0" }
@@ -4,5 +4,5 @@
4
4
  # This version is kept in sync with the root Cargo.toml version.
5
5
  # A version bump will trigger a gem release.
6
6
  module Glql
7
- VERSION = "0.43.0"
7
+ VERSION = "0.44.0"
8
8
  end
@@ -14,6 +14,10 @@ end
14
14
  module Glql
15
15
  Error = Class.new(StandardError)
16
16
 
17
+ # The schema document's private block; see `Glql.engine_config`.
18
+ ENGINE_CONFIG = "__engine_config"
19
+ private_constant :ENGINE_CONFIG
20
+
17
21
  class << self
18
22
  def compile(query, context)
19
23
  result_json = compile_rs(query, context.to_json)
@@ -32,12 +36,40 @@ module Glql
32
36
  # `version` is this gem's version rather than a field of the document, so it
33
37
  # cannot disagree with the artifact it shipped in. Merged last so a `version`
34
38
  # in the document could not override it.
39
+ #
40
+ # The document's private `__engine_config` block is left out; see
41
+ # `engine_config`.
35
42
  def schema
36
- @schema ||= freeze_recursively(JSON.parse(schema_rs).merge("version" => VERSION))
43
+ @schema ||= freeze_recursively(
44
+ document.except(ENGINE_CONFIG).merge("version" => VERSION)
45
+ )
46
+ end
47
+
48
+ # The GraphQL field behind each analytics source, dimension and metric,
49
+ # keyed by source name and then by field name:
50
+ #
51
+ # Glql.engine_config["DuoWorkflows"]
52
+ # # => { "field" => "analytics.duoWorkflows",
53
+ # # "dimensions" => { "flowType" => { "field" => "workflowDefinition" }, ... },
54
+ # # "metrics" => { "creditsUsedMean" => { "field" => "creditsUsed", "leaf" => "mean" }, ... } }
55
+ #
56
+ # A dimension's field is on the aggregated node's `dimensions` object, a
57
+ # metric's on the node itself; `leaf` marks a measurement stat, and
58
+ # `arguments` the fixed arguments a field is selected with (a pipeline
59
+ # rate's `{ "status" => "failed" }`). It is the document's private
60
+ # `__engine_config` block, which `schema` leaves out.
61
+ def engine_config
62
+ @engine_config ||= freeze_recursively(document.fetch(ENGINE_CONFIG))
37
63
  end
38
64
 
39
65
  private
40
66
 
67
+ # Parsed afresh for each caller: `schema` and `engine_config` memoise and
68
+ # freeze their own part.
69
+ def document
70
+ JSON.parse(schema_rs)
71
+ end
72
+
41
73
  # Freezes in place, at every level.
42
74
  #
43
75
  # `Hash#freeze` is shallow, and the memo above is shared for the life of the
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab_query_language
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.43.0
4
+ version: 0.44.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Himanshu Kapoor
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2026-11-18 00:00:00.000000000 Z
12
+ date: 2026-12-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rb_sys