-
Notifications
You must be signed in to change notification settings - Fork 135
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
Handle duplicates in subjects and materials consistently #926
Conversation
cc @lcarva could we possibly include this fix in the upcoming release? Thanks a lot! |
a1a6b6e
to
193d493
Compare
The following is the coverage report on the affected files.
|
This failure seems like a flaky unit test 😮 chains/pkg/chains/formats/slsa/v2alpha2/internal/external_parameters/external_parameters_test.go Lines 28 to 48 in 659b32b
In the implementation, it always gets the first entry in the map and the unit test assumes it's always the first entry in the test map. But golang maps are unordered data structure, so the first entry is non-deterministic. That's why the test is flaky. cc @joejstuart |
I'm unsure why the implementation only wants the first entry. It's existing code I moved. I'm wondering if we should just copy the whole // PipelineRun adds the pipeline run spec and provenance if available
func PipelineRun(pro *objects.PipelineRunObject) map[string]any {
externalParams := make(map[string]any)
if provenance := pro.GetRemoteProvenance(); provenance != nil {
- externalParams["buildConfigSource"] = buildConfigSource(provenance)
+ externalParams["buildConfigSource"] = provenance.RefSource
}
externalParams["runSpec"] = pro.Spec
return externalParams |
That's a good idea, but currently slsa defines the ref field for other ci/cd as string i.e. Maybe something we can flag to slsa team in this generic proposal? slsa-framework/slsa#940 cc @chitrangpatel for thoughts. |
I think we should add it to the generic propossal. RefSource is a very Tekton Specific field. I think a more generic format for |
Here's a test that should work. #928. +1 for adding the whole RefSource to the generic proposal. |
Fixes tektoncd#925 Prior, deduplication handling for subjects and materials is different. Now, we use consistent approach to handle the deduplication. Signed-off-by: Chuang Wang <[email protected]>
193d493
to
fb93465
Compare
The following is the coverage report on the affected files.
|
/lgtm |
Thanks @chuangw6! |
/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 |
Changes
/kind bug
Fixes #925
Prior, deduplication handling for subjects and materials is different.
Now, we use consistent approach to handle the deduplication.
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
functionality, content, code)
Release Notes