2023-08-25 08:22:14 +00:00
|
|
|
import { nameFromLevel } from 'bunyan';
|
|
|
|
import { getProblems } from '../../logger';
|
|
|
|
|
2023-08-27 08:13:10 +00:00
|
|
|
export function extractRepoProblems(
|
2023-11-07 15:50:29 +00:00
|
|
|
repository: string | undefined,
|
2023-08-27 08:13:10 +00:00
|
|
|
): Set<string> {
|
2023-08-25 08:22:14 +00:00
|
|
|
return new Set(
|
|
|
|
getProblems()
|
|
|
|
.filter(
|
|
|
|
(problem) =>
|
2023-11-07 15:50:29 +00:00
|
|
|
problem.repository === repository && !problem.artifactErrors,
|
2023-08-25 08:22:14 +00:00
|
|
|
)
|
|
|
|
.map(
|
|
|
|
(problem) =>
|
2023-11-07 15:50:29 +00:00
|
|
|
`${nameFromLevel[problem.level].toUpperCase()}: ${problem.msg}`,
|
|
|
|
),
|
2023-08-25 08:22:14 +00:00
|
|
|
);
|
|
|
|
}
|