tektoncd / pipeline

A cloud-native Pipeline resource.
https://tekton.dev
Apache License 2.0
8.52k stars 1.78k forks source link

Feedback/beta release for TEP-0144: Param Enum #7410

Open QuanZhang-William opened 1 year ago

QuanZhang-William commented 1 year ago

Feature looking for Promotion

Promote Param Enum feature to beta. Param.Enum allows resource authors to pre define a set of allowed values for a param and provides a built-in mechanism to perform param input value. This feature is guarded by dedicated feature flag enable-param-enum (setting it to true to experiment the feature).

Current Feature Version

alpha

Raise Feature Version

beta

Pipeline Release

v0.54

Issues Reported by the Users

Implementation PRs

martinmlouis commented 1 year ago

Could you please add enum feature with array values support? It currently supports string only. This is must if we switch from jenkins UI to tekton UI for deployment. All is good for Continuous Delivery but for Continuous Deployment we need this, please help

QuanZhang-William commented 1 year ago

Hi @martinmlouis 👋 , thanks for the feedback.

When designing the TEP, we left the enum support for array param to future work since the use cases was not clear to us (e.g. how do we validate an array against an allowlist, do we need the enum to be an array of arr? ).

If you have a clear use case of enum for array param, we can definitely extend the TEP to support it!

Is https://github.com/tektoncd/dashboard/issues/3193 your usecase? I was going through the discussion and it is still not clear how can an enum for array param type can help. But I'm happy to chat more about it.

martinmlouis commented 1 year ago

Yes, my use case for this feature is checkboxes for pipelines selection for CD. I just need to choose the pipelines from a list of pipelines either by - single select AND - multi select or - checkboxes. Concept copied from use of jenkins UI. How you implement it is upto the authors, Thanks

AlanGreene commented 1 year ago

If I'm understanding correctly, in terms of validation, for the use case debscribed the values in the array would each be validated against the allowed values specified by the enum. It would not require arrays of arrays.

martinmlouis commented 1 year ago

Can you see if this can be one of many priorities for next pipeline/dashboard release? I am a user of tekton CI/CD authoring task/pipeline, so I hope to answer your questions from a user perspective.

QuanZhang-William commented 12 months ago

cc @tektoncd/core-collaborators @tektoncd/core-maintainers

vdemeester commented 10 months ago

So one remark, missing piece is support of enum in objects, something like the following.

    params:
    - name: go
      description: >-
        Golang options, such as flags, …
      type: object
      properties:
        version:
          type: string
          enum: ["1.19", "1.20", "1.21", "1.22"]
        GOFLAGS: {type: string}
        GOOS: {type: string}
        GOARCH: {type: string}
        CGO_ENABLED: {type: string}
      default:
        version: "1.21"
        GOFLAGS: "-v"
        GOOS: ""
        GOARCH: ""
        CGO_ENABLED: "0"

I'll create an issue about it.

vdemeester commented 10 months ago

See https://github.com/tektoncd/pipeline/issues/7568

martinmlouis commented 8 months ago

Hello tekton CI/CD, Is it possible to speed up this feature request so that authors like me will get