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

[TEP-0076]Support Array Results substitution #4908

Merged

Conversation

Yongxuanzhang
Copy link
Member

@Yongxuanzhang Yongxuanzhang commented May 25, 2022

Changes

This is part of work in TEP-0076.
This commit provides the support to apply array results replacements.
Previous this commit we support emitting array results so users can
write array results to task level, but we cannot pass array results from
tasks within one pipeline. This commit adds the support for this.

/kind feature

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • Docs included if any changes are user facing
  • Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including
    functionality, content, code)
  • Release notes block below has been filled in
    (if there are no user facing changes, use release note "NONE")

Release Notes

Support array results substitution as an alpha feature.

A task can specify a type to produce array result, such as:

  results:
    - name: array-results
       type: array
       description: The array results

And the task script can populate result in an array form with:

echo -n "[\"hello\",\"world\"]" | tee $(results.array-results.path)

and we can refer to the array results in param like:
  params:
    - name: foo
      value: "$(tasks.task1.results.array-results[*])"

This feature is part of the TEP-0076. 

@tekton-robot tekton-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels May 25, 2022
@tekton-robot tekton-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 25, 2022
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1beta1/result_types.go Do not exist 100.0%
pkg/apis/pipeline/v1beta1/when_types.go 100.0% 96.7% -3.3
pkg/reconciler/pipelinerun/resources/resultrefresolution.go 94.0% 94.5% 0.5
pkg/reconciler/taskrun/validate_resources.go 93.7% 94.0% 0.3

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1beta1/result_types.go Do not exist 100.0%
pkg/apis/pipeline/v1beta1/when_types.go 100.0% 96.7% -3.3
pkg/reconciler/pipelinerun/resources/resultrefresolution.go 94.0% 94.5% 0.5
pkg/reconciler/taskrun/validate_resources.go 93.7% 94.0% 0.3

@Yongxuanzhang Yongxuanzhang force-pushed the results-array-substitution branch 2 times, most recently from 2056ea5 to c5c5108 Compare May 25, 2022 18:51
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1beta1/result_types.go Do not exist 100.0%
pkg/reconciler/pipelinerun/resources/resultrefresolution.go 94.0% 94.5% 0.5
pkg/reconciler/taskrun/validate_resources.go 93.7% 94.0% 0.3

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1beta1/result_types.go Do not exist 100.0%
pkg/reconciler/pipelinerun/resources/resultrefresolution.go 94.0% 95.6% 1.6
pkg/reconciler/taskrun/validate_resources.go 93.7% 94.0% 0.3

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1beta1/result_types.go Do not exist 100.0%
pkg/reconciler/pipelinerun/resources/resultrefresolution.go 94.0% 94.5% 0.5
pkg/reconciler/taskrun/validate_resources.go 93.7% 94.0% 0.3

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1beta1/result_types.go Do not exist 100.0%
pkg/reconciler/pipelinerun/resources/resultrefresolution.go 94.0% 94.5% 0.5
pkg/reconciler/taskrun/validate_resources.go 93.7% 94.0% 0.3

@Yongxuanzhang Yongxuanzhang marked this pull request as ready for review May 25, 2022 20:35
@tekton-robot tekton-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 25, 2022
@Yongxuanzhang
Copy link
Member Author

/assign @ywluogg

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1beta1/result_types.go Do not exist 100.0%
pkg/reconciler/pipelinerun/resources/resultrefresolution.go 94.0% 94.5% 0.5
pkg/reconciler/taskrun/validate_resources.go 93.7% 94.0% 0.3

@tekton-robot
Copy link
Collaborator

@Yongxuanzhang: GitHub didn't allow me to assign the following users: ywluogg.

Note that only tektoncd members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time.
For more information please see the contributor guide

In response to this:

/assign @ywluogg

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1beta1/result_types.go Do not exist 100.0%
pkg/reconciler/pipelinerun/resources/resultrefresolution.go 94.0% 94.5% 0.5
pkg/reconciler/taskrun/validate_resources.go 93.7% 94.0% 0.3

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1beta1/result_types.go Do not exist 100.0%
pkg/reconciler/pipelinerun/resources/resultrefresolution.go 94.0% 94.5% 0.5
pkg/reconciler/taskrun/validate_resources.go 93.7% 94.0% 0.3

@Yongxuanzhang
Copy link
Member Author

/retest

@ywluogg
Copy link
Contributor

ywluogg commented May 25, 2022

/assign

Copy link
Member

@dibyom dibyom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of small things, otherwise LGTM!

pkg/apis/pipeline/v1beta1/result_types.go Outdated Show resolved Hide resolved
docs/pipelines.md Outdated Show resolved Hide resolved
@tekton-robot tekton-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 2, 2022
@tekton-robot tekton-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 4, 2022
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1beta1/result_types.go Do not exist 100.0%
pkg/reconciler/pipelinerun/resources/resultrefresolution.go 94.6% 96.0% 1.4
pkg/reconciler/taskrun/validate_resources.go 96.1% 96.2% 0.0

@Yongxuanzhang
Copy link
Member Author

/retest

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1beta1/result_types.go Do not exist 100.0%
pkg/reconciler/pipelinerun/resources/apply.go 99.2% 99.2% 0.0
pkg/reconciler/pipelinerun/resources/resultrefresolution.go 94.6% 95.0% 0.4
pkg/reconciler/taskrun/validate_resources.go 96.1% 96.2% 0.0

@ywluogg
Copy link
Contributor

ywluogg commented Jul 5, 2022

Except for the existing open comments, other LGTM

@ywluogg
Copy link
Contributor

ywluogg commented Jul 5, 2022

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 5, 2022
@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Jul 5, 2022
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1beta1/result_types.go Do not exist 100.0%
pkg/reconciler/pipelinerun/resources/apply.go 99.2% 99.2% 0.0
pkg/reconciler/pipelinerun/resources/resultrefresolution.go 94.6% 95.0% 0.4
pkg/reconciler/taskrun/validate_resources.go 96.1% 96.2% 0.0

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1beta1/result_types.go Do not exist 100.0%
pkg/reconciler/pipelinerun/resources/apply.go 99.2% 99.2% 0.0
pkg/reconciler/pipelinerun/resources/resultrefresolution.go 94.6% 95.0% 0.4
pkg/reconciler/taskrun/validate_resources.go 96.1% 96.2% 0.0

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1beta1/result_types.go Do not exist 100.0%
pkg/reconciler/pipelinerun/resources/apply.go 99.2% 99.2% 0.0
pkg/reconciler/pipelinerun/resources/resultrefresolution.go 94.6% 95.0% 0.4
pkg/reconciler/taskrun/validate_resources.go 96.1% 96.2% 0.0

This is part of work in TEP-0076.
This commit provides the support to apply array results replacements.
Previous this commit we support emitting array results so users can
write array results to task level, but we cannot pass array results from
tasks within one pipeline. This commit adds the support for this.
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1beta1/result_types.go Do not exist 100.0%
pkg/reconciler/pipelinerun/resources/apply.go 99.2% 99.2% 0.0
pkg/reconciler/pipelinerun/resources/resultrefresolution.go 94.6% 96.0% 1.3
pkg/reconciler/taskrun/validate_resources.go 96.1% 96.2% 0.0

@Yongxuanzhang
Copy link
Member Author

/retest

@Yongxuanzhang Yongxuanzhang requested a review from dibyom July 6, 2022 00:30
@ywluogg
Copy link
Contributor

ywluogg commented Jul 6, 2022

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 6, 2022
@dibyom
Copy link
Member

dibyom commented Jul 6, 2022

/approve

Thanks @Yongxuanzhang :D

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dibyom, ywluogg

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 6, 2022
@tekton-robot tekton-robot merged commit 9b4bba2 into tektoncd:main Jul 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants