ruby / ruby/rubygems

[feature request] Allow version specifier in `bundle update *gem`

Open
#8,855 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bundler
Dominant language
Ruby
Stars
4k
Forks
1.9k
Avg merge
1d 2h
Merged PRs (30d)
81

Description

Hi friends!

I'd like to gauge interest in allowing for version specifiers in bundle update

I work at Shopify, and for us the interest would be in (programmatically) making minimal updates to direct or transitive dependencies. I previously worked at Amazon/AWS and while I don't know if anyone there is working on it yet, they likely have a similar use case.

By "minimal updates" I mean updating only a specific dependency (either in lockfile only, or in gemfile if direct) and only if necessary, its transitives.

Use cases would be regularly scheduled updates (like dependabot) or urgent security patches. These could be to introduce both newer and older versions, for example if a latest version of a library has a vulnerability, we may want to roll it back.

I'll leave the end design up to maintainers, but in my mind it might look something like this:

$ bundle update nokogiri "rails, >=8.02"

Where nokogiri is a "latest" but rails must pass a version constraint. This came to my mind first since it has a symmetry to Gemfile syntax

Alternatively, since a gem identifier must start with [a-zA-Z_], and a version constraint will not, it could simply be positional, where a version restraint applies to its immediately preceding gem

$ bundle update nokogiri rails '>=8.02'

Open to other ideas as well, and I'd be interested in drafting the change if you'd be interested in having it

Contributor guide

Open the contributing guide

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

The issue names the bundle update command and compares it with Gemfile version-constraint syntax, but no files or tests are identified. Start by examining how bundle update parses gem arguments and how Gemfile constraints are represented. Done means supporting constrained updates for selected gems while limiting changes to those gems and necessary transitives.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.