Loading
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: 500oninputsincatalog_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::Inputslogs every header above the limit. It adds a validation error only whenci_limit_spec_inputs_countis enabled. Local and project includes with aspec: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
- Create a
.gitlab-ci.ymlwhosespec:inputsdeclares 501 inputs. - With
ci_limit_spec_inputs_countdisabled, the pipeline is created andlog/application_json.loghas aspec:inputs declares more inputs than the limitentry. - Enable
ci_limit_spec_inputs_count. Pipeline creation fails withcannot declare more than 500 inputs.
Edited by Laura Montemayor