feat(chainloop): add EVIDENCE material type - #702
Conversation
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
|
Since the EVIDENCE type cannot be set or should be set as // ValidateEvidenceNotOutput validates that materials with type EVIDENCE are not marked as output
func (schema *CraftingSchema) ValidateEvidenceNotOutput() error {
for _, m := range schema.Materials {
if m.GetType() != CraftingSchema_Material_EVIDENCE {
continue
}
if m.GetOutput() {
return fmt.Errorf("material with name=%s and type EVIDENCE cannot be marked as output: true", m.Name)
}
}
return nil
}And then run the validation on the Wdyt @jiparis @migmartri ?? |
I do not think that in crafter.go would be enough since we might have other clients creating contracts. because of that, it might make sense to implement it server side, either with custom code as you showed or built-in using a custom protovalidate rule. |
|
in any case, I am ok doing the validation in another patch, because note that we can not enable until this is in place #703 |
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
Signed-off-by: Javier Rodriguez <javier@chainloop.dev>
migmartri
left a comment
There was a problem hiding this comment.
Let's update also the readme file with the info about the new material type, it seems we only added it to the docs page
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
I've updated it :) |
This PR adds a new material type called EVIDENCE which inherits from ARTIFACT, but it's not meant to represent a main software artifact, but a secondary, stored in CAS, piece of material. A test report, or a generated custom bill of materials are good examples for this new type.
Closes #698