-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[Feature] upgrade-interactive feature to show workspaces #2591
Comments
Hoping to see this as well in Yarn v2. Came across a feature for Yarn ~v1.2 that implemented something similar: yarnpkg/yarn#4654 (comment) Ideally this feature could also filter the results to just one workspace, too. For example, |
I would love to see:
or
and/or show which workspaces have dependencies when selecting versions. Currently, we have to refer to package.json files to see which versions are in which workspaces. Quite the chore in a large monorepo! |
agree! and it gets especially confusing when multiple packages have the same dependency version, but you only want to update one... it worked perfectly fine with yarn1, i dont get how a regression like this could be left unresolved for years |
There's a PR open for this here #3260 |
I have created a plugin for yarn : https://github.com/eyolas/yarn-plugin-interractive-filter |
This plugin allows to resolve some CVEs more surgically that are found in indirect dependencies which are difficult to upgrade without triggering a large change needed and potential migrations, breaking changes to the public APIs of packages. The reason why the above problem happens is because `yarn up` and `yarn up -R` are blunt instruments when it comes to managing a monorepo such as ours: They do their upgrade all-or-nothing, e.g. you can't upgrade a single dependency in a single monorepo package, you must upgrade the dependency project-wide with the mentioned tools, but sometimes we need to perform the upgrade just in a single monorepo package. For example to the above, about 20 packages use web3 but only about 5 of those are using v4.x versions of web3. A new CVE came out covering v4.1.x and so I needed to upgrade web3 only in those packages where web3 was already above v4.0.0 and leave the older ones alone (surgical upgrades). To accomplish this I've found no way to do it with stock yarn CLI commands, but someone who had the exact same problem had written a plugin for solving it. The original issue reported to yarn with the same problem we are having: yarnpkg/berry#2591 The repository where the plugin resides that we are adding in this commit in order to remediate the problem of lack of surgical (per-package) upgrades: https://github.com/eyolas/yarn-plugin-interractive-filter The original CVE that I was investigating as I stumbled upon the solution: - https://github.com/hyperledger/cacti/pull/3264 - https://github.com/hyperledger/cacti/security/dependabot/987 Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
This plugin allows to resolve some CVEs more surgically that are found in indirect dependencies which are difficult to upgrade without triggering a large change needed and potential migrations, breaking changes to the public APIs of packages. The reason why the above problem happens is because `yarn up` and `yarn up -R` are blunt instruments when it comes to managing a monorepo such as ours: They do their upgrade all-or-nothing, e.g. you can't upgrade a single dependency in a single monorepo package, you must upgrade the dependency project-wide with the mentioned tools, but sometimes we need to perform the upgrade just in a single monorepo package. For example to the above, about 20 packages use web3 but only about 5 of those are using v4.x versions of web3. A new CVE came out covering v4.1.x and so I needed to upgrade web3 only in those packages where web3 was already above v4.0.0 and leave the older ones alone (surgical upgrades). To accomplish this I've found no way to do it with stock yarn CLI commands, but someone who had the exact same problem had written a plugin for solving it. The original issue reported to yarn with the same problem we are having: yarnpkg/berry#2591 The repository where the plugin resides that we are adding in this commit in order to remediate the problem of lack of surgical (per-package) upgrades: https://github.com/eyolas/yarn-plugin-interractive-filter The original CVE that I was investigating as I stumbled upon the solution: - https://github.com/hyperledger/cacti/pull/3264 - https://github.com/hyperledger/cacti/security/dependabot/987 Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
This plugin allows to resolve some CVEs more surgically that are found in indirect dependencies which are difficult to upgrade without triggering a large change needed and potential migrations, breaking changes to the public APIs of packages. The reason why the above problem happens is because `yarn up` and `yarn up -R` are blunt instruments when it comes to managing a monorepo such as ours: They do their upgrade all-or-nothing, e.g. you can't upgrade a single dependency in a single monorepo package, you must upgrade the dependency project-wide with the mentioned tools, but sometimes we need to perform the upgrade just in a single monorepo package. For example to the above, about 20 packages use web3 but only about 5 of those are using v4.x versions of web3. A new CVE came out covering v4.1.x and so I needed to upgrade web3 only in those packages where web3 was already above v4.0.0 and leave the older ones alone (surgical upgrades). To accomplish this I've found no way to do it with stock yarn CLI commands, but someone who had the exact same problem had written a plugin for solving it. The original issue reported to yarn with the same problem we are having: yarnpkg/berry#2591 The repository where the plugin resides that we are adding in this commit in order to remediate the problem of lack of surgical (per-package) upgrades: https://github.com/eyolas/yarn-plugin-interractive-filter The original CVE that I was investigating as I stumbled upon the solution: - https://github.com/hyperledger/cacti/pull/3264 - https://github.com/hyperledger/cacti/security/dependabot/987 Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
This plugin allows to resolve some CVEs more surgically that are found in indirect dependencies which are difficult to upgrade without triggering a large change needed and potential migrations, breaking changes to the public APIs of packages. The reason why the above problem happens is because `yarn up` and `yarn up -R` are blunt instruments when it comes to managing a monorepo such as ours: They do their upgrade all-or-nothing, e.g. you can't upgrade a single dependency in a single monorepo package, you must upgrade the dependency project-wide with the mentioned tools, but sometimes we need to perform the upgrade just in a single monorepo package. For example to the above, about 20 packages use web3 but only about 5 of those are using v4.x versions of web3. A new CVE came out covering v4.1.x and so I needed to upgrade web3 only in those packages where web3 was already above v4.0.0 and leave the older ones alone (surgical upgrades). To accomplish this I've found no way to do it with stock yarn CLI commands, but someone who had the exact same problem had written a plugin for solving it. The original issue reported to yarn with the same problem we are having: yarnpkg/berry#2591 The repository where the plugin resides that we are adding in this commit in order to remediate the problem of lack of surgical (per-package) upgrades: https://github.com/eyolas/yarn-plugin-interractive-filter The original CVE that I was investigating as I stumbled upon the solution: - https://github.com/hyperledger/cacti/pull/3264 - https://github.com/hyperledger/cacti/security/dependabot/987 Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
This plugin allows to resolve some CVEs more surgically that are found in indirect dependencies which are difficult to upgrade without triggering a large change needed and potential migrations, breaking changes to the public APIs of packages. The reason why the above problem happens is because `yarn up` and `yarn up -R` are blunt instruments when it comes to managing a monorepo such as ours: They do their upgrade all-or-nothing, e.g. you can't upgrade a single dependency in a single monorepo package, you must upgrade the dependency project-wide with the mentioned tools, but sometimes we need to perform the upgrade just in a single monorepo package. For example to the above, about 20 packages use web3 but only about 5 of those are using v4.x versions of web3. A new CVE came out covering v4.1.x and so I needed to upgrade web3 only in those packages where web3 was already above v4.0.0 and leave the older ones alone (surgical upgrades). To accomplish this I've found no way to do it with stock yarn CLI commands, but someone who had the exact same problem had written a plugin for solving it. The original issue reported to yarn with the same problem we are having: yarnpkg/berry#2591 The repository where the plugin resides that we are adding in this commit in order to remediate the problem of lack of surgical (per-package) upgrades: https://github.com/eyolas/yarn-plugin-interractive-filter The original CVE that I was investigating as I stumbled upon the solution: - https://github.com/hyperledger/cacti/pull/3264 - https://github.com/hyperledger/cacti/security/dependabot/987 Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
Describe the user story
Yarn
upgrade-interactive
is a great time-saver!I have workspaces that use different versions of the same package. For example, one workspace is using a version
^4.11.3
and another workspace is using versionnext
.The problem is that when I run
yarn upgrade-interactive
, there is no information about which workspaces are being upgraded, and the information that is displayed is not accurate:This is not accurate because the menu only shows the Current version as
next
, despite the fact that there's multiple workspaces, some usingnext
and some using^4.11.3
.Which workspaces is it going to upgrade if I change the version?
How can the user understand what will be upgraded?
Describe the solution you'd like
A few possible solutions for this:
yarn upgrade-interactive --workspace-versions
would always show the workspace column and always show separate entries for each workspace, not just when there's multiple versions.yarn upgrade-interactive --workspace-versions
would always show a separate section for each workspace.Describe the drawbacks of your solution
If someone was upgrading a messy package with a bunch of workspaces that had different versions of things, they may have to press enter more times.
Describe alternatives you've considered
Since it's ambiguous about which workspaces will be upgraded (Current does not reflect the version used by some workspaces), this could be considered a bug.
The text was updated successfully, but these errors were encountered: