Limit the number of inputs a spec:inputs header can declare

What does this MR do and why?

A spec:inputs header can declare any number of inputs. Catalog components store that header as jsonb at publish, and pipeline creation composes one entry for each input.

This MR adds a limit of 500 declared inputs.

  • Publish. maxProperties: 500 on inputs in catalog_resource_component_spec.json. A component spec above the limit fails validation, so the release fails. No feature flag, because no published component is above the limit.
  • Pipeline creation. Gitlab::Ci::Config::Header::Inputs logs every header above the limit. It adds a validation error only when ci_limit_spec_inputs_count is enabled. Local and project includes with a spec: header are not stored, so their input counts could not be measured. The log shows whether any of them is above the limit before the flag is enabled.

Data

Measured on a gitlab-production-main thin clone on 2026-10-21, from catalog_resource_components.spec. Details are in #635175.

Declared inputs Component rows Distinct catalog resources
more than 100 1,413 19
more than 200 174 7
more than 400 2 not measured
more than 450 0 0

The largest published component declares between 401 and 450 inputs. A lower limit would be a breaking change.

References

  • Closes #635175

How to set up and validate locally

  1. Create a .gitlab-ci.yml whose spec:inputs declares 501 inputs.
  2. With ci_limit_spec_inputs_count disabled, the pipeline is created and log/application_json.log has a spec:inputs declares more inputs than the limit entry.
  3. Enable ci_limit_spec_inputs_count. Pipeline creation fails with cannot declare more than 500 inputs.
Edited by Laura Montemayor

Merge request reports

Loading
Loading