( ref: string, readyQueue: ReadyItem[], pending: Set<string>, nodeStates: Map<string, NodeState>, successEdges: Map<string, WorkflowEdge[]>, onNodeSkipped?: (ref: string) => Promise<void>, )
| 337 | } |
| 338 | |
| 339 | async function handleSkip( |
| 340 | ref: string, |
| 341 | readyQueue: ReadyItem[], |
| 342 | pending: Set<string>, |
| 343 | nodeStates: Map<string, NodeState>, |
| 344 | successEdges: Map<string, WorkflowEdge[]>, |
| 345 | onNodeSkipped?: (ref: string) => Promise<void>, |
| 346 | ) { |
| 347 | if (!pending.has(ref)) return; |
| 348 | |
| 349 | pending.delete(ref); |
| 350 | const state = nodeStates.get(ref); |
| 351 | if (state) state.skipped = true; |
| 352 | |
| 353 | if (onNodeSkipped) { |
| 354 | await onNodeSkipped(ref); |
| 355 | } |
| 356 | |
| 357 | const edges = successEdges.get(ref) ?? []; |
| 358 | const children = new Set(edges.map((e) => e.targetRef)); |
| 359 | |
| 360 | for (const child of children) { |
| 361 | await processChild( |
| 362 | child, |
| 363 | ref, |
| 364 | 'skipped', |
| 365 | readyQueue, |
| 366 | pending, |
| 367 | nodeStates, |
| 368 | successEdges, |
| 369 | onNodeSkipped, |
| 370 | ); |
| 371 | } |
| 372 | } |
| 373 | |
| 374 | async function handleFailure( |
| 375 | ref: string, |
no test coverage detected