Function
mapStatusToLifecycle
(status: ExecutionStatus | undefined)
Source from the content-addressed store, hash-verified
| 97 | const terminalKey = (nodeId: string, stream = 'pty') => `${nodeId}:${stream}`; |
| 98 | |
| 99 | const mapStatusToLifecycle = (status: ExecutionStatus | undefined): ExecutionLifecycle => { |
| 100 | switch (status) { |
| 101 | case 'QUEUED': |
| 102 | return 'queued'; |
| 103 | case 'RUNNING': |
| 104 | return 'running'; |
| 105 | case 'COMPLETED': |
| 106 | return 'completed'; |
| 107 | case 'FAILED': |
| 108 | return 'failed'; |
| 109 | case 'CANCELLED': |
| 110 | case 'TERMINATED': |
| 111 | return 'cancelled'; |
| 112 | case 'TIMED_OUT': |
| 113 | return 'failed'; |
| 114 | default: |
| 115 | return 'idle'; |
| 116 | } |
| 117 | }; |
| 118 | |
| 119 | const mergeById = (existing: ExecutionLog[], incoming: ExecutionLog[]): ExecutionLog[] => { |
| 120 | if (incoming.length === 0) return existing; |
Tested by
no test coverage detected