Loading
Enable labkit logging field validator
Summary
- Update
gitlab-labkitto v1.3.4 (lockfile-only, constraint~> 1.3.0unchanged) - Add
.labkit_logging_todo.ymlwithskip_ci_failure: truefor initial baseline generation
What does this do?
Enables the labkit logging field validator in the monolith. The validator detects usage of deprecated logging field names (e.g., user_id → gl_user_id) at runtime in non-production environments, supporting iterative migration to standardized field names.
How it works
- In non-production environments, the field validator intercepts
JsonLogger.format_datacalls - It detects deprecated field names and records the callsite
- In CI, offenses are emitted as NDJSON lines (
LABKIT_LOGGING_OFFENSE: {...}) - The
labkit-logging fetchCLI tool collects offenses from CI and updates the baseline
v1.3.4 includes performance optimizations
- Stack frame processing: skip internal frames (
caller_locations(5, 30)) - Lazy string key conversion: only convert keys when a deprecated field is found
- Combined regex patterns: single
Regexp.unionfor efficient path matching - See labkit-ruby#60 for details
Next steps
- Let CI run with the validator enabled
- Run
labkit-logging fetch gitlab-org/gitlab <pipeline_id>to populate the baseline - Commit the updated
.labkit_logging_todo.ymlwith offenses - Remove
skip_ci_failureflag to enforce regression prevention
Related
- Epic: gitlab-org/quality&338 (closed)
- Issue: #589190 (closed)
- Performance: labkit-ruby#60 (closed)
- Partial CI discussion: labkit-ruby#62