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-0075]Pipeline results support object #5088

Merged
merged 1 commit into from
Jul 14, 2022

Conversation

Yongxuanzhang
Copy link
Member

@Yongxuanzhang Yongxuanzhang commented Jul 6, 2022

Changes

This is part of work in TEP-0075.
Previous to this commit, we have added support for pipeline array
results. This commit supports object results, so pipeline can emit
object results as whole or emit elements of the object from tasks.
Before this commit the pipeline level result only support string and
array.

/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 object results and object element reference for pipeline level as an alpha feature.

A pipeline can specify a type to create object result, such as:

    results:
      - name: object-results
        type: object
        description: whole object
        value: $(tasks.task1.results.object-results[*])
      - name:  object-results-element
        type: string
        description: object element
        value: $(tasks.task2.results.array-results.keyName)

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

echo -n "{\"foo\":\"bar\",\"hello\":\"world\"}" | tee $(results.object-results.path)

The pipeline results can refer to task results to collect them.
This feature is part of the TEP-0075. 

@tekton-robot
Copy link
Collaborator

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@tekton-robot tekton-robot added kind/feature Categorizes issue or PR as related to a new feature. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Jul 6, 2022
@tekton-robot tekton-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. 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. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 6, 2022
@Yongxuanzhang Yongxuanzhang marked this pull request as ready for review July 6, 2022 15:52
@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 Jul 6, 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/reconciler/pipelinerun/resources/apply.go 99.2% 99.3% 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/reconciler/pipelinerun/resources/apply.go 99.2% 98.6% -0.7

@ywluogg
Copy link
Contributor

ywluogg commented Jul 6, 2022

#4723

@ywluogg
Copy link
Contributor

ywluogg commented Jul 7, 2022

@Yongxuanzhang
Copy link
Member Author

Do you need to add test cases for these in https://github.com/tektoncd/pipeline/blob/main/pkg/reconciler/pipelinerun/pipelinerun_test.go?

you mean test from reconcile?

@ywluogg
Copy link
Contributor

ywluogg commented Jul 7, 2022

I think testing from both places seem more robust, since apply.go will be called there, but probably it wouldn't block this PR. You can add a TODO for that

@Yongxuanzhang
Copy link
Member Author

I think testing from both places seem more robust, since apply.go will be called there, but probably it wouldn't block this PR. You can add a TODO for that

Sure!

@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/resultref.go 100.0% 96.4% -3.6
pkg/reconciler/pipelinerun/resources/apply.go 99.2% 97.9% -1.4

@ywluogg
Copy link
Contributor

ywluogg commented Jul 7, 2022

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 7, 2022
@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Jul 7, 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/param_types.go 98.2% 98.1% -0.0
pkg/reconciler/pipelinerun/pipelinerun.go 86.3% 86.1% -0.3
pkg/reconciler/pipelinerun/resources/apply.go 99.2% 98.7% -0.5
pkg/substitution/substitution.go 60.7% 60.2% -0.5

@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/param_types.go 98.2% 98.1% -0.0
pkg/reconciler/pipelinerun/pipelinerun.go 86.3% 86.1% -0.3
pkg/reconciler/pipelinerun/resources/apply.go 99.2% 98.7% -0.5
pkg/substitution/substitution.go 60.7% 61.0% 0.3

@Yongxuanzhang
Copy link
Member Author

/retest

@dibyom
Copy link
Member

dibyom commented Jul 13, 2022

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 13, 2022
This is part of work in TEP-0075.
Previous to this commit, we have added support for pipeline array
results. This commit supports object results, so pipeline can emit
object results as whole or emit elements of the object from tasks.
Before this commit the pipeline level result only support string and
array.
@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Jul 13, 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/param_types.go 98.2% 98.1% -0.0
pkg/reconciler/pipelinerun/pipelinerun.go 86.1% 85.8% -0.3
pkg/reconciler/pipelinerun/resources/apply.go 99.3% 98.8% -0.5
pkg/substitution/substitution.go 61.9% 62.2% 0.3

@ywluogg
Copy link
Contributor

ywluogg commented Jul 14, 2022

/lgtm

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

/retest

@Yongxuanzhang
Copy link
Member Author

/retest pull-pipeline-kind-k8s-v1-21-e2e

@tekton-robot
Copy link
Collaborator

@Yongxuanzhang: The /retest command does not accept any targets.
The following commands are available to trigger required jobs:

  • /test pull-tekton-pipeline-alpha-integration-tests
  • /test pull-tekton-pipeline-build-tests
  • /test pull-tekton-pipeline-integration-tests
  • /test tekton-pipeline-unit-tests

The following commands are available to trigger optional jobs:

  • /test pull-tekton-pipeline-go-coverage
  • /test pull-tekton-pipeline-kind-alpha-integration-tests
  • /test pull-tekton-pipeline-kind-alpha-yaml-tests
  • /test pull-tekton-pipeline-kind-integration-tests
  • /test pull-tekton-pipeline-kind-yaml-tests

Use /test all to run the following jobs that were automatically triggered:

  • pull-tekton-pipeline-alpha-integration-tests
  • pull-tekton-pipeline-build-tests
  • pull-tekton-pipeline-go-coverage
  • pull-tekton-pipeline-integration-tests
  • pull-tekton-pipeline-unit-tests

In response to this:

/retest pull-pipeline-kind-k8s-v1-21-e2e

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.

@Yongxuanzhang
Copy link
Member Author

/test pull-pipeline-kind-k8s-v1-21-e2e

@tekton-robot
Copy link
Collaborator

@Yongxuanzhang: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test pull-tekton-pipeline-alpha-integration-tests
  • /test pull-tekton-pipeline-build-tests
  • /test pull-tekton-pipeline-integration-tests
  • /test tekton-pipeline-unit-tests

The following commands are available to trigger optional jobs:

  • /test pull-tekton-pipeline-go-coverage
  • /test pull-tekton-pipeline-kind-alpha-integration-tests
  • /test pull-tekton-pipeline-kind-alpha-yaml-tests
  • /test pull-tekton-pipeline-kind-integration-tests
  • /test pull-tekton-pipeline-kind-yaml-tests

Use /test all to run the following jobs that were automatically triggered:

  • pull-tekton-pipeline-alpha-integration-tests
  • pull-tekton-pipeline-build-tests
  • pull-tekton-pipeline-go-coverage
  • pull-tekton-pipeline-integration-tests
  • pull-tekton-pipeline-unit-tests

In response to this:

/test pull-pipeline-kind-k8s-v1-21-e2e

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/param_types.go 98.2% 98.1% -0.0
pkg/reconciler/pipelinerun/pipelinerun.go 86.1% 85.8% -0.3
pkg/reconciler/pipelinerun/resources/apply.go 99.3% 98.8% -0.5
pkg/substitution/substitution.go 61.9% 62.2% 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/param_types.go 98.2% 98.1% -0.0
pkg/reconciler/pipelinerun/pipelinerun.go 86.1% 85.8% -0.3
pkg/reconciler/pipelinerun/resources/apply.go 99.3% 98.8% -0.5
pkg/substitution/substitution.go 61.9% 62.2% 0.3

@Yongxuanzhang
Copy link
Member Author

/retest

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.

5 participants