Log pipeline variable values of 120 KiB or more, by type

What does this MR do and why?

Prepares the pipeline creation logger for the pipeline variable size limits in !253433:

  • Lower threshold. A pipeline is logged when its largest variable value is 120 KiB or more, down from 200 KiB. 120 KiB is the planned GitLab.com limit for env_var values: Linux caps a single environment variable, name included, at 128 KiB (MAX_ARG_STRLEN), so values near that can't reach a job; 120 KiB leaves some headroom. Every pipeline the limit would affect now gets a log line.
  • Size per type. Each line also records pipeline_variables_max_env_var_value_bytesize and pipeline_variables_max_file_value_bytesize, for the types the pipeline uses. File type variables have a separate, higher limit, and the existing combined maximum can't tell a large TRIGGER_PAYLOAD (file type) from a large env_var. Anything that isn't file counts as env_var.

pipeline_variables_max_value_bytesize and the other thresholds are unchanged. Only sizes are logged, never keys or values.

The threshold change is also in !253433. Shipping it here starts the logging before the limits merge.

References

Screenshots or screen recordings

Not applicable. There is no UI change.

How to set up and validate locally

  1. Run a pipeline passing a variable whose value is between 120 KiB and 200 KiB.
  2. Check log/application_json.log for a Gitlab::Ci::Pipeline::Logger entry with pipeline_variables_max_env_var_value_bytesize.
  3. Repeat with a file type variable, and check for pipeline_variables_max_file_value_bytesize.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Oleg Yakovenko

Merge request reports

Loading
Loading