gitlab-labkit 2.2.0 → 2.3.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: e99765f42b600bc7e6307b75665409c3e3ee3b6aabf69f5bdb14d65fe20d8cdc
4
- data.tar.gz: b2623750accd4178e7d938ebf87abbb6e1d40f14d4e252b9654f015d4141ce3c
3
+ metadata.gz: 84b7e5d8dd7ac808b13eddd6bd9b9c01e70a0542192a65ba2ef197648998d060
4
+ data.tar.gz: b597d7bdbf957cd7affb670255bff5fbb56a0efe3d2f2426a85e21651c07dd14
5
5
  SHA512:
6
- metadata.gz: cfc0d196a34588965f17b6598b7bf8b1cdaa8d90d79e62bf5a4d75e07537473ee4a8011c7718e18af64d4ec216a85b7bd3a3099523404f6bd7c892b5a7b4ae35
7
- data.tar.gz: fdb892b50ca446d76d999e7397c57df1539f6724e31ea698b440a7d08a5544e25246d2a4d7ed5bb4516dc5592b31fc7bb1860d29baac43bdc3b94052d011c24d
6
+ metadata.gz: d6f68fe206dceade497c046cb39d98157a16461e322e852e60618e4d3c4ae4c67b01155a1d73180a74898e4acffef6cfc9b076d61f3bd190c62c7cb766b79831
7
+ data.tar.gz: 3e087a7d38e003655216d3c2761b2dfcecd92c40fa18eaf3d49431105d4c9306e526e5bd8ab6c8625d54f9277eff5d177d43c541a5bcc8062010c369e3cb35c9
data/lib/labkit/fields.rb CHANGED
@@ -118,6 +118,44 @@ module Labkit
118
118
  # The endpoint_id of the original caller at the root of the call chain.
119
119
  ROOT_CALLER_ID = "root_caller_id"
120
120
 
121
+ # Maps each field constant to its logging field variant version.
122
+ # A version of 0 means the field is not yet assigned to any variant.
123
+ VARIANT_VERSION = {
124
+ CORRELATION_ID => 1,
125
+ GL_USER_ID => 1,
126
+ GL_USER_NAME => 1,
127
+ DUO_WORKFLOW_DEFINITION => 0,
128
+ ERROR_TYPE => 0,
129
+ ERROR_MESSAGE => 1,
130
+ HTTP_STATUS_CODE => 1,
131
+ HTTP_METHOD => 0,
132
+ HTTP_URL => 0,
133
+ DURATION_S => 1,
134
+ REMOTE_IP => 1,
135
+ TCP_ADDRESS => 0,
136
+ HTTP_URI => 0,
137
+ HTTP_HOST => 0,
138
+ HTTP_PROTO => 0,
139
+ REMOTE_ADDR => 0,
140
+ HTTP_REFERRER => 0,
141
+ HTTP_USER_AGENT => 0,
142
+ WRITTEN_BYTES => 0,
143
+ CONTENT_TYPE => 0,
144
+ TTFB_S => 0,
145
+ GL_PROJECT_ID => 1,
146
+ GL_PIPELINE_ID => 1,
147
+ TIMESTAMP => 0,
148
+ SEVERITY => 0,
149
+ LOG_MESSAGE => 1,
150
+ CLASS_NAME => 0,
151
+ SERVICE_NAME => 0,
152
+ GL_ORGANIZATION_ID => 1,
153
+ GL_PROJECT_PATH => 1,
154
+ ENDPOINT_ID => 0,
155
+ CALLER_ID => 1,
156
+ ROOT_CALLER_ID => 0,
157
+ }.freeze
158
+
121
159
  # Get the constant name for a field value
122
160
  # @param field_value [String] The field value (e.g., "gl_user_id")
123
161
  # @return [String, nil] The constant name (e.g., "GL_USER_ID") or nil if not found
@@ -33,7 +33,13 @@ module Labkit
33
33
  # @return the script's return value
34
34
  def eval(conn, keys:, argv:)
35
35
  conn.evalsha(@sha, keys: keys, argv: argv)
36
- rescue ::Redis::CommandError => e
36
+ # Redis::CommandError and RedisClient::CommandError are sibling class trees
37
+ # with no common ancestor above StandardError -- neither inherits from the
38
+ # other. A NOSCRIPT response arrives as Redis::* on single-instance
39
+ # connections (the redis gem's translator runs) and as RedisClient::* on
40
+ # cluster connections when the cluster translator skips the conversion.
41
+ # Both shapes must reach the EVAL fallback, so we list both classes.
42
+ rescue ::Redis::CommandError, ::RedisClient::CommandError => e
37
43
  raise unless e.message.start_with?("NOSCRIPT")
38
44
 
39
45
  conn.eval(@body, keys: keys, argv: argv)
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: 2.2.0
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Newdigate