Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Nested array/object parameters #7069

Open
lbernick opened this issue Aug 24, 2023 · 1 comment
Open

Feature Request: Nested array/object parameters #7069

lbernick opened this issue Aug 24, 2023 · 1 comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@lbernick
Copy link
Member

lbernick commented Aug 24, 2023

Feature request

Support specifying array and object params within object params, e.g.:

params:
- name: event
  value:
    repository:
      owner: tektoncd
      name: pipelines

Use case

Challenges

  • determining whether there should be a cap on level of nesting or param size
@lbernick lbernick added the kind/feature Categorizes issue or PR as related to a new feature. label Aug 24, 2023
@pritidesai
Copy link
Member

pritidesai commented Sep 15, 2023

Thanks @lbernick for creating this feature request 👍

There is an additional use case from our users for an array of object in matrix.

matrix works great with an implicit and explicit combinations. But matrix does not support dynamic list of combinations specified by the users through the pipelineRun or a trigger.

For example, with a shared pipeline, some users would like to specify 2 combinations while some would like to initiate the same pipeline using 3 combinations.

The following example works great where the pipeline controller generates all possible combinations of both platform and browser. The users can specify a list of platforms and browsers at run time. The same pipeline can be invoked for 2 platforms and also for 3 platforms.

    matrix:
      params:
        - name: platform
          value: $(params.platforms[*])
        - name: browser
          value: $(params.browsers[*])
  ...

We are missing the same level of dynamism with an explicit combinations. Taking an example of matrix to build an image with a specific path for each image would not work if the list of images are specified at the pipelineRun level. The following example is part of the pipeline and the pipeline will always create three instances of the same build task.

    matrix:
        include:
          - name: build-1
            params:
              - name: IMAGE
                value: "image-1"
              - name: DOCKERFILE
                value: "path/to/Dockerfile1"
          - name: build-2
            params:
              - name: IMAGE
                value: "image-2"
              - name: DOCKERFILE
                value: "path/to/Dockerfile2"
          - name: build-3
            params:
              - name: IMAGE
                value: "image-3"
              - name: DOCKERFILE
                value: "path/to/Dockerfile3"
  ...

The concept of nested array and object param will help solve this use case where the same pipeline can be invoked with any number of explicit combinations.

matrix:
  params:
    - name: list-of-platform-browser-object
      value: $(params.list-of-platform-browser-object[*])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

2 participants