Enable labkit logging field validator

Summary

  • Update gitlab-labkit to v1.3.4 (lockfile-only, constraint ~> 1.3.0 unchanged)
  • Add .labkit_logging_todo.yml with skip_ci_failure: true for 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_idgl_user_id) at runtime in non-production environments, supporting iterative migration to standardized field names.

How it works

  1. In non-production environments, the field validator intercepts JsonLogger.format_data calls
  2. It detects deprecated field names and records the callsite
  3. In CI, offenses are emitted as NDJSON lines (LABKIT_LOGGING_OFFENSE: {...})
  4. The labkit-logging fetch CLI 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.union for efficient path matching
  • See labkit-ruby#60 for details

Next steps

  1. Let CI run with the validator enabled
  2. Run labkit-logging fetch gitlab-org/gitlab <pipeline_id> to populate the baseline
  3. Commit the updated .labkit_logging_todo.yml with offenses
  4. Remove skip_ci_failure flag to enforce regression prevention

Merge request reports

Loading
Loading