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-0142: Surface step results via termination message #7349

Conversation

chitrangpatel
Copy link
Member

@chitrangpatel chitrangpatel commented Nov 10, 2023

This PR surfaces step results (i.e results written to $(step.results.<resultName>.path)) via termination messages. A followup PR will handle surfacing the results via sidecar logs.
The use of $(step.results.<resultName>.path) is currently only available in StepActions not inlined steps.

This PR is part of issue #7259.

Changes

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

[WIP] Surface step results via termination message

/kind feature

@tekton-robot tekton-robot added kind/feature Categorizes issue or PR as related to a new feature. release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Nov 10, 2023
@tekton-robot tekton-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Nov 10, 2023
@chitrangpatel
Copy link
Member Author

/hold wait for #7347 to get merged.

@tekton-robot tekton-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 10, 2023
@chitrangpatel chitrangpatel force-pushed the step-action-results-termination-message branch 2 times, most recently from 751dda7 to ad58095 Compare November 13, 2023 15:57
@tekton-robot tekton-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Nov 13, 2023
@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
cmd/entrypoint/main.go 11.6% 11.0% -0.6
pkg/entrypoint/entrypointer.go 87.6% 80.8% -6.8
pkg/pod/entrypoint.go 93.4% 76.0% -17.4
pkg/reconciler/taskrun/resources/apply.go 99.3% 98.1% -1.3

@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
cmd/entrypoint/main.go 11.6% 11.0% -0.6
pkg/entrypoint/entrypointer.go 87.6% 80.8% -6.8
pkg/pod/entrypoint.go 93.4% 76.0% -17.4
pkg/reconciler/taskrun/resources/apply.go 99.3% 98.1% -1.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
cmd/entrypoint/main.go 11.6% 11.0% -0.6
pkg/entrypoint/entrypointer.go 87.6% 80.8% -6.8
pkg/pod/entrypoint.go 93.4% 76.0% -17.4
pkg/reconciler/taskrun/resources/apply.go 99.3% 98.1% -1.3

Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

Steps write results somewhere (different than /tekton/results I guess) because:

  • we don't want to implicitly set them to TaskRun (it would probably cause an error)
  • we don't want to have on step overwrite the result of another

Am I right ?

Doing that, we end up making /tekton/steps writeable, which I think, is a problem. We should try to find "another place" to write step results. I wonder if we could prefix the result with the step name or something in /tekton/results instead, and somehow filter those by default (if not bound) ?

pkg/pod/pod.go Outdated Show resolved Hide resolved
@chitrangpatel chitrangpatel force-pushed the step-action-results-termination-message branch from ad58095 to 56e6fe9 Compare November 13, 2023 17:07
@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
cmd/entrypoint/main.go 11.6% 11.0% -0.6
pkg/entrypoint/entrypointer.go 87.6% 80.8% -6.8
pkg/pod/entrypoint.go 93.4% 76.0% -17.4
pkg/reconciler/taskrun/resources/apply.go 99.3% 98.1% -1.3

@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
cmd/entrypoint/main.go 11.6% 11.0% -0.6
pkg/entrypoint/entrypointer.go 87.6% 80.8% -6.8
pkg/pod/entrypoint.go 93.4% 76.0% -17.4
pkg/reconciler/taskrun/resources/apply.go 99.3% 98.1% -1.3

@chitrangpatel
Copy link
Member Author

chitrangpatel commented Nov 13, 2023

Steps write results somewhere (different than /tekton/results I guess) because:

  • we don't want to implicitly set them to TaskRun (it would probably cause an error)
  • we don't want to have on step overwrite the result of another

Am I right ?

Yes, exactly.

Doing that, we end up making /tekton/steps writeable, which I think, is a problem. We should try to find "another place" to write step results. I wonder if we could prefix the result with the step name or something in /tekton/results instead, and somehow filter those by default (if not bound) ?

Yes, or I wonder if we could make the step dir inside /tekton/results and write the results there /tekton/results/stepName/resultFile? Instead of making /tekton/steps writeable and then doing /tekton/steps/stepName/resultFile?

Writing StepAction Results inside step directories even inside /tekton/results will keep it safe from accidental overwrites. e.g $(results.<resultName>.path) would convert to /tekton/results/<resultName> while $(step.results.<resultName>.path) would convert to /tekton/results/<stepName>/<resultName>.

WDYT?

@chitrangpatel chitrangpatel force-pushed the step-action-results-termination-message branch from 56e6fe9 to d0c55e0 Compare November 13, 2023 17:45
@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
cmd/entrypoint/main.go 11.6% 10.8% -0.8
pkg/entrypoint/entrypointer.go 87.6% 80.8% -6.8
pkg/pod/entrypoint.go 93.4% 76.0% -17.4
pkg/reconciler/taskrun/resources/apply.go 99.3% 98.1% -1.3

@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
cmd/entrypoint/main.go 11.6% 10.8% -0.8
pkg/entrypoint/entrypointer.go 87.6% 80.8% -6.8
pkg/pod/entrypoint.go 93.4% 76.0% -17.4
pkg/reconciler/taskrun/resources/apply.go 99.3% 98.1% -1.3

@chitrangpatel chitrangpatel force-pushed the step-action-results-termination-message branch from 8a9cbbe to f8732b5 Compare November 13, 2023 18:34
@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
cmd/entrypoint/main.go 11.6% 10.8% -0.8
pkg/entrypoint/entrypointer.go 87.6% 80.8% -6.8
pkg/pod/entrypoint.go 93.4% 76.0% -17.4

@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
cmd/entrypoint/main.go 11.6% 10.8% -0.8
pkg/entrypoint/entrypointer.go 87.6% 80.8% -6.8
pkg/pod/entrypoint.go 93.4% 76.0% -17.4
pkg/reconciler/taskrun/resources/apply.go 99.3% 98.1% -1.3

@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
cmd/entrypoint/main.go 11.6% 10.8% -0.8
pkg/entrypoint/entrypointer.go 87.6% 80.8% -6.8
pkg/pod/entrypoint.go 93.4% 76.0% -17.4
pkg/reconciler/taskrun/resources/apply.go 99.3% 98.1% -1.3

cmd/entrypoint/main.go Outdated Show resolved Hide resolved
pkg/pod/entrypoint.go Outdated Show resolved Hide resolved
pkg/entrypoint/entrypointer.go Outdated Show resolved Hide resolved
@chitrangpatel chitrangpatel force-pushed the step-action-results-termination-message branch from f8732b5 to 2f16970 Compare November 14, 2023 04:57
pkg/pod/entrypoint.go Outdated Show resolved Hide resolved
@chitrangpatel chitrangpatel force-pushed the step-action-results-termination-message branch from 86ddebf to 3da292c Compare November 22, 2023 21:34
@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/v1beta1/taskrun_conversion.go 93.3% 93.6% 0.3
pkg/entrypoint/entrypointer.go 87.6% 87.0% -0.6
pkg/pod/entrypoint.go 93.4% 94.1% 0.7
pkg/pod/status.go 91.7% 92.1% 0.4
pkg/reconciler/taskrun/resources/apply.go 99.3% 99.4% 0.0
pkg/result/result.go 85.7% 86.7% 1.0

@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/v1beta1/taskrun_conversion.go 93.3% 93.6% 0.3
pkg/entrypoint/entrypointer.go 87.6% 87.0% -0.6
pkg/pod/entrypoint.go 93.4% 94.1% 0.7
pkg/pod/status.go 91.7% 92.1% 0.4
pkg/reconciler/taskrun/resources/apply.go 99.3% 99.4% 0.0
pkg/result/result.go 85.7% 86.7% 1.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/taskrun_conversion.go 93.3% 93.6% 0.3
pkg/entrypoint/entrypointer.go 87.6% 87.0% -0.6
pkg/pod/entrypoint.go 93.4% 94.1% 0.7
pkg/pod/status.go 91.7% 92.1% 0.4
pkg/reconciler/taskrun/resources/apply.go 99.3% 99.4% 0.0
pkg/result/result.go 85.7% 86.7% 1.0

@chitrangpatel chitrangpatel force-pushed the step-action-results-termination-message branch from 3da292c to 9a970dd Compare November 22, 2023 22:46
@tekton-robot tekton-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Nov 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/v1beta1/taskrun_conversion.go 93.3% 93.6% 0.3
pkg/entrypoint/entrypointer.go 87.6% 87.0% -0.6
pkg/pod/entrypoint.go 93.4% 94.1% 0.7
pkg/pod/status.go 91.7% 92.1% 0.4
pkg/reconciler/taskrun/resources/apply.go 99.3% 99.4% 0.0
pkg/result/result.go 85.7% 86.7% 1.0

@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/v1beta1/taskrun_conversion.go 93.3% 93.6% 0.3
pkg/entrypoint/entrypointer.go 87.6% 87.0% -0.6
pkg/pod/entrypoint.go 93.4% 94.1% 0.7
pkg/pod/status.go 91.7% 92.1% 0.4
pkg/reconciler/taskrun/resources/apply.go 99.3% 99.4% 0.0
pkg/result/result.go 85.7% 86.7% 1.0

test/stepaction_results_test.go Outdated Show resolved Hide resolved
pkg/pod/status_test.go Show resolved Hide resolved
pkg/pod/entrypoint.go Show resolved Hide resolved
@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Yongxuanzhang

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

@chitrangpatel chitrangpatel force-pushed the step-action-results-termination-message branch from 9a970dd to 9ec9359 Compare November 23, 2023 00:24
@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/v1beta1/taskrun_conversion.go 93.3% 93.6% 0.3
pkg/entrypoint/entrypointer.go 87.6% 87.0% -0.6
pkg/pod/entrypoint.go 93.4% 94.1% 0.7
pkg/pod/status.go 91.7% 92.1% 0.4
pkg/reconciler/taskrun/resources/apply.go 99.3% 99.4% 0.0
pkg/result/result.go 85.7% 86.7% 1.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/taskrun_conversion.go 93.3% 93.6% 0.3
pkg/entrypoint/entrypointer.go 87.6% 87.0% -0.6
pkg/pod/entrypoint.go 93.4% 94.1% 0.7
pkg/pod/status.go 91.7% 92.1% 0.4
pkg/reconciler/taskrun/resources/apply.go 99.3% 99.4% 0.0
pkg/result/result.go 85.7% 86.7% 1.0

@chitrangpatel chitrangpatel force-pushed the step-action-results-termination-message branch from 9ec9359 to e505a85 Compare November 23, 2023 02:09
@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/taskrun_conversion.go 93.3% 93.6% 0.3
pkg/entrypoint/entrypointer.go 87.6% 87.0% -0.6
pkg/pod/entrypoint.go 93.4% 94.1% 0.7
pkg/pod/status.go 91.7% 92.1% 0.4
pkg/reconciler/taskrun/resources/apply.go 99.3% 99.4% 0.0
pkg/result/result.go 85.7% 86.7% 1.0

@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/v1beta1/taskrun_conversion.go 93.3% 93.6% 0.3
pkg/entrypoint/entrypointer.go 87.6% 87.0% -0.6
pkg/pod/entrypoint.go 93.4% 94.1% 0.7
pkg/pod/status.go 91.7% 92.1% 0.4
pkg/reconciler/taskrun/resources/apply.go 99.3% 99.4% 0.0
pkg/result/result.go 85.7% 86.7% 1.0

This PR surfaces step results (i.e results written to $(step.results.<resultName>.path)) via termination messages.  A followup PR will handle surfacing the results via sidecar logs.
@chitrangpatel chitrangpatel force-pushed the step-action-results-termination-message branch from e505a85 to 39af932 Compare November 23, 2023 04:54
@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/taskrun_conversion.go 93.3% 93.6% 0.3
pkg/entrypoint/entrypointer.go 87.6% 87.0% -0.6
pkg/pod/entrypoint.go 93.4% 94.1% 0.7
pkg/pod/status.go 91.7% 92.1% 0.4
pkg/reconciler/taskrun/resources/apply.go 99.3% 99.4% 0.0
pkg/result/result.go 85.7% 86.7% 1.0

@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/v1beta1/taskrun_conversion.go 93.3% 93.6% 0.3
pkg/entrypoint/entrypointer.go 87.6% 87.0% -0.6
pkg/pod/entrypoint.go 93.4% 94.1% 0.7
pkg/pod/status.go 91.7% 92.1% 0.4
pkg/reconciler/taskrun/resources/apply.go 99.3% 99.4% 0.0
pkg/result/result.go 85.7% 86.7% 1.0

Copy link
Member

@jerop jerop left a comment

Choose a reason for hiding this comment

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

🎉

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 23, 2023
@tekton-robot tekton-robot merged commit b395663 into tektoncd:main Nov 23, 2023
13 checks passed
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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants