gitlab-labkit 5.13.0 → 5.14.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: d23f73a2fd1a445640d1eb5b139b37c7663b4071080fb81599e581e8e694d0b4
4
- data.tar.gz: 1ae6ecb899e6eccba3c0852b5a580c7a90dab5c987798322131e1ccca28b34d7
3
+ metadata.gz: f9f95ff9d39b86e127ce7de851abe149fbe3659a31f4d82152c447884b59c89f
4
+ data.tar.gz: 70b231b5067e628000b51a031d83967d0ca1a9d9b43a2ab61ea72ad8d043fed7
5
5
  SHA512:
6
- metadata.gz: f6f1c85a2fb3fdc4d3e5884aa342722057597a844b9a4641c802f244abbf8ea928b308c554d49141165e7723854dfdcfbb829dc6f70ef2dbfd5b38c773081304
7
- data.tar.gz: f1d8f12623bbfb1226cec7691cb883ea184b0e04ba66243347f687fa2366aadfb750f751ebdda2c6bde65c8731aa47727fbeb079f614c955a039801acab3bcad
6
+ metadata.gz: 2d8a4ebc1085ffe38412ee762b03703e730a2ebc16e7ccd7af4bd41a89e1720134c588f3d16a7035c9ce5b9723be39bd8dd014fdb0af90d58bd53b453dbeb6b2
7
+ data.tar.gz: 9d2b7897ae3d834ba335a4927b259e5ff4fd7d4bef23e610d4a90ab523629e50471844fe47214021c152e787b3997b0970283ce98055dca1e470ab9fcb9e9d1f
data/lib/labkit/fields.rb CHANGED
@@ -37,6 +37,11 @@ module Labkit
37
37
  # Detailed error message (e.g. "undefined method 'boom!' for nil").
38
38
  ERROR_MESSAGE = "error_message"
39
39
 
40
+ # Stack trace or backtrace captured when an error or panic is logged (e.g.
41
+ # by LabKit's panic-recovery middleware), as a single newline-separated
42
+ # string.
43
+ STACK_TRACE = "stack_trace"
44
+
40
45
  # HTTP response status code.
41
46
  HTTP_STATUS_CODE = "status"
42
47
 
@@ -172,6 +177,7 @@ module Labkit
172
177
  DUO_WORKFLOW_ID => 0,
173
178
  ERROR_TYPE => 0,
174
179
  ERROR_MESSAGE => 1,
180
+ STACK_TRACE => 0,
175
181
  HTTP_STATUS_CODE => 1,
176
182
  HTTP_METHOD => 0,
177
183
  HTTP_URL => 0,
@@ -229,6 +235,7 @@ module Labkit
229
235
  Fields::GL_USER_ID => %w[user_id userid extra.user_id extra.current_user_id meta.user_id gitlab_user_id],
230
236
  Fields::GL_USER_NAME => %w[username extra.user meta.user],
231
237
  Fields::ERROR_MESSAGE => %w[error err error.message exception.message graphql_errors],
238
+ Fields::STACK_TRACE => %w[backtrace],
232
239
  Fields::HTTP_STATUS_CODE => %w[status_code extra.status status_text http_status],
233
240
  Fields::HTTP_URL => %w[req_url],
234
241
  Fields::DURATION_S => %w[duration duration_ms elapsed_time actual_duration time_ms total_time gitaly.duration],
@@ -769,7 +769,7 @@ A rule built in Ruby keeps Ruby equality.
769
769
  A file rule checks its name in every environment and compiles `re` and `nre` with the `re2` gem, so a pattern that only Ruby accepts, such as a lookbehind, is rejected at step `rule`, and `^` anchors the whole text as it does in Go and Rust.
770
770
  `Document.empty` is a document with no limiters, for a host that has no contract yet.
771
771
 
772
- `scripts/vendor-ratelimit-proto.sh` also copies `config.proto` and `constraint.proto` next to the generated code, and `schema_spec.rb` parses them and compares every field rule (caps, bounds, presets, flags), every message rule id and message, and the name pattern with `Schema`, so a `PROTOS_REF` bump that changes any of those fails the suite until `Schema` follows.
772
+ `scripts/vendor-ratelimit-proto.sh` also copies `config.proto` and `constraint.proto` next to the generated code, and `schema_spec.rb` parses them and compares every field rule (caps, bounds, presets, flags), every message rule id and message, and the name pattern with `Schema`, and checks that message rules are reported in the order the proto declares them, so a `PROTOS_REF` bump that changes any of those fails the suite until `Schema` follows.
773
773
  The CEL expressions themselves are mirrored by hand and pinned by the examples.
774
774
 
775
775
  The parse step converts each YAML scalar by the type of the field it fills, so `eq: off`, `eq: True` and `eq: 9970` stay strings, `limit: "5"` becomes `5`, `action: "1"` becomes `ACTION_LIMIT`, and a YAML null leaves the field unset.
@@ -15,9 +15,11 @@ module Labkit
15
15
  #
16
16
  # FIELD_RULES and MESSAGE_RULES are copied from the proto by hand, and
17
17
  # schema_spec.rb compares both with the vendored config.proto and
18
- # constraint.proto field by field, so a PROTOS_REF bump that changes a
19
- # cap, a flag, a rule id or a message fails the suite until this file
20
- # follows. The CEL expressions have no such check; the examples pin them.
18
+ # constraint.proto field by field, and checks that the checker reports
19
+ # message rules in declaration order, so a PROTOS_REF bump that changes a
20
+ # cap, a flag, a rule id, a message or the rule order fails the suite
21
+ # until this file follows. The CEL expressions have no such check; the
22
+ # examples pin them.
21
23
  #
22
24
  # The check is the strict reading of the schema. Lenient loading (Loader)
23
25
  # drops a rule whose matcher has no known operator before this step,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab-labkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.13.0
4
+ version: 5.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Newdigate