Skip to content

Add input size limit validation and default type handling for job inputs

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Summary

This issue tracks two follow-up improvements for the job inputs feature introduced in Add keyword to CI config for CI job inputs (!210490):

  1. Input size limit validation (feedback from @lauraXD)
  2. Default type handling in JobResponse (feedback from @timofurrer)

1. Input Size Limit Validation

Context

We need to limit the number of job inputs to 50.

What needs to be done

Add validation in lib/gitlab/ci/config/entry/job.rb and add "maxProperties": 50 to the jobInputs definition in app/assets/javascripts/editor/schema/ci.json

2. Default Type Handling in JobResponse

Context

When the type is omitted for an input, the type field in JobResponse is currently null. It would be better if we always have a valid type that matches the value (defaulting to 'string' when not specified).

What needs to be done

Ensure that when job input definitions are stored in the database, the type field is populated with a default value of 'string' when not explicitly provided.

Edited by 🤖 GitLab Bot 🤖