mattbrictson / bundle_update_interactive

A stylish interactive mode for Bundler, inspired by `yarn upgrade-interactive`
MIT License
137 stars 3 forks source link

Idea: `--patch` and `--minor` flags to limit scope of updates #20

Open mattbrictson opened 1 month ago

mattbrictson commented 1 month ago

When updating gems in a project that is far behind in its dependency versions, update-interactive will suggest updating everything to the latest version, which is risky. It would nice to limit that risk by instructing update-interactive to bump versions by patch level only, avoiding the riskier minor and major updates.

For example, consider a lock file that currently has rack 2.2.7. The latest version of rack is 3.1.7, but updating by a major version is risky. Instead, we'd like to update to the latest 2.2.x version first, which is 2.2.9.

Currently, the only way to do this is to manually add rack to the Gemfile to limit the scope of updates:

gem "rack", "< 2.3", # or "~> 2.2.7"

And then run bundle update-interactive.

Instead, I propose this could be accomplished by passing a --patch flag, so that no manual Gemfile edits are needed:

# Limit updates to patch version changes (exclude minor and major updates)
bundle update-interactive --patch

Essentially this would be an interactive version of a feature Bundler already provides via bundle update --patch.

Likewise we could offer a --minor flag to allow patch and minor upgrades, excluding major ones.

Originally discussed in #19.