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 109] Add feature to extract structured signable targets and store them in subjects and materials in intoto provenance #491

Merged
merged 1 commit into from
Oct 20, 2022

Conversation

ywluogg
Copy link
Contributor

@ywluogg ywluogg commented Jul 15, 2022

Implementation of TEP 109.
Example usage for Maven packages:

results:
        - name: img_1-ARTIFACT_INPUTS
           value:
               uri: gcr.io/foo/bar
               digest: sha123@qwe
        - name: mvn1_pkg-ARTIFACT_OUTPUTS
           value:
               uri: maven-test-0.0.1.jar
               digest: sha256@abc
        - name: mvn1_pom-ARTIFACT_OUTPUTS
           value:
               uri: maven-test-0.0.1.pom
               digest: sha256@def
        - name: mvn1_src-ARTIFACT_OUTPUTS
           value:
               uri: maven-test-0.0.1-sources.jar
               digest: sha256@xyz

From this, we will generate subjects in intoto provenence:

{"name": "maven-test-0.0.1.jar", "digest": {"sha256": "abc"}}
{"name": "maven-test-0.0.1.pom", "digest": {"sha256": "def"}}
{"name": "maven-test-0.0.1-sources.jar", "digest": {"sha256": "xyz"}}

In materials:

{"uri": "gcr.io/foo/bar", "digest": {"sha123": "qwe"}}

The feature requires Pipeline v0.38 or later.

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

Added structured results provenance retrieval for both TaskRun and PipelineRun. (TEP 109 implementation)

@tekton-robot tekton-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 15, 2022
@tekton-robot tekton-robot requested review from mattmoor and mpeters July 15, 2022 20:12
@ywluogg
Copy link
Contributor Author

ywluogg commented Jul 15, 2022

/draft

@ywluogg ywluogg marked this pull request as draft July 15, 2022 20:13
@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 Jul 15, 2022
@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 75.3% 76.8% 1.5
pkg/chains/formats/intotoite6/intotoite6.go 88.6% 89.7% 1.1

@ywluogg
Copy link
Contributor Author

ywluogg commented Jul 18, 2022

/open

@ywluogg ywluogg marked this pull request as ready for review July 18, 2022 14:45
@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 18, 2022
@tekton-robot tekton-robot requested a review from dlorenc July 18, 2022 14:45
@ywluogg
Copy link
Contributor Author

ywluogg commented Jul 18, 2022

/assign wlynch

@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 75.3% 76.8% 1.5
pkg/chains/formats/intotoite6/intotoite6.go 88.6% 89.7% 1.1

@tekton-robot tekton-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 20, 2022
@tekton-robot tekton-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 3, 2022
@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 Oct 3, 2022
@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 68.9% 70.5% 1.6
pkg/chains/formats/intotoite6/taskrun/taskrun.go 74.6% 76.7% 2.1

@ywluogg
Copy link
Contributor Author

ywluogg commented Oct 3, 2022

/retest

@ywluogg
Copy link
Contributor Author

ywluogg commented Oct 4, 2022

@wlynch Hi Billy, do you mind reviewing this PR? Thanks!

pkg/artifacts/signable.go Outdated Show resolved Hide resolved
Copy link
Member

@chuangw6 chuangw6 left a comment

Choose a reason for hiding this comment

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

Thanks @ywluogg!

pkg/artifacts/signable.go Outdated Show resolved Hide resolved
pkg/artifacts/signable.go Outdated Show resolved Hide resolved
pkg/chains/formats/intotoite6/taskrun/taskrun.go Outdated Show resolved Hide resolved
@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 68.9% 73.8% 4.8
pkg/chains/formats/intotoite6/pipelinerun/pipelinerun.go 76.7% 77.3% 0.5
pkg/chains/formats/intotoite6/taskrun/taskrun.go 74.6% 75.4% 0.7

@ywluogg
Copy link
Contributor Author

ywluogg commented Oct 17, 2022

@wlynch I'm curious if I should add a user doc for this midland solution? I talked to the teams that are interested in adopting to this method, their main concern for adopting to the artifacts field in status is that they need to change a lot in their pipeline, and this current midland solution can help them migrating to a structured result, but the integration effort is not large comparing to the future solution that Prakash is working on.

I can add a user doc, but have a warning that we are doing a new design and implementation

pkg/artifacts/signable.go Show resolved Hide resolved
pkg/artifacts/signable_test.go Outdated Show resolved Hide resolved
pkg/artifacts/signable.go Show resolved Hide resolved
pkg/artifacts/signable.go Outdated Show resolved Hide resolved
@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 68.9% 73.8% 4.8
pkg/chains/formats/intotoite6/pipelinerun/pipelinerun.go 76.7% 77.3% 0.5
pkg/chains/formats/intotoite6/taskrun/taskrun.go 74.6% 75.4% 0.7

@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 68.9% 72.9% 4.0
pkg/chains/formats/intotoite6/pipelinerun/pipelinerun.go 76.7% 77.3% 0.5
pkg/chains/formats/intotoite6/taskrun/taskrun.go 74.6% 75.4% 0.7

@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 68.9% 72.9% 4.0
pkg/chains/formats/intotoite6/pipelinerun/pipelinerun.go 76.7% 77.3% 0.5
pkg/chains/formats/intotoite6/taskrun/taskrun.go 74.6% 75.4% 0.7

@wlynch
Copy link
Member

wlynch commented Oct 18, 2022

@wlynch I'm curious if I should add a user doc for this midland solution? I talked to the teams that are interested in adopting to this method, their main concern for adopting to the artifacts field in status is that they need to change a lot in their pipeline, and this current midland solution can help them migrating to a structured result, but the integration effort is not large comparing to the future solution that Prakash is working on.

I can add a user doc, but have a warning that we are doing a new design and implementation

Yes please! 🙏

Copy link
Member

@wlynch wlynch left a comment

Choose a reason for hiding this comment

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

Almost there. Few more instances of the diff change + waiting on docs.

pkg/artifacts/signable_test.go Outdated Show resolved Hide resolved
pkg/artifacts/signable_test.go Outdated Show resolved Hide resolved
pkg/artifacts/signable_test.go Outdated Show resolved Hide resolved
@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/intotoite6/taskrun/taskrun.go 74.6% 75.4% 0.7

@ywluogg ywluogg force-pushed the main branch 3 times, most recently from a98291d to 85ce20b Compare October 18, 2022 19:26
@ywluogg
Copy link
Contributor Author

ywluogg commented Oct 18, 2022

@wlynch the doc is added. PTAL

@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/intotoite6/taskrun/taskrun.go 74.6% 75.4% 0.7

@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 64.0% 69.1% 5.1
pkg/chains/formats/intotoite6/pipelinerun/pipelinerun.go 76.7% 77.3% 0.5
pkg/chains/formats/intotoite6/taskrun/taskrun.go 74.6% 75.4% 0.7

@ywluogg ywluogg requested a review from wlynch October 18, 2022 20:49
@ywluogg
Copy link
Contributor Author

ywluogg commented Oct 18, 2022

/unhold

@tekton-robot tekton-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 18, 2022
Copy link
Member

@wlynch wlynch 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 Oct 20, 2022
@tekton-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: wlynch

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 Oct 20, 2022
@tekton-robot tekton-robot merged commit 015ff9a into tektoncd:main Oct 20, 2022
@ywluogg
Copy link
Contributor Author

ywluogg commented Oct 20, 2022

/milestone v0.13.0

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. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants