Skip to content

Add support for Grafeas storage backend#389

Merged
tekton-robot merged 1 commit into
tektoncd:mainfrom
chuangw6:grafeas
Mar 29, 2022
Merged

Add support for Grafeas storage backend#389
tekton-robot merged 1 commit into
tektoncd:mainfrom
chuangw6:grafeas

Conversation

@chuangw6

@chuangw6 chuangw6 commented Mar 3, 2022

Copy link
Copy Markdown
Member

Changes

This PR implements the support for Grafeas storage backend (i.e. Google Container Analysis) via Grafeas open source API.

If Google Container Analysis server is chosen, this new feature will enable Tekton Chains to write provenance to Container Analysis that then can be consumed by GCP services such as Binary Authorization.

Submitter Checklist

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

  • Docs included if any changes are user facing
  • 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 filled in or deleted (only if no user facing changes)

Release Notes

action required

1. configure container analysis as storage backend for taskrun and/or oci artifacts.

  • kubectl patch configmap chains-config -n tekton-chains -p='{"data":{"artifacts.taskrun.storage": "grafeas"}}'
  • kubectl patch configmap chains-config -n tekton-chains -p='{"data":{"artifacts.oci.storage": "grafeas"}}'

2. inform tekton chains project ID and note name that will be used to create occurrences.

  • kubectl patch configmap chains-config -n tekton-chains -p='{"data":{"storage.grafeas.projectid": "<GCP_PROJECT_ID>"}}'
  • kubectl patch configmap chains-config -n tekton-chains -p='{"data":{"storage.grafeas.noteid": "<NOTE_NAME>"}}' (optional, if noteid is not configured, we will generate a name in the format of tekton-<namespace>)

3. Authenticate to GCP (if Container Analysis is chosen for the storage backend)

@tekton-robot tekton-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Mar 3, 2022
@chuangw6

chuangw6 commented Mar 3, 2022

Copy link
Copy Markdown
Member Author

/assign @wlynch

@tekton-robot

Copy link
Copy Markdown

@chuangw6: GitHub didn't allow me to assign the following users: wlynch.

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.
For more information please see the contributor guide

Details

In response to this:

/assign @wlynch

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

Copy link
Copy Markdown

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/storage/storage.go 45.5% 38.5% -7.0

Comment thread pkg/chains/storage/ca/ca.go Outdated
Comment thread pkg/chains/storage/ca/ca.go Outdated
Comment thread pkg/chains/storage/ca/ca.go Outdated
Comment thread pkg/chains/storage/ca/ca.go Outdated
Comment thread pkg/chains/storage/ca/ca.go Outdated
Comment thread pkg/chains/storage/ca/ca.go Outdated
Comment thread pkg/chains/storage/ca/ca.go Outdated
Comment thread pkg/chains/storage/ca/ca.go Outdated
Comment thread pkg/chains/storage/ca/ca.go Outdated
Comment thread pkg/config/config.go Outdated
Comment thread pkg/chains/storage/ca/ca_test.go Outdated
Comment thread pkg/chains/storage/ca/ca.go Outdated
Comment thread pkg/chains/storage/ca/ca_test.go Outdated
@tekton-robot tekton-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 7, 2022
@tekton-robot

Copy link
Copy Markdown

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/storage/storage.go 45.5% 38.5% -7.0

@tekton-robot

Copy link
Copy Markdown

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/storage/grafeas/grafeas.go Do not exist 73.1%
pkg/chains/storage/storage.go 45.5% 38.5% -7.0

@tekton-robot

Copy link
Copy Markdown

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/storage/grafeas/grafeas.go Do not exist 73.1%
pkg/chains/storage/storage.go 45.5% 38.5% -7.0

@tekton-robot

Copy link
Copy Markdown

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/storage/grafeas/grafeas.go Do not exist 73.1%

@chuangw6

chuangw6 commented Mar 9, 2022

Copy link
Copy Markdown
Member Author

/retest

@tekton-robot

Copy link
Copy Markdown

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/storage/grafeas/grafeas.go Do not exist 73.1%

@tekton-robot

Copy link
Copy Markdown

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/storage/grafeas/grafeas.go Do not exist 73.6%
pkg/chains/storage/storage.go 45.5% 38.5% -7.0

@tekton-robot

Copy link
Copy Markdown

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/storage/grafeas/grafeas.go Do not exist 73.6%
pkg/chains/storage/storage.go 45.5% 38.5% -7.0

@chuangw6 chuangw6 changed the title Add support for Google Container Analysis storage backend Add support for Grafeas storage backend Mar 9, 2022
Comment thread pkg/chains/storage/grafeas/grafeas_test.go
Comment thread pkg/chains/storage/grafeas/grafeas_test.go Outdated
Comment thread pkg/chains/storage/grafeas/grafeas.go Outdated
Comment thread pkg/chains/storage/grafeas/grafeas.go Outdated
Comment thread pkg/chains/storage/grafeas/grafeas.go
Comment thread pkg/chains/storage/grafeas/grafeas_test.go Outdated
Comment thread pkg/chains/storage/grafeas/grafeas_test.go
Comment thread pkg/chains/storage/grafeas/grafeas_test.go Outdated
Comment thread pkg/chains/storage/grafeas/grafeas_test.go Outdated
Comment thread pkg/config/config.go Outdated
@tekton-robot

Copy link
Copy Markdown

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/storage/grafeas/grafeas.go Do not exist 78.1%
pkg/chains/storage/storage.go 45.5% 38.5% -7.0

@tekton-robot

Copy link
Copy Markdown

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/storage/grafeas/grafeas.go Do not exist 78.1%
pkg/chains/storage/storage.go 45.5% 38.5% -7.0

@tekton-robot

Copy link
Copy Markdown

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/storage/grafeas/grafeas.go Do not exist 78.1%
pkg/chains/storage/storage.go 45.5% 38.5% -7.0

Comment thread pkg/chains/storage/grafeas/grafeas.go Outdated
Comment thread pkg/chains/storage/grafeas/grafeas.go Outdated
Comment thread pkg/chains/storage/grafeas/grafeas_test.go Outdated
Comment thread pkg/chains/storage/grafeas/grafeas.go
Comment thread pkg/chains/storage/grafeas/grafeas_test.go Outdated
Comment thread pkg/chains/storage/grafeas/grafeas_test.go Outdated
Comment thread pkg/chains/storage/grafeas/grafeas_test.go Outdated
Comment thread pkg/chains/storage/grafeas/grafeas_test.go Outdated
Comment thread pkg/chains/storage/grafeas/grafeas_test.go Outdated
@tekton-robot

Copy link
Copy Markdown

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/storage/grafeas/grafeas.go Do not exist 78.0%
pkg/chains/storage/storage.go 45.5% 38.5% -7.0

@chuangw6

Copy link
Copy Markdown
Member Author

/test pull-tekton-chains-unit-tests

@tekton-robot

Copy link
Copy Markdown

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/storage/storage.go 45.5% 38.5% -7.0

@tekton-robot

Copy link
Copy Markdown

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/storage/grafeas/grafeas.go Do not exist 78.6%
pkg/chains/storage/storage.go 45.5% 38.5% -7.0

@chuangw6

Copy link
Copy Markdown
Member Author

hi @wlynch ,
Can you please review again if you get a chance? I'll try to see how to solve the issue of the re-request review button. 😅
Thanks a lot!

@wlynch wlynch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looking good! Few more changes, mostly structural / documentation though!

Comment thread pkg/chains/storage/grafeas/grafeas_test.go Outdated
Comment thread pkg/chains/storage/grafeas/grafeas.go
Comment thread pkg/chains/storage/grafeas/grafeas_test.go Outdated
Comment thread pkg/chains/storage/grafeas/grafeas_test.go Outdated
@tekton-robot

Copy link
Copy Markdown

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/storage/grafeas/grafeas.go Do not exist 78.6%
pkg/chains/storage/storage.go 45.5% 38.5% -7.0

@wlynch wlynch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/lgtm

@tekton-robot

Copy link
Copy Markdown

@wlynch: changing LGTM is restricted to collaborators

Details

In response to this:

/lgtm

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.

@wlynch

wlynch commented Mar 29, 2022

Copy link
Copy Markdown
Member

/assign @priyawadhwa

@Yongxuanzhang

Copy link
Copy Markdown
Member

maybe squash the commits before merged?

@wlynch

wlynch commented Mar 29, 2022

Copy link
Copy Markdown
Member

maybe squash the commits before merged?

Good call! I always miss this 😅

@tekton-robot

Copy link
Copy Markdown

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/storage/grafeas/grafeas.go Do not exist 78.6%
pkg/chains/storage/storage.go 45.5% 38.5% -7.0

@priyawadhwa priyawadhwa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice! I'm not super familiar with grafeas, but would it be possible to write an integration test for it?

I'm wondering if we could deploy an instance of grafeas to the integration test cluster & test against that?

Comment thread pkg/chains/storage/grafeas/grafeas.go
@priyawadhwa

Copy link
Copy Markdown
Contributor

maybe squash the commits before merged?

yah i think that's required!

@tekton-robot

Copy link
Copy Markdown

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/storage/grafeas/grafeas.go Do not exist 78.6%
pkg/chains/storage/storage.go 45.5% 38.5% -7.0

@chuangw6

Copy link
Copy Markdown
Member Author

maybe squash the commits before merged?

yah i think that's required!

Done! Thanks for the heads up!

@tekton-robot

Copy link
Copy Markdown

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/storage/grafeas/grafeas.go Do not exist 78.6%
pkg/chains/storage/storage.go 45.5% 38.5% -7.0

@priyawadhwa

Copy link
Copy Markdown
Contributor

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 29, 2022
@tekton-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: priyawadhwa, wlynch

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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 Mar 29, 2022
@tekton-robot tekton-robot merged commit 9e91dc9 into tektoncd:main Mar 29, 2022
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