-
Notifications
You must be signed in to change notification settings - Fork 134
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
Calculate subjects per formatter #1132
Calculate subjects per formatter #1132
Conversation
Skipping CI for Draft Pull Request. |
875cbc7
to
47c808b
Compare
/test all |
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
/un-approve |
/un-approve |
/remove-approve |
/lgtm |
/lgtm |
/approve |
[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 |
/kind bug |
/cherry-pick release-v0.21.x |
1 similar comment
/cherry-pick release-v0.21.x |
* Calculate subjects per formatter * Tests for new retrieve full uris in grafeas
* Calculate subjects per formatter * Tests for new retrieve full uris in grafeas (cherry picked from commit 750a98e)
* Fix field names in generated json statement (#1129) To keep backwards compatibility with previous struct versions (e.g, github.com/in-toto/in-toto-golang/in_toto) we have to use protojson.Marshal function to transform the struct to its json representation so the tags defined in the intoto.Statement are follow and applied to the resulting string. (cherry picked from commit 3bf8cac) * Fix no repeated subjects for v2alpha4 pipelineruns (#1130) Change the pipelinerun v2alpha4 method that calculates the subjects to use `artifact.AppendSubjects` instead of `append` to avoid duplicated subjects. (cherry picked from commit badc734) * Calculate subjects per formatter (#1132) * Calculate subjects per formatter * Tests for new retrieve full uris in grafeas (cherry picked from commit 750a98e)
Fixes: #1133
Changes
The way v2alpha3 and v2alpha4 calculate the subjects are different; calling
extract.RetrieveAllArtifactURIs
to generate the subjects is wrong if using v2alpha4. This PR add a new method to the payload formatter that returns the subjects according to the logic of each version. It also changes grafeas backend to generate the subject through the payloader and not calling theextract.RetrieveAllArtifactURIs
directly.Submitter Checklist
As the author of this PR, please check off the items in this checklist:
functionality, content, code)