-
Notifications
You must be signed in to change notification settings - Fork 133
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
Move external paramenters and resolved dependencies logic out of v2alpha3 #1109
Move external paramenters and resolved dependencies logic out of v2alpha3 #1109
Conversation
Hi @renzodavid9. Thanks for your PR. I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
/ok-to-test |
The following is the coverage report on the affected files.
|
pkg/chains/formats/slsa/internal/external_parameters/external_parameters.go
Show resolved
Hide resolved
pkg/chains/formats/slsa/internal/external_parameters/external_parameters.go
Show resolved
Hide resolved
c1c25c3
to
a8bcb7c
Compare
The following is the coverage report on the affected files.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Just left a few minor comments.
rd, err := addTasks(tr) | ||
if err != nil { | ||
logger.Errorf("error storing taskRun %s, error: %s", t.Name, err) | ||
continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the error be returned instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I can understand, looks like the idea was to be able to process the other tasks even if one of them couldn't be processed 🤔, returning here will change this behavior; this is the current behavior for v2alpha3. Also from what I can see, the only way to get an error here is from the AddTektonTaskDescriptor
function, from the json.Marshal
call.
pkg/chains/formats/slsa/internal/resolved_dependencies/resolved_dependencies.go
Outdated
Show resolved
Hide resolved
pkg/chains/formats/slsa/internal/resolved_dependencies/resolved_dependencies.go
Show resolved
Hide resolved
// add task resources | ||
// ===== | ||
// convert to v1beta1 and add any task resources | ||
serializedResources := tro.Annotations["tekton.dev/v1beta1-spec-resources"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move the annotation name to a variable?
Do we need to only perform the steps below if serializedResources
is not empty?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure! annotation moved to a variable.
If serializedResources
is empty the json.Marshall
call will fail, and won't set the shouldReplace
to true
. We still have to try to get the results from v1beta1 TaskRun object, but we are reading the taskrun resources from another source. So I think it make sense to not check if serializedResources
is empty.
pkg/chains/formats/slsa/internal/resolved_dependencies/resolved_dependencies_test.go
Outdated
Show resolved
Hide resolved
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: chitrangpatel, lcarva 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 |
…pha3 This is a refactor in preparation for v2alpha4 which uses in its majority the same logic as v2alpha3. Logici and tests moved to chains/formats/slsa/internal to be able to use it from different versions. Current behavior shouldn't change with these changes.
a8bcb7c
to
2e2a4b1
Compare
The following is the coverage report on the affected files.
|
Thanks @renzodavid9! If there are still nits that need to be resolved, we can do that in the next PR. |
/retest |
Related with: #1065
This is a refactor in preparation for
v2alpha4
which uses in its majority the same logic asv2alpha3
.Logic and tests moved to
chains/formats/slsa/internal
to be able to use it from different versions:Current behavior shouldn't change with these changes.
This refactor will be use as base to enable v2alpha4 for TaskRuns, diff can be preview here
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
functionality, content, code)