pipeline icon indicating copy to clipboard operation
pipeline copied to clipboard

Feedback/beta release for TEP-0144: Param Enum

Open QuanZhang-William opened this issue 2 years ago • 9 comments

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

  • https://github.com/tektoncd/pipeline/issues/7084
  • https://github.com/tektoncd/dashboard/issues/3193

Implementation PRs

  • https://github.com/tektoncd/pipeline/issues/7270

QuanZhang-William avatar Nov 23 '23 15:11 QuanZhang-William

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

martinmlouis avatar Nov 29 '23 14:11 martinmlouis

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.

QuanZhang-William avatar Nov 30 '23 19:11 QuanZhang-William

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

martinmlouis avatar Nov 30 '23 20:11 martinmlouis

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.

AlanGreene avatar Dec 01 '23 13:12 AlanGreene

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.

martinmlouis avatar Dec 03 '23 16:12 martinmlouis

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

QuanZhang-William avatar Dec 06 '23 15:12 QuanZhang-William

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 avatar Jan 16 '24 18:01 vdemeester

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

vdemeester avatar Jan 16 '24 18:01 vdemeester

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

  • array params as dropdown in Dashboard rather than string
  • array params can be a task/pipeline
  • gives ability to manual deploy a pipeline with drop downs list of array params rather than typing/copying text to run the pipeline or task
  • gives ability to have array params for task/pipeline as selectable so that we can have parent pipeline =>many child selectable pipelines, so that we select what we need to deploy, these values selected from UI will have to be passed as params to any taskRun/pieplineRun. This will have a one-to-one mapping between the pipeline => to pipelineRun and task => to taskRun This helps a lots in using tekton as not only for the current CI/CD but also manual deployments Automation so that this part of operation can be given to Build + Release operation staff as well The goal is to replace jenkins UI with tekton UI Can someone help? I do not have golang to show a PR so that the authors of tekton CI/CD can see it in action Thanks

martinmlouis avatar Mar 14 '24 17:03 martinmlouis