Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: improve logging for constraintsFiltering #30280

Merged
merged 1 commit into from
Jul 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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