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

Add support for consuming whole array results in matrix #6603

Merged

Conversation

EmmaMunley
Copy link
Contributor

@EmmaMunley EmmaMunley commented Apr 28, 2023

Changes

This PR adds support for referencing whole array results produced by another PipelineTask as a matrix parameter value.

This feature request is necessary before promoting Matrix to beta.
For me details please see Issue #6110.

This closes issue #6602.

Co-authored-by: Yongxuan Zhang [email protected]
/kind feature

Submitter Checklist

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

  • Has Docs if any changes are user facing, including updates to minimum requirements e.g. Kubernetes version bumps
  • Has Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including functionality, content, code)
  • Has a kind label. You can add one by adding a comment on this PR that contains /kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tep
  • Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings). See some examples of good release notes.
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

TEP-0090: Pipeline Tasks may now reference whole array results in a Matrix. See https://github.com/tektoncd/pipeline/blob/09d422cff057f67170b4c2f76097ac6ffded33ef/docs/matrix.md?specifying-results-in-a-matrix#specifying-results-in-a-matrix docs for more information.

@tekton-robot tekton-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 28, 2023
@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/v1/pipeline_validation.go 99.4% 99.4% -0.0
pkg/apis/pipeline/v1beta1/pipeline_validation.go 99.1% 99.1% -0.0
pkg/reconciler/pipelinerun/pipelinerun.go 89.2% 89.2% 0.0
pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go 96.4% 95.8% -0.6

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1/pipeline_validation.go 99.4% 99.4% -0.0
pkg/apis/pipeline/v1beta1/pipeline_validation.go 99.1% 99.1% -0.0
pkg/reconciler/pipelinerun/pipelinerun.go 89.2% 89.2% 0.0
pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go 96.4% 95.8% -0.6

@jerop
Copy link
Member

jerop commented May 1, 2023

/assign

Copy link
Member

@lbernick lbernick left a comment

Choose a reason for hiding this comment

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

nice!!
Suggested release notes: "TEP-0090: Pipeline Tasks may now reference whole array results in a Matrix. See [link to docs] for more information."

docs/matrix.md Outdated Show resolved Hide resolved
pkg/reconciler/pipelinerun/pipelinerun.go Outdated Show resolved Hide resolved
pkg/apis/pipeline/v1/matrix_types.go Outdated Show resolved Hide resolved
@lbernick lbernick self-assigned this May 1, 2023
@EmmaMunley EmmaMunley force-pushed the whole-array-result-replacements-matrix branch from ecdf383 to 4e707a2 Compare May 3, 2023 22:39
@tekton-robot tekton-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 3, 2023
@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/v1/pipeline_validation.go 99.4% 99.4% -0.0
pkg/apis/pipeline/v1beta1/pipeline_validation.go 99.1% 99.1% -0.0
pkg/reconciler/pipelinerun/pipelinerun.go 89.2% 89.3% 0.1
pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go 96.4% 96.3% -0.1

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1/pipeline_validation.go 99.4% 99.4% -0.0
pkg/apis/pipeline/v1beta1/pipeline_validation.go 99.1% 99.1% -0.0
pkg/reconciler/pipelinerun/pipelinerun.go 89.2% 89.3% 0.1
pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go 96.4% 96.3% -0.1

Copy link
Member

@lbernick lbernick left a comment

Choose a reason for hiding this comment

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

LGTM, just have the same question that Jerop does (everything else is minor). Also, the release notes formatting is a bit weird-- can you make sure the doc link is included between the backticks so it gets into the release notes?

pkg/reconciler/pipelinerun/pipelinerun_test.go Outdated Show resolved Hide resolved
pkg/reconciler/pipelinerun/pipelinerun_test.go Outdated Show resolved Hide resolved
@EmmaMunley EmmaMunley force-pushed the whole-array-result-replacements-matrix branch from 4e707a2 to 4f1cdbe Compare May 4, 2023 15:13
@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/v1/pipeline_validation.go 99.4% 99.4% -0.0
pkg/apis/pipeline/v1beta1/pipeline_validation.go 99.1% 99.1% -0.0
pkg/reconciler/pipelinerun/pipelinerun.go 89.2% 89.3% 0.1
pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go 96.4% 96.3% -0.1

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1/pipeline_validation.go 99.4% 99.4% -0.0
pkg/apis/pipeline/v1beta1/pipeline_validation.go 99.1% 99.1% -0.0
pkg/reconciler/pipelinerun/pipelinerun.go 89.2% 89.3% 0.1
pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go 96.4% 96.3% -0.1

@EmmaMunley
Copy link
Contributor Author

/retest

@EmmaMunley EmmaMunley force-pushed the whole-array-result-replacements-matrix branch from 4f1cdbe to 7e5f686 Compare May 4, 2023 20:26
@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/v1/pipeline_validation.go 99.4% 99.4% -0.0
pkg/apis/pipeline/v1beta1/pipeline_validation.go 99.1% 99.1% -0.0
pkg/reconciler/pipelinerun/pipelinerun.go 89.2% 89.3% 0.1
pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go 96.4% 96.3% -0.1

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1/pipeline_validation.go 99.4% 99.4% -0.0
pkg/apis/pipeline/v1beta1/pipeline_validation.go 99.1% 99.1% -0.0
pkg/reconciler/pipelinerun/pipelinerun.go 89.2% 89.3% 0.1
pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go 96.4% 96.3% -0.1

@tekton-robot tekton-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 16, 2023
@EmmaMunley EmmaMunley force-pushed the whole-array-result-replacements-matrix branch from 7e5f686 to 97eba02 Compare May 22, 2023 17:38
@tekton-robot tekton-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 22, 2023
@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/v1/pipeline_validation.go 99.7% 99.7% -0.0
pkg/apis/pipeline/v1beta1/pipeline_validation.go 99.4% 99.4% -0.0
pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go 97.0% 93.9% -3.1

@tekton-robot tekton-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 21, 2023
@EmmaMunley EmmaMunley force-pushed the whole-array-result-replacements-matrix branch from c164f71 to 9bb9226 Compare June 21, 2023 14:21
@tekton-robot tekton-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jun 21, 2023
@EmmaMunley
Copy link
Contributor Author

/unhold

@tekton-robot tekton-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 21, 2023
@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/v1/pipeline_validation.go 99.1% 99.1% -0.0
pkg/apis/pipeline/v1beta1/pipeline_validation.go 98.8% 98.8% -0.0
pkg/reconciler/pipelinerun/pipelinerun.go 91.3% 91.5% 0.2
pkg/reconciler/pipelinerun/resources/resultrefresolution.go 92.4% 96.2% 3.8

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1/pipeline_validation.go 99.1% 99.1% -0.0
pkg/apis/pipeline/v1beta1/pipeline_validation.go 98.8% 98.8% -0.0
pkg/reconciler/pipelinerun/pipelinerun.go 91.3% 91.5% 0.2
pkg/reconciler/pipelinerun/resources/resultrefresolution.go 92.4% 95.2% 2.9

@EmmaMunley
Copy link
Contributor Author

/retest-required
#6772

pkg/reconciler/pipelinerun/resources/apply.go Outdated Show resolved Hide resolved
pkg/reconciler/pipelinerun/pipelinerun_test.go Outdated Show resolved Hide resolved
@@ -10443,6 +10600,373 @@ spec:
}
}

func TestReconciler_FailedPipelineTaskMatrixIdxResultsOutOfBounds(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

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

Should this test be in this PR? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, probably should have been in the last one. Opened a separate PR here just to add the test coverage: #6852

cc: @dibyom

@EmmaMunley EmmaMunley force-pushed the whole-array-result-replacements-matrix branch 2 times, most recently from 5ea6147 to b02bd60 Compare June 21, 2023 15:58
@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/v1/pipeline_validation.go 99.1% 99.1% -0.0
pkg/apis/pipeline/v1beta1/pipeline_validation.go 98.8% 98.8% -0.0
pkg/reconciler/pipelinerun/resources/resultrefresolution.go 92.4% 96.2% 3.8

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1/pipeline_validation.go 99.1% 99.1% -0.0
pkg/apis/pipeline/v1beta1/pipeline_validation.go 98.8% 98.8% -0.0
pkg/reconciler/pipelinerun/pipelinerun.go 91.3% 91.5% 0.2
pkg/reconciler/pipelinerun/resources/resultrefresolution.go 92.4% 96.2% 3.8

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1/pipeline_validation.go 99.1% 99.1% -0.0
pkg/apis/pipeline/v1beta1/pipeline_validation.go 98.8% 98.8% -0.0
pkg/reconciler/pipelinerun/resources/resultrefresolution.go 92.4% 95.2% 2.9

kind: TaskRun
name: pr-echo-platforms-2
pipelineTaskName: echo-platforms
provenance:
Copy link
Member

Choose a reason for hiding this comment

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

do we really need to compare the provenance/feature flags section here? Or can we ignore it in the comparison? (Otherwise, anytime we update a feature flag value we'd have to update this test making it brittle)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dibyom Added an ignoreProvenance flag
cc: @Yongxuanzhang

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dibyom

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 Jun 21, 2023
This commit adds support for referencing whole array results produced by another PipelineTask as a matrix parameter value.

This feature request is necessary before promoting Matrix to beta.
For more  details please see issue tektoncd#6110.

This closes issue tektoncd#6602.

Co-authored-by: Yongxuan Zhang  <[email protected]>
@EmmaMunley EmmaMunley force-pushed the whole-array-result-replacements-matrix branch from b02bd60 to f0e02ef Compare June 21, 2023 19:15
Copy link
Member

@Yongxuanzhang Yongxuanzhang left a comment

Choose a reason for hiding this comment

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

/lgtm
Thanks!! @EmmaMunley

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 21, 2023
@Yongxuanzhang
Copy link
Member

/meow

@tekton-robot
Copy link
Collaborator

@Yongxuanzhang: cat image

In response to this:

/meow

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/v1/pipeline_validation.go 99.1% 99.1% -0.0
pkg/apis/pipeline/v1beta1/pipeline_validation.go 98.8% 98.8% -0.0
pkg/reconciler/pipelinerun/resources/resultrefresolution.go 92.4% 96.2% 3.8

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1/pipeline_validation.go 99.1% 99.1% -0.0
pkg/apis/pipeline/v1beta1/pipeline_validation.go 98.8% 98.8% -0.0
pkg/reconciler/pipelinerun/resources/resultrefresolution.go 92.4% 96.2% 3.8

@tekton-robot tekton-robot merged commit 381a420 into tektoncd:main Jun 21, 2023
@EmmaMunley EmmaMunley deleted the whole-array-result-replacements-matrix branch June 21, 2023 19:55
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/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants