MCPcopy Create free account
hub / github.com/code-pushup/cli / loadCachedBaseReportFromArtifacts

Function loadCachedBaseReportFromArtifacts

packages/ci/src/lib/run-utils.ts:363–390  ·  view source on GitHub ↗
(
  args: BaseReportArgs,
)

Source from the content-addressed store, hash-verified

361}
362
363async function loadCachedBaseReportFromArtifacts(
364 args: BaseReportArgs,
365): Promise<string | null> {
366 const {
367 env: { api },
368 project,
369 } = args;
370
371 if (api.downloadReportArtifact == null) {
372 return null;
373 }
374
375 const reportPath = await api
376 .downloadReportArtifact(project?.name)
377 .catch((error: unknown) => {
378 logWarning(
379 `Error when downloading previous report artifact, skipping - ${stringifyError(error)}`,
380 );
381 return null;
382 });
383
384 logInfo(`Previous report artifact ${reportPath ? 'found' : 'not found'}`);
385 if (reportPath) {
386 logDebug(`Previous report artifact downloaded to ${reportPath}`);
387 }
388
389 return reportPath;
390}
391
392async function loadCachedBaseReportFromPortal(
393 args: BaseReportArgs,

Callers 1

loadCachedBaseReportFunction · 0.85

Calls 4

stringifyErrorFunction · 0.90
logWarningFunction · 0.85
logInfoFunction · 0.85
logDebugFunction · 0.85

Tested by

no test coverage detected