Uploaded image for project: 'OpenShift Request For Enhancement'
  1. OpenShift Request For Enhancement
  2. RFE-2407

Pipeline Builder - Required Params Cannot Be Empty Strings

XMLWordPrintable

    • False
    • False
    • Undefined

      Description of feature:

      There is currently an issue with the Pipeline Builder where `''` are considered invalid for required parameters (ie. a param in the stand-alone Task that does NOT have a default of any kind).

      Why is this an issue? Well, because the Operator and technically the author of a Task could be okay with an empty string as a valid value – the Builder won't have it in any fashion shy of directly on the YAML without form/yaml swapping.

      The "default" property of Task's Params is a valid value as `''`. This was not known at the time of Pipeline Builders inception, but was corrected later. ODC-3606 (comment)

      Due to that, there are several ways we incorporated this functionality and subsequently caused an issue with just supporting "empty strings" as valid param state.

      1. In OpenShift Console, we use `*` as a required indictor, this typically has always meant a non-empty string – we do the same in Pipeline Builder for required params
      2. When handling params with defaults, we pre-populate the input with the default; this allows easy modification if the user wants a similar value to the default one
        • However, if one clears the param that has a default, the placeholder text says the default value – this is a nod to how we will trim out the empty params in order to give them the stand-alone Task's param's default value if they do nothing
      3. When swapping between Form and YAML, we run the same logic as if you hit submit on the form page (or the previous Builder before form/yaml switcher) – this simply takes our form data and converts it to a Pipeline resource
        • This trims empty params – this is an issue for required params if we were to support empty as they cannot be omitted

      Prerequisites (if any, like setup, operators/versions):

      OpenShift Pipelines Operator of any version.

      Additional Details

      If we want to support this... this will require UX to be involved to handle the visual look of "required" params (do we keep the asterisk?), default "empty" param state, and maybe a required "empty" param state

      This could technically be a bug because it relates to the empty default param issue from before.

      This was found with Karthik as we were discussing my rework of the Pipeline Builder validation utils. ODC-3165 / PR 8460

              sdoyle@redhat.com Serena Nichols (Inactive)
              aballantyne Andrew Ballantyne
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: