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

Function findNewIssues

packages/ci/src/lib/run-utils.ts:522–559  ·  view source on GitHub ↗
(
  args: CompareReportsArgs,
)

Source from the content-addressed store, hash-verified

520}
521
522export async function findNewIssues(
523 args: CompareReportsArgs,
524): Promise<SourceFileIssue[]> {
525 const {
526 base,
527 currReport,
528 prevReport,
529 config,
530 ctx,
531 env: { git },
532 } = args;
533
534 const diffFiles = persistedFilesFromConfig(config, {
535 directory: ctx.directory,
536 isDiff: true,
537 });
538
539 await git.fetch('origin', base.ref, ['--depth=1']);
540 const reportsDiff = await readFile(diffFiles.json, 'utf8');
541 const changedFiles = await listChangedFiles(
542 { base: 'FETCH_HEAD', head: 'HEAD' },
543 git,
544 );
545
546 const issues = filterRelevantIssues({
547 currReport: JSON.parse(currReport.content) as Report,
548 prevReport: JSON.parse(prevReport.content) as Report,
549 reportsDiff: JSON.parse(reportsDiff) as ReportsDiff,
550 changedFiles,
551 });
552 logDebug(
553 `Found ${issues.length} relevant issues for ${
554 Object.keys(changedFiles).length
555 } changed files`,
556 );
557
558 return issues;
559}
560
561function projectToName(project: ProjectConfig | null): string {
562 return project?.name ?? '-';

Callers 2

compareManyProjectsFunction · 0.85
compareReportsFunction · 0.85

Calls 5

persistedFilesFromConfigFunction · 0.85
readFileFunction · 0.85
listChangedFilesFunction · 0.85
filterRelevantIssuesFunction · 0.85
logDebugFunction · 0.85

Tested by

no test coverage detected