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

PipelineRuns with v2alpha4 to process StepActions #1118

Merged

Conversation

renzodavid9
Copy link
Contributor

@renzodavid9 renzodavid9 commented May 10, 2024

This new version will now process the information from any associated StepAction from the executed PipelineRun.

Also, the way chains read results from PipelineRuns to populate the subjects field is changing: now the user has to explicitly mark a result as a subject using an bject type-hinted tag (*ARTIFACT_OUTPUTS) + the new isBuildArtifact property in the value.

Refactors to share logic between v2alph3 and v2alpha4.

Changes

Submitter Checklist

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

  • Has Docs included if any changes are user facing
  • Has 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 updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings)
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

New v2alpha4 formatter for PipelineRuns that reads type-hinted result from associated StepActions

@tekton-robot tekton-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 10, 2024
@tekton-robot tekton-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label May 10, 2024
@tekton-robot
Copy link

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@tekton-robot tekton-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 10, 2024
@renzodavid9 renzodavid9 force-pushed the 1065-stepactions-with-pipelines branch from 12d8357 to 265c09d Compare May 10, 2024 23:29
@renzodavid9 renzodavid9 changed the title 1065 stepactions with pipelines PipelineRuns with v2alpha4 to process StepActions May 11, 2024
@renzodavid9 renzodavid9 force-pushed the 1065-stepactions-with-pipelines branch 4 times, most recently from 0cbce63 to 9250178 Compare May 14, 2024 15:38
Copy link
Contributor

@khrm khrm left a comment

Choose a reason for hiding this comment

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

/ok-to-test

@tekton-robot tekton-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 15, 2024
@tekton-robot
Copy link

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

File Old Coverage New Coverage Delta
pkg/artifacts/signable.go 70.6% 74.2% 3.6
pkg/chains/formats/format.go Do not exist 20.0%
pkg/chains/formats/format.go Do not exist 20.0%
pkg/chains/formats/format.go Do not exist 10.0%
pkg/chains/formats/format.go Do not exist 20.0%
pkg/chains/formats/format.go Do not exist 20.0%
pkg/chains/formats/format.go Do not exist 10.0%
pkg/chains/formats/format.go Do not exist 100.0%
pkg/chains/formats/format.go Do not exist 20.0%
pkg/chains/formats/slsa/extract/extract.go 62.3% 65.8% 3.5
pkg/chains/formats/slsa/internal/build_definition/build_definition.go Do not exist 84.6%
pkg/chains/formats/slsa/internal/material/material.go 92.3% 92.9% 0.6
pkg/chains/formats/slsa/internal/metadata/metadata.go Do not exist 100.0%
pkg/chains/formats/slsa/internal/provenance/provenance.go Do not exist 0.0%
pkg/chains/formats/slsa/internal/provenance/provenance.go Do not exist 100.0%
pkg/chains/formats/slsa/internal/provenance/provenance.go Do not exist 100.0%
pkg/chains/formats/slsa/internal/provenance/provenance.go Do not exist 0.0%
pkg/chains/formats/slsa/internal/provenance/provenance.go Do not exist 100.0%
pkg/chains/formats/slsa/internal/provenance/provenance.go Do not exist 0.0%
pkg/chains/formats/slsa/internal/provenance/provenance.go Do not exist 100.0%
pkg/chains/formats/slsa/internal/provenance/provenance.go Do not exist 100.0%
pkg/chains/formats/slsa/internal/provenance/provenance.go Do not exist 0.0%
pkg/chains/formats/slsa/internal/provenance/provenance.go Do not exist 0.0%
pkg/chains/formats/slsa/internal/resolved_dependencies/resolved_dependencies.go 87.6% 85.7% -1.9
pkg/chains/formats/slsa/internal/results/results.go Do not exist 88.9%
pkg/chains/formats/slsa/v2alpha3/internal/pipelinerun/pipelinerun.go 83.8% 81.2% -2.5
pkg/chains/formats/slsa/v2alpha3/internal/taskrun/taskrun.go 86.5% 81.2% -5.2
pkg/chains/formats/slsa/v2alpha4/internal/pipelinerun/pipelinerun.go Do not exist 59.3%
pkg/chains/formats/slsa/v2alpha4/internal/taskrun/taskrun.go Do not exist 80.0%
pkg/chains/formats/slsa/v2alpha4/slsav2.go Do not exist 75.0%
pkg/chains/objects/objects.go 32.7% 23.9% -8.8

@renzodavid9 renzodavid9 force-pushed the 1065-stepactions-with-pipelines branch from 9250178 to 9a04b10 Compare May 16, 2024 17:27
@tekton-robot tekton-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 21, 2024
@renzodavid9 renzodavid9 force-pushed the 1065-stepactions-with-pipelines branch from 9a04b10 to 08fd75f Compare May 21, 2024 20:29
@tekton-robot tekton-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 21, 2024
@renzodavid9 renzodavid9 force-pushed the 1065-stepactions-with-pipelines branch 3 times, most recently from 5d27a66 to 2586135 Compare May 21, 2024 21:34
@renzodavid9 renzodavid9 marked this pull request as ready for review May 21, 2024 22:15
@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 May 21, 2024
@tekton-robot tekton-robot requested a review from wlynch May 21, 2024 22:15
@renzodavid9
Copy link
Contributor Author

/retest

@tekton-robot
Copy link

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

File Old Coverage New Coverage Delta
pkg/chains/formats/slsa/internal/build_definition/build_definition.go 80.0% 77.8% -2.2
pkg/chains/formats/slsa/internal/resolved_dependencies/resolved_dependencies.go 87.9% 85.7% -2.2
pkg/chains/formats/slsa/v2alpha3/internal/pipelinerun/pipelinerun.go 78.5% 81.2% 2.8
pkg/chains/formats/slsa/v2alpha4/internal/pipelinerun/pipelinerun.go Do not exist 59.3%
pkg/chains/formats/slsa/v2alpha4/slsav2.go 85.7% 75.0% -10.7
pkg/chains/objects/objects.go 25.6% 23.9% -1.7

@chitrangpatel
Copy link
Contributor

Please fix the linter errors and add a release note.

@renzodavid9 renzodavid9 force-pushed the 1065-stepactions-with-pipelines branch from 2586135 to 6872bd3 Compare May 22, 2024 13:54
@tekton-robot
Copy link

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

File Old Coverage New Coverage Delta
pkg/chains/formats/slsa/internal/build_definition/build_definition.go 80.0% 77.8% -2.2
pkg/chains/formats/slsa/internal/resolved_dependencies/resolved_dependencies.go 87.9% 85.7% -2.2
pkg/chains/formats/slsa/v2alpha3/internal/pipelinerun/pipelinerun.go 78.5% 81.2% 2.8
pkg/chains/formats/slsa/v2alpha4/internal/pipelinerun/pipelinerun.go Do not exist 59.3%
pkg/chains/formats/slsa/v2alpha4/slsav2.go 85.7% 75.0% -10.7
pkg/chains/objects/objects.go 25.6% 23.8% -1.8

@renzodavid9 renzodavid9 force-pushed the 1065-stepactions-with-pipelines branch 2 times, most recently from 3522d9d to c79c0e1 Compare May 22, 2024 14:17
@tekton-robot
Copy link

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

File Old Coverage New Coverage Delta
pkg/chains/formats/slsa/internal/build_definition/build_definition.go 80.0% 77.8% -2.2
pkg/chains/formats/slsa/internal/resolved_dependencies/resolved_dependencies.go 87.9% 85.7% -2.2
pkg/chains/formats/slsa/v2alpha3/internal/pipelinerun/pipelinerun.go 78.5% 81.2% 2.8
pkg/chains/formats/slsa/v2alpha4/internal/pipelinerun/pipelinerun.go Do not exist 59.3%
pkg/chains/formats/slsa/v2alpha4/slsav2.go 85.7% 75.0% -10.7
pkg/chains/objects/objects.go 25.6% 23.8% -1.8

This new version will now process the information from any associated StepAction from the executed PipelineRun when `artifacts.pipelinerun.enable-deep-inspection` is set to `true`.

Also, the way chains read results from PipelineRuns to populate the `subjects` field is changing: now the user has to explicitly mark a result as a subject using an object type-hinted tag (*ARTIFACT_OUTPUTS) + the new `isBuildArtifact` property in the value.

Refactors to share logic between v2alph3 and v2alpha4.
@renzodavid9 renzodavid9 force-pushed the 1065-stepactions-with-pipelines branch from c79c0e1 to e72c6e7 Compare May 22, 2024 14:40
@tekton-robot
Copy link

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

File Old Coverage New Coverage Delta
pkg/artifacts/signable.go 73.9% 73.4% -0.5
pkg/chains/formats/slsa/internal/build_definition/build_definition.go 80.0% 77.8% -2.2
pkg/chains/formats/slsa/internal/provenance/provenance.go 0.0% 76.9% 76.9
pkg/chains/formats/slsa/internal/provenance/provenance.go Do not exist 76.9%
pkg/chains/formats/slsa/internal/provenance/provenance.go Do not exist 0.0%
pkg/chains/formats/slsa/internal/provenance/provenance.go Do not exist 0.0%
pkg/chains/formats/slsa/internal/provenance/provenance.go Do not exist 76.9%
pkg/chains/formats/slsa/internal/provenance/provenance.go Do not exist 0.0%
pkg/chains/formats/slsa/internal/provenance/provenance.go Do not exist 76.9%
pkg/chains/formats/slsa/internal/provenance/provenance.go Do not exist 0.0%
pkg/chains/formats/slsa/internal/provenance/provenance.go Do not exist 76.9%
pkg/chains/formats/slsa/internal/provenance/provenance.go Do not exist 0.0%
pkg/chains/formats/slsa/internal/provenance/provenance.go Do not exist 76.9%
pkg/chains/formats/slsa/internal/resolved_dependencies/resolved_dependencies.go 87.9% 85.7% -2.2
pkg/chains/formats/slsa/v2alpha3/internal/pipelinerun/pipelinerun.go 78.5% 81.2% 2.8
pkg/chains/formats/slsa/v2alpha4/internal/pipelinerun/pipelinerun.go Do not exist 84.6%
pkg/chains/formats/slsa/v2alpha4/internal/taskrun/taskrun.go 80.0% 86.7% 6.7
pkg/chains/formats/slsa/v2alpha4/slsav2.go 85.7% 75.0% -10.7
pkg/chains/objects/objects.go 25.6% 24.3% -1.3

@chitrangpatel
Copy link
Contributor

Thanks for the cleanup Renzo!

Happy to approve after fixing the linter error.

…hen two or more tasks/steps are using the same prefix.
@renzodavid9 renzodavid9 force-pushed the 1065-stepactions-with-pipelines branch from 7a1ee59 to 323779b Compare May 22, 2024 21:41
@tekton-robot
Copy link

@chitrangpatel
Copy link
Contributor

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label May 22, 2024
Copy link
Contributor

@chitrangpatel chitrangpatel left a comment

Choose a reason for hiding this comment

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

Thanks for you work on this Renzo! It wraps up support for StepResults as discussed in issue
#1065

@tekton-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chitrangpatel

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 May 22, 2024
@chitrangpatel
Copy link
Contributor

/retest

@tekton-robot tekton-robot merged commit 9a67b0f into tektoncd:main May 22, 2024
17 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. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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.

4 participants