Skip to content

Backend: Input type validation - type (1/2)

Problem

As a user, I want to ensure that the input I enter when using a component meets the correct format and type so that I can avoid errors or unexpected results when running a CI pipeline

Proposal

By adding an optional subkey type: and regex: (#410836 (closed)) we will improve the quality of the data and prevent potential errors, while making the user experience smoother and more reliable.

spec:
  inputs:
    environment:
      type: string/boolean/number # optional
      regex: /^gitlab.com/ # optional

when parsing spec: input we should add a data type validation, and in case of a wrong input we should present the user with the error

Wrong <variable name> input type expected string/boolean/number

open question - should we split regex from type or can we group that in the same MR?

Edited by Mark Nuzzo