fix(logs): warn when Package lookup failures occur (#23247)

This commit is contained in:
Rhys Arkins 2023-07-07 20:26:33 +02:00 committed by GitHub
parent 0d6a888261
commit 62b7144ab9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -55,6 +55,9 @@ function getDepWarnings(
} }
} }
} }
if (warnings.length) {
logger.warn({ warnings, files: warningFiles }, 'Package lookup failures');
}
return { warnings, warningFiles }; return { warnings, warningFiles };
} }
@ -70,7 +73,6 @@ export function getDepWarningsOnboardingPR(
if (!warnings.length) { if (!warnings.length) {
return ''; return '';
} }
logger.debug({ warnings, warningFiles }, 'Found package lookup warnings');
warningText = emojify( warningText = emojify(
`\n---\n\n### :warning: Dependency Lookup Warnings :warning:\n\n` `\n---\n\n### :warning: Dependency Lookup Warnings :warning:\n\n`
); );
@ -90,7 +92,7 @@ export function getDepWarningsPR(
config: RenovateConfig, config: RenovateConfig,
dependencyDashboard?: boolean dependencyDashboard?: boolean
): string { ): string {
const { warnings, warningFiles } = getDepWarnings(packageFiles); const { warnings } = getDepWarnings(packageFiles);
if (config.suppressNotifications?.includes('dependencyLookupWarnings')) { if (config.suppressNotifications?.includes('dependencyLookupWarnings')) {
return ''; return '';
} }
@ -98,7 +100,6 @@ export function getDepWarningsPR(
if (!warnings.length) { if (!warnings.length) {
return ''; return '';
} }
logger.debug({ warnings, warningFiles }, 'Found package lookup warnings');
warningText = emojify( warningText = emojify(
`\n---\n\n### :warning: Dependency Lookup Warnings :warning:\n\n` `\n---\n\n### :warning: Dependency Lookup Warnings :warning:\n\n`
); );
@ -130,7 +131,6 @@ export function getDepWarningsDashboard(
.map((dep) => '`' + dep + '`') .map((dep) => '`' + dep + '`')
.join(', '); .join(', ');
logger.debug({ warnings, warningFiles }, 'Found package lookup warnings');
let warningText = emojify( let warningText = emojify(
`\n---\n\n### :warning: Dependency Lookup Warnings :warning:\n\n` `\n---\n\n### :warning: Dependency Lookup Warnings :warning:\n\n`
); );