mattbrictson / mattbrictson/bundle_update_interactive

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

Open
#20 1 comment 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
246
Forks
7
Avg merge
15h 31m
Merged PRs (30d)
3

Description

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:

```ruby
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:

```sh
# 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](https://github.com/mattbrictson/bundle_update_interactive/issues/19#issuecomment-2260405287).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the bundle update-interactive command entry point and compare its option handling with Bundler's existing bundle update --patch behavior. The work is done when --patch limits suggestions to patch updates and --minor permits patch and minor updates without requiring Gemfile edits.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.