Skip to content

Commit

Permalink
chore: improve logging for constraintsFiltering
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins committed Jul 21, 2024
1 parent 1a1e1ac commit 4e271d0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/modules/datasource/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ export function applyConstraintsFiltering<

const configConstraints = config.constraints;
const filteredReleases: string[] = [];
const startingLength = releaseResult.releases.length;
releaseResult.releases = filterMap(releaseResult.releases, (release) => {
const releaseConstraints = release.constraints;
delete release.constraints;
Expand All @@ -189,6 +190,14 @@ export function applyConstraintsFiltering<

for (const [name, configConstraint] of Object.entries(configConstraints)) {
if (!versioning.isValid(configConstraint)) {
logger.once.warn(
{
packageName: config.packageName,
constraint: configConstraint,
versioning: versioningName,
},
'Invalid constraint used with strict constraintsFiltering',
);
continue;
}

Expand Down Expand Up @@ -255,7 +264,7 @@ export function applyConstraintsFiltering<
const packageName = config.packageName;
const releases = filteredReleases.join(', ');
logger.debug(
`Filtered ${count} releases for ${packageName} due to constraintsFiltering=strict: ${releases}`,
`Filtered out ${count} non-matching releases out of ${startingLength} total for ${packageName} due to constraintsFiltering=strict: ${releases}`,
);
}

Expand Down

0 comments on commit 4e271d0

Please sign in to comment.