gitlab-labkit 2.5.0 → 2.6.1
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 +4 -4
- data/.copier-answers.yml +1 -1
- data/.gitlab-ci.yml +3 -3
- data/.pre-commit-config.yaml +1 -1
- data/lib/labkit/fields.rb +13 -0
- data/lib/labkit/rate_limit/evaluator.rb +3 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 140906bda44bd0c6017b97b2426de6ec7b5d9f8182d68c148ca03c7089119105
|
|
4
|
+
data.tar.gz: 75778be0358853695eddea8d83acfac30d764ff38c1fd3ab635caa57c8082024
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f12fa1948cf7b5293bd72cbae7dac4b2c2d64c75120734037c3d271eb15e82c5481d7a99f79fbdf05f242b833310d58657107c315b20e29e080ea166f82b918c
|
|
7
|
+
data.tar.gz: 04c483ebc32941c2e76dabdd2c58ec3b213e02e8b1bae7a8593cfe322669db4f678c7676d9c14cc8fe3124a6c6fb42a1b31f79bbdc1b90c856bdb5f784cedb86
|
data/.copier-answers.yml
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# See the project for instructions on how to update the project
|
|
4
4
|
#
|
|
5
5
|
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
|
|
6
|
-
_commit: v1.
|
|
6
|
+
_commit: v1.52.0
|
|
7
7
|
_src_path: https://gitlab.com/gitlab-com/gl-infra/common-template-copier.git
|
|
8
8
|
ee_licensed: false
|
|
9
9
|
gitlab_namespace: gitlab-org/ruby/gems
|
data/.gitlab-ci.yml
CHANGED
|
@@ -19,13 +19,13 @@ include:
|
|
|
19
19
|
# It includes standard checks, gitlab-scanners, validations and release processes
|
|
20
20
|
# common to all projects using this template library.
|
|
21
21
|
# see https://gitlab.com/gitlab-com/gl-infra/common-ci-tasks/-/blob/main/templates/standard.md
|
|
22
|
-
- component: $CI_SERVER_FQDN/gitlab-com/gl-infra/common-ci-tasks/standard-build@v4.
|
|
22
|
+
- component: $CI_SERVER_FQDN/gitlab-com/gl-infra/common-ci-tasks/standard-build@v4.11
|
|
23
23
|
|
|
24
24
|
# Runs rspec tests and rubocop on the project
|
|
25
25
|
# see https://gitlab.com/gitlab-com/gl-infra/common-ci-tasks/-/blob/main/templates/ruby.md
|
|
26
|
-
- component: $CI_SERVER_FQDN/gitlab-com/gl-infra/common-ci-tasks/ruby-build@v4.
|
|
26
|
+
- component: $CI_SERVER_FQDN/gitlab-com/gl-infra/common-ci-tasks/ruby-build@v4.11
|
|
27
27
|
|
|
28
|
-
- component: $CI_SERVER_FQDN/gitlab-com/gl-infra/common-ci-tasks/danger@v4.
|
|
28
|
+
- component: $CI_SERVER_FQDN/gitlab-com/gl-infra/common-ci-tasks/danger@v4.11
|
|
29
29
|
|
|
30
30
|
# Attach a redis service to the rspec job from common-ci-tasks/ruby-build.
|
|
31
31
|
# GitLab merges keys when a local job has the same name as an included one,
|
data/.pre-commit-config.yaml
CHANGED
|
@@ -25,7 +25,7 @@ repos:
|
|
|
25
25
|
# Documentation available at
|
|
26
26
|
# https://gitlab.com/gitlab-com/gl-infra/common-ci-tasks/-/blob/main/docs/pre-commit.md
|
|
27
27
|
- repo: https://gitlab.com/gitlab-com/gl-infra/common-ci-tasks
|
|
28
|
-
rev: v4.
|
|
28
|
+
rev: v4.11 # renovate:managed
|
|
29
29
|
|
|
30
30
|
hooks:
|
|
31
31
|
- id: shellcheck # Run shellcheck for changed Shell files
|
data/lib/labkit/fields.rb
CHANGED
|
@@ -90,6 +90,12 @@ module Labkit
|
|
|
90
90
|
# GitLab pipeline numeric ID.
|
|
91
91
|
GL_PIPELINE_ID = "gl_pipeline_id"
|
|
92
92
|
|
|
93
|
+
# GitLab namespace numeric ID.
|
|
94
|
+
GL_NAMESPACE_ID = "gl_namespace_id"
|
|
95
|
+
|
|
96
|
+
# GitLab root (top-level) namespace numeric ID.
|
|
97
|
+
GL_ROOT_NAMESPACE_ID = "gl_root_namespace_id"
|
|
98
|
+
|
|
93
99
|
# Log event timestamp in ISO 8601 format (e.g. "2026-04-02T12:00:00.000Z").
|
|
94
100
|
TIMESTAMP = "timestamp"
|
|
95
101
|
|
|
@@ -122,6 +128,10 @@ module Labkit
|
|
|
122
128
|
# The endpoint_id of the original caller at the root of the call chain.
|
|
123
129
|
ROOT_CALLER_ID = "root_caller_id"
|
|
124
130
|
|
|
131
|
+
# GitLab SentNotification record numeric ID associated with an incoming
|
|
132
|
+
# email reply.
|
|
133
|
+
GL_SENT_NOTIFICATION_ID = "gl_sent_notification_id"
|
|
134
|
+
|
|
125
135
|
# Maps each field constant to its logging field variant version.
|
|
126
136
|
# A version of 0 means the field is not yet assigned to any variant.
|
|
127
137
|
VARIANT_VERSION = {
|
|
@@ -149,6 +159,8 @@ module Labkit
|
|
|
149
159
|
TTFB_S => 0,
|
|
150
160
|
GL_PROJECT_ID => 1,
|
|
151
161
|
GL_PIPELINE_ID => 1,
|
|
162
|
+
GL_NAMESPACE_ID => 0,
|
|
163
|
+
GL_ROOT_NAMESPACE_ID => 0,
|
|
152
164
|
TIMESTAMP => 0,
|
|
153
165
|
SEVERITY => 0,
|
|
154
166
|
LOG_MESSAGE => 1,
|
|
@@ -159,6 +171,7 @@ module Labkit
|
|
|
159
171
|
ENDPOINT_ID => 0,
|
|
160
172
|
CALLER_ID => 1,
|
|
161
173
|
ROOT_CALLER_ID => 0,
|
|
174
|
+
GL_SENT_NOTIFICATION_ID => 0,
|
|
162
175
|
}.freeze
|
|
163
176
|
|
|
164
177
|
# Get the constant name for a field value
|
|
@@ -287,9 +287,10 @@ module Labkit
|
|
|
287
287
|
|
|
288
288
|
def log_error(error, identifier)
|
|
289
289
|
@logger.warn(
|
|
290
|
-
message: "rate_limit_error",
|
|
291
290
|
name: @name,
|
|
292
|
-
|
|
291
|
+
Labkit::Fields::ERROR_TYPE => "rate_limit_error",
|
|
292
|
+
Labkit::Fields::CLASS_NAME => error.class.to_s,
|
|
293
|
+
Labkit::Fields::ERROR_MESSAGE => error.message,
|
|
293
294
|
identifier: identifier&.to_h
|
|
294
295
|
)
|
|
295
296
|
end
|