-
Notifications
You must be signed in to change notification settings - Fork 137
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
Parse Type-hinted StepResults for the Provenance #1065
Comments
/good-first-issue |
@chitrangpatel: Please ensure the request meets the requirements listed here. If this request no longer meets these requirements, the label can be removed In response to this:
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. |
cc @lcarva @wlynch @aaron-prindle Looking for feedback. |
/assign |
No objections! My guess is things that are produced by steps but not surfaced to the Task should be byproducts though? So a little bit different than the Task -> Pipeline extraction. |
I think we can rely on I can imagine a case where a git-clone StepAction produces |
Summarizing the discussion from Slack and adding some more thoughts: Context: Proposal:
Pros:
Cons:
Other thoughts:
The solution where a difference in the behavior of Chains based on the BuildType might be ok here but I wanted to try and convince everyone that treating type-hinted StepResults as subjects is not a bad thing. Thoughts @wlynch (hopefully, I didn't miss anything major)? |
Synced offline with @wlynch ProposalAdd an extra key Pros
ExampleapiVersion: tekton.dev/v1alpha1
kind: StepAction
metadata:
name: gcs-upload
spec:
image: gcs
params:
- name: isBuildArtifact
description: Should the file/folder you are uploading be considered as a build artifact (subject) or a byProduct?
default: "false"
results:
- name: upload_ARTIFACT_OUTPUT
type: object
script: |
echo {"uri:" ..., "digest": ..., "isBuildArtifact": "$(params.isBuildArtifact)"} | tee $(step.results.upload_ARTIFACT_OUTPUT.path)
---
apiVersion: tekton.dev/v1
kind: TaskRun
spec:
params:
- name: isBuildArtifact
value: "true"
taskSpec:
steps:
- name: step-producing-artifact
ref:
name: gcs-upload
params:
- name: isBuildArtifact
value: $(params.isBuildArtifact) |
/assign @renzor |
@chitrangpatel: GitHub didn't allow me to assign the following users: renzor. 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. In response to this:
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. |
/assign me |
@renzodavid9: GitHub didn't allow me to assign the following users: me. 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. In response to this:
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. |
/assign @renzodavid9 |
Thanks @renzodavid9 for enabling this 🎉 |
Feature request
Parse type-hinted
StepResults
and surface them appropriately in the provenanceUse case
StepActions were released in
Tekton Pipelines v0.54.0
. As a part of that, we introducedStepResults
.StepResults
are not automatically surfaced to TaskResults. Users explicitly need to fetch them like they do forPipelineResults
fromTaskResults
. As a result, if a type-hintedStepResult
is not explicitly surfaced by the user then it will go unnoticed by Chains and thus not be surfaced as aResolvedDependency/Material
,Subject
orByproduct
.The solution is simple. The formatter just needs to additionally look into the
StepState
forStepResults
.Proposal
Add an extra key
isBuildArtifact
with a boolean value defaulted tofalse
to the Type-hinted Object StepResults. When Chains parses the step results, it can look for that field and insert the output artifact intosubject
orbyProducts
. In the new Artifacts Struct defined in https://github.com/tektoncd/community/blob/main/teps/0147-tekton-artifacts-phase1.md, we can add a similar field tooutputs
.Pros
StepAction/Task
can actually ask the intent to thePipeline/TaskRun
via params.Pipeline
that really understands the complete picture, it can indicate the nature of the artifact that the underlyingStepAction/Task
was used to fetch (i.e.subject
or abyProduct
).Example
Behavior amongst Task Results, Pipeline Results and StepResults
Based on extensive discussions in the Tekton Chains WG, we've reached the following conclusion:.
To provide a consistent behavior across TaskResults, PipelineResults and StepResults we propose the following.
For non-object type-hinted results, we assume that they are all
byProducts
.For object results, we assume that by default
*ARTIFACT_OUTPUTS
arebyProducts
. If a matching keyisBuildArtifact
is found and is set totrue
then Chains considers it as asubject
.Note that this currently not the behavior for
Task/Pipeline Results
(they aresubjects
by default). This behaviour will be made consistent withStepResults
so that across the board, users can expect to do the same thing. i.e. declare something as abuild Artifact
to treat it as asubject
.To not break the users immediately, we, propose gating this behind
slsa/v2alpha4
so that users currently usingslsa/v2alpha2,3
do not experience this change. However, once we mature toslsa/v2beta1
, we will deprecate older alpha versions and this (i.e.*ARTIFACT_OUTPUTS
arebyProducts
by default and that users have to specifically declare it as asubject
) will be the expected behavior.The text was updated successfully, but these errors were encountered: