"No workspaces found" with incorrect npm workspace directory name when creating PR for open-telemetry/opentelemetry-js-contrib #30466
-
What would you like help with?I think I found a bug How are you running Renovate?Mend Renovate hosted app on github.com If you're self-hosting Renovate, tell us which platform (GitHub, GitLab, etc) and which version of Renovate.No response Please tell us more about your question or problemHello,
In the repo, the actual directory (and npm workspace) name is different: Is it possible that renovatebot is incorrectly normalizing the npm workspace dirs and removing that period in the workspace name? FWIW, this used to work on this same dir. Here is an earlier renovate PR for the same
Thanks. Logs (if relevant)Renovate job log that shows the failure: https://developer.mend.io/github/open-telemetry/opentelemetry-js-contrib/-/job/0190ffa6-a610-7f70-9100-66fbe2224894 Logs
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
I did some local debugging of renovate for this (using https://github.com/trentm/renovatetestrepo1 as the test repo), and I believe this line has a bug: const workspaceDir = trimSlashes(packageFileDir.replace(lockFileDir, '')); When debugging this for a run against my repo:
Perhaps that section could be changed to: diff --git a/lib/modules/manager/npm/post-update/npm.ts b/lib/modules/manager/npm/post-update/npm.ts
index f00351061..b7215af48 100644
--- a/lib/modules/manager/npm/post-update/npm.ts
+++ b/lib/modules/manager/npm/post-update/npm.ts
@@ -291,7 +291,11 @@ export function divideWorkspaceAndRootDeps(
);
// workspaceDir = packageFileDir - lockFileDir
- const workspaceDir = trimSlashes(packageFileDir.replace(lockFileDir, ''));
+ const workspaceDir = trimSlashes(
+ packageFileDir.startsWith(lockFileDir)
+ ? packageFileDir.slice(lockFileDir.length)
+ : packageFileDir
+ );
if (is.nonEmptyString(workspaceDir)) {
let workspaceName: string | undefined; ? |
Beta Was this translation helpful? Give feedback.
PR added: #30483