Skip to content

Commit

Permalink
chore(lookup): add skip-value logging
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins committed Mar 8, 2024
1 parent 4f9cc7b commit 5715892
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/workers/repository/process/lookup/index.ts
Expand Up @@ -62,6 +62,12 @@ export async function lookupUpdates(
'lookupUpdates',
);
if (config.currentValue && !is.string(config.currentValue)) {
// If currentValue is not a string, then it's invalid
if (config.currentValue) {
logger.debug(
`Invalid currentValue for ${config.packageName}: ${JSON.stringify(config.currentValue)} (${typeof config.currentValue})`,
);
}
res.skipReason = 'invalid-value';
return Result.ok(res);
}
Expand Down Expand Up @@ -271,6 +277,9 @@ export async function lookupUpdates(

if (!currentVersion) {
if (!config.lockedVersion) {
logger.debug(
`No currentVersion or lockedVersion found for ${config.packageName}`,
);
res.skipReason = 'invalid-value';
}
return Result.ok(res);
Expand Down Expand Up @@ -425,6 +434,9 @@ export async function lookupUpdates(
);

if (!config.pinDigests && !config.currentDigest) {
logger.debug(
`Skipping ${config.packageName} because no currentDigest or pinDigests`,
);
res.skipReason = 'invalid-value';
} else {
delete res.skipReason;
Expand Down

0 comments on commit 5715892

Please sign in to comment.