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

Allow param and workspace propagation in Pipeline and Tasks #7901

Closed
chitrangpatel opened this issue Apr 22, 2024 · 2 comments · Fixed by #7930
Closed

Allow param and workspace propagation in Pipeline and Tasks #7901

chitrangpatel opened this issue Apr 22, 2024 · 2 comments · Fixed by #7930
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. kind/feature Categorizes issue or PR as related to a new feature.

Comments

@chitrangpatel
Copy link
Member

chitrangpatel commented Apr 22, 2024

Feature request (or a Bug related to param and workspace propagation)

TEP0107 introduced parameter propagation between PipelineRuns --> Pipelines and TaskRuns --> Tasks.

However, it missed it in parameter and workspace propagation within a Pipeline (i.e. Pipeline --> PipelineTasks --> Steps). We should be able to propagate params and workspaces within the same document for a more consistent workflow and reduction in verbosity.

Use case

  • Reduction in verbosity.
  • Consistent UX.

Currently this (param propagation in a pipelinerun) works:

apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
  name: param-example
spec:
  params:
    - name: p1
      value: p1
    - name: p2
      value: p2
    - name: p3
      value: p3
  pipelineSpec:
    tasks:
      - name: t1
        taskSpec:
          steps:
            - image: ubuntu
              command: ["echo"]
              args: ["$(params.p1)"]
      - name: t2
        taskSpec:
          steps:
            - image: ubuntu
              command: ["echo"]
              args: ["$(params.p2)"]
      - name: t3
        taskSpec:
          steps:
            - image: ubuntu
              command: ["echo"]
              args: ["$(params.p3)"]

But this (param propagation within a pipeline) does not work. My assumption was that it should work since the params are defined in the context of the Pipeline, just like they were in the context of the PipelineRun earlier:

apiVersion: tekton.dev/v1
kind: Pipeline
metadata:
  name: param-example
spec:
  params:
    - name: p1
    - name: p2
    - name: p3
  tasks:
    - name: t1
      taskSpec:
        steps:
          - image: ubuntu
            command: ["echo"]
            args: ["$(params.p1)"]
    - name: t2
      taskSpec:
        steps:
          - image: ubuntu
            command: ["echo"]
            args: ["$(params.p2)"]
    - name: t3
      taskSpec:
        steps:
          - image: ubuntu
            command: ["echo"]
            args: ["$(params.p3)"]

Currently, you need to declare the params in TaskSpecs and pass them through pipelineTasks.
I'm inclined to treat this as a bug rather than a new feature since it is inconsistent when switching between in-lined and referenced pipelines. The same also applies to Tasks and TaskRuns.

/kind bug

@chitrangpatel chitrangpatel added the kind/feature Categorizes issue or PR as related to a new feature. label Apr 22, 2024
@tekton-robot tekton-robot added the kind/bug Categorizes issue or PR as related to a bug. label Apr 22, 2024
@chitrangpatel
Copy link
Member Author

@tektoncd/core-collaborators WDYT?

chitrangpatel added a commit to chitrangpatel/pipeline that referenced this issue May 6, 2024
Prior to this, we allowed parameter propagation in an inlined
pipelinerun. However, within a pipeline, we requrie a verbose spec.
This was an oversight as indicated in
tektoncd#7901.
This PR fixes that issue by updating the validation logic in the
webhook.

Fixes tektoncd#7901.
chitrangpatel added a commit to chitrangpatel/pipeline that referenced this issue May 10, 2024
Prior to this, we allowed parameter propagation in an inlined
pipelinerun. However, within a pipeline, we requrie a verbose spec.
This was an oversight as indicated in
tektoncd#7901.
This PR fixes that issue by updating the validation logic in the
webhook.

Fixes tektoncd#7901.

docs
chitrangpatel added a commit to chitrangpatel/pipeline that referenced this issue May 10, 2024
Prior to this, we allowed parameter propagation in an inlined
pipelinerun. However, within a pipeline, we requrie a verbose spec.
This was an oversight as indicated in
tektoncd#7901.
This PR fixes that issue by updating the validation logic in the
webhook.

Fixes tektoncd#7901.

Propagate params in pipelines

Prior to this, we allowed parameter propagation in an inlined
pipelinerun. However, within a pipeline, we requrie a verbose spec.
This was an oversight as indicated in
tektoncd#7901.
This PR fixes that issue by updating the validation logic in the
webhook.

Fixes tektoncd#7901.
chitrangpatel added a commit to chitrangpatel/pipeline that referenced this issue May 13, 2024
Prior to this, we allowed parameter propagation in an inlined
pipelinerun. However, within a pipeline, we requrie a verbose spec.
This was an oversight as indicated in
tektoncd#7901.
This PR fixes that issue by updating the validation logic in the
webhook.

Fixes tektoncd#7901.

Propagate params in pipelines

Prior to this, we allowed parameter propagation in an inlined
pipelinerun. However, within a pipeline, we requrie a verbose spec.
This was an oversight as indicated in
tektoncd#7901.
This PR fixes that issue by updating the validation logic in the
webhook.

Fixes tektoncd#7901.
chitrangpatel added a commit to chitrangpatel/pipeline that referenced this issue May 13, 2024
Prior to this, we allowed parameter propagation in an inlined
pipelinerun. However, within a pipeline, we requrie a verbose spec.
This was an oversight as indicated in
tektoncd#7901.
This PR fixes that issue by updating the validation logic in the
webhook.

Fixes tektoncd#7901.

Propagate params in pipelines

Prior to this, we allowed parameter propagation in an inlined
pipelinerun. However, within a pipeline, we requrie a verbose spec.
This was an oversight as indicated in
tektoncd#7901.
This PR fixes that issue by updating the validation logic in the
webhook.

Fixes tektoncd#7901.
chitrangpatel added a commit to chitrangpatel/pipeline that referenced this issue May 13, 2024
Prior to this, we allowed parameter propagation in an inlined
pipelinerun. However, within a pipeline, we requrie a verbose spec.
This was an oversight as indicated in
tektoncd#7901.
This PR fixes that issue by updating the validation logic in the
webhook.

Fixes tektoncd#7901.

Propagate params in pipelines

Prior to this, we allowed parameter propagation in an inlined
pipelinerun. However, within a pipeline, we requrie a verbose spec.
This was an oversight as indicated in
tektoncd#7901.
This PR fixes that issue by updating the validation logic in the
webhook.

Fixes tektoncd#7901.
@chitrangpatel
Copy link
Member Author

Agreement from API WG on Monday 13th that this was an oversight and should be fixed!

@chitrangpatel chitrangpatel self-assigned this May 15, 2024
chitrangpatel added a commit to chitrangpatel/pipeline that referenced this issue May 16, 2024
Prior to this, we allowed parameter propagation in an inlined
pipelinerun. However, within a pipeline, we requrie a verbose spec.
This was an oversight as indicated in
tektoncd#7901.
This PR fixes that issue by updating the validation logic in the
webhook.

Fixes tektoncd#7901.

Propagate params in pipelines

Prior to this, we allowed parameter propagation in an inlined
pipelinerun. However, within a pipeline, we requrie a verbose spec.
This was an oversight as indicated in
tektoncd#7901.
This PR fixes that issue by updating the validation logic in the
webhook.

Fixes tektoncd#7901.
tekton-robot pushed a commit that referenced this issue May 16, 2024
Prior to this, we allowed parameter propagation in an inlined
pipelinerun. However, within a pipeline, we requrie a verbose spec.
This was an oversight as indicated in
#7901.
This PR fixes that issue by updating the validation logic in the
webhook.

Fixes #7901.

Propagate params in pipelines

Prior to this, we allowed parameter propagation in an inlined
pipelinerun. However, within a pipeline, we requrie a verbose spec.
This was an oversight as indicated in
#7901.
This PR fixes that issue by updating the validation logic in the
webhook.

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

Successfully merging a pull request may close this issue.

2 participants