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

Function pbWorkflowItemToAction

app/cli/pkg/action/workflow_list.go:97–115  ·  view source on GitHub ↗

pbWorkflowItemToAction converts API response to WorkflowItem

(wf *pb.WorkflowItem)

Source from the content-addressed store, hash-verified

95
96// pbWorkflowItemToAction converts API response to WorkflowItem
97func pbWorkflowItemToAction(wf *pb.WorkflowItem) *WorkflowItem {
98 if wf == nil {
99 return nil
100 }
101
102 return &WorkflowItem{
103 Name: wf.Name,
104 ID: wf.Id,
105 CreatedAt: toTimePtr(wf.CreatedAt.AsTime()),
106 Project: wf.Project,
107 Team: wf.Team,
108 RunsCount: wf.RunsCount,
109 ContractName: wf.ContractName,
110 ContractRevisionLatest: wf.ContractRevisionLatest,
111 LastRun: pbWorkflowRunItemToAction(wf.LastRun),
112 Public: wf.Public,
113 Description: wf.Description,
114 }
115}
116
117// NamespacedName returns the project and workflow name in a formatted string
118func (wi *WorkflowItem) NamespacedName() string {

Callers 7

RunMethod · 0.85
RunMethod · 0.85
RunMethod · 0.85
RunMethod · 0.85
RunMethod · 0.85

Calls 2

toTimePtrFunction · 0.70

Tested by

no test coverage detected