MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / attMaterialToAction

Function attMaterialToAction

app/cli/pkg/action/attestation_status.go:295–311  ·  view source on GitHub ↗

attMaterialToAction converts the attestation material to the action material

(m *v1.Attestation_Material)

Source from the content-addressed store, hash-verified

293
294// attMaterialToAction converts the attestation material to the action material
295func attMaterialToAction(m *v1.Attestation_Material) (*AttestationStatusMaterial, error) {
296 res := &AttestationStatusMaterial{
297 Material: &Material{
298 Name: m.GetId(),
299 Type: m.GetMaterialType().String(),
300 Annotations: stateAnnotationToAction(m.Annotations),
301 },
302 IsOutput: m.Output,
303 Required: m.Required,
304 }
305
306 if err := setMaterialValue(m, res); err != nil {
307 return nil, fmt.Errorf("setting material value: %w", err)
308 }
309
310 return res, nil
311}
312
313func pbAnnotationsToAction(in []*pbc.Annotation) []*Annotation {
314 res := make([]*Annotation, 0, len(in))

Callers 2

RunMethod · 0.85

Calls 5

stateAnnotationToActionFunction · 0.85
setMaterialValueFunction · 0.85
StringMethod · 0.65
GetIdMethod · 0.45
GetMaterialTypeMethod · 0.45

Tested by

no test coverage detected