MCPcopy
hub / github.com/chartbrew/chartbrew / completeRun

Function completeRun

server/modules/updateAudit.js:511–546  ·  view source on GitHub ↗
(traceContext, options = {})

Source from the content-addressed store, hash-verified

509}
510
511async function completeRun(traceContext, options = {}) {
512 if (!traceContext) {
513 return null;
514 }
515
516 const status = options.status || "success";
517 let eventStatus = status;
518 if (status === "failed") {
519 eventStatus = "failed";
520 } else if (status === "success") {
521 eventStatus = "success";
522 }
523 const finishedAt = options.finishedAt || new Date();
524 const startedAt = traceContext.startedAt || finishedAt;
525 const summary = sanitizePayload(options.summary || null);
526
527 const runFinishedEvent = await startEvent(traceContext, "run_finished", {
528 status,
529 summary,
530 ...sanitizePayload(options.payload),
531 });
532 await finishEvent(traceContext, runFinishedEvent, eventStatus, {
533 status,
534 summary,
535 ...sanitizePayload(options.payload),
536 });
537
538 await updateRunContext(traceContext, {
539 status,
540 finishedAt,
541 durationMs: getDurationMs(startedAt, finishedAt),
542 summary,
543 });
544
545 return traceContext;
546}
547
548async function failRun(traceContext, error, options = {}) {
549 if (!traceContext) {

Callers 8

runRequestMethod · 0.85
updateChartDataMethod · 0.85
completeConnectorAuditFunction · 0.85
addDashboardToQueueFunction · 0.85
addChartsToQueueFunction · 0.85
updateChart.jsFile · 0.85
updateChartFunction · 0.85
updateDashboard.jsFile · 0.85

Calls 5

sanitizePayloadFunction · 0.85
startEventFunction · 0.85
finishEventFunction · 0.85
updateRunContextFunction · 0.85
getDurationMsFunction · 0.85

Tested by

no test coverage detected