Skip to content

Backend: Input regex validation

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

Related to #390458 (closed), by adding an optional subkey type: (#390458 (closed)) and regex:, 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

Additional details

Some relevant technical details, if applicable, such as:

  • Does this need a feature flag?
  • Does there need to be an associated instrumentation issue created related to this work?
  • Is there an example response showing the data structure that should be returned (new endpoints only)?
  • What permissions should be used?
  • Is this EE or CE?
    • EE
    • CE
  • Additional comments:

Links/References

Edited by Mark Nuzzo