deno manager binds nested package.json files to the root deno.lock, breaking lockFileMaintenance #45325
How are you running Renovate?A Mend.io-hosted app Which platform you running Renovate on?GitHub.com Which version of Renovate are you using?44.29.5 Please tell us more about your question or problemI have a repo where each subdirectory is its own standalone Deno project, each with its own The deno manager attaches all of the nested Smallest thing I could get it to happen with is two directories: Neither {
"deps": [
{
"depType": "dependencies",
"depName": "kysely",
"currentValue": "^0.28.17",
"datasource": "npm",
"prettyDepType": "dependency"
}
],
"managerData": {"packageName": "sub"},
"packageFile": "sub/package.json",
"lockFiles": ["deno.lock"]
}
From reading the source, The knock-on effect in Versions: the failing PR was created by the hosted app on 44.29.5, and I reproduced the extraction locally on 44.31.0. Logs (if relevant)LogsHosted app job log for the |
Replies: 2 comments
|
Your reading is right, and the cause is a missing guard rather than anything about your repo layout. It is const lockFiles = [lockFile];
...
const rootPackageFile =
await extractDenoCompatiblePackageJson(rootPackageJson);
if (rootPackageFile) {
rootPackageFile.lockFiles = lockFiles;
// detect node compat workspaces
const result = await detectNodeCompatWorkspaces(rootPackageFile);
const { workspaces, packagePaths } = result;
...
for (const packagePath of packagePaths) {
const packageFile = await extractDenoCompatiblePackageJson(packagePath);
if (packageFile) {
packageFile.lockFiles = lockFiles;
packageFiles.push(packageFile);
}
}
let filters: string[] | undefined;
// npm workspace
if (isNonEmptyArray(managerData?.workspaces)) {
filters = managerData?.workspaces;
}
const packages = await findPackages(
upath.dirname(ensureLocalPath(packageFile)),
{
patterns: filters,
ignore: [...],
},
);With no What makes this look like an oversight rather than a decision is that the other caller guards for exactly this case. In const workspaceRoots = packageFiles.filter(
(pkg) =>
isNonEmptyArray(pkg.managerData?.workspaces) &&
upath.basename(pkg.packageFile).startsWith('deno.json'),
);Same function called downstream, same That also accounts for the double extraction you noticed. Your subprojects get picked up correctly against their own locks by the normal route, and then again here against the root's, which is harmless until Worth filing as an issue with that comparison in it. The fix is small — skip the loop when no workspaces are declared, mirroring the |
Issue Created: #45342
PR welcome!