Summary
Feature proposal: Additional output from bundle update that provides a useful summary of which gems were updated, categorised between major and non-major, and top level and implicit dependencies.
Describe the problem as clearly as you can
When you run bundle update it isn't very obvious from the output which gems updated, because the update messages are mixed in with the install messages:
Using xpath 3.2.0
Using spring-watcher-listen 2.0.1
Using rails-dom-testing 2.0.3
Using loofah 2.18.0
Using activerecord 7.0.3.1 (was 6.1.6)
Using rails-html-sanitizer 1.4.3
Using capybara 3.37.1
Using webdrivers 5.0.0
Scrolling a long list to try to see all the updated ones can be quite tiresome, and doesn't really aid the user in what tasks they are likely trying to do. Possible tasks they may be trying to accomplish:
- See which gems were updated
- Identify which top-level gems were updated (as they may care about these a lot more than implicit dependencies)
- Identify which gems updated past a major version, as this may indicate backwards-compatibility-breaking changes
The other approach is to diff the Gemfile.lock, but that has a lot of repetition:
- actionmailbox (6.1.6)
- actionpack (= 6.1.6)
+ actionmailbox (7.0.3.1)
+ actionpack (= 7.0.3.1)
- actionmailer (6.1.6)
- actionpack (= 6.1.6)
+ actionmailer (7.0.3.1)
+ actionpack (= 7.0.3.1)
And also doesn't help with extracting higher-level information out of the data such as whether gems are top-level, or highlighting major version bumps.
I think from a flexibility and tooling perspective, a machine-readable output from bundle install will be the most useful thing. But I think for the 90% use-case where users are doing a bundle update themselves, directly on a terminal, a lot of value could be delivered by the relatively simpler feature of adding a human-readable summary to the output.
I think the highest value is to highlight just which gems changed, but I think it's also extremely valuable to separately highlight major version bumps. I think it may also be useful to distinguish between top-level and implicit dependencies.
Here is the output from a PoC I have made:
Bundle updated!
Gems in the group 'production' were not updated.
Major bumps
###########
Primary dependencies
====================
activerecord-session_store: 1.1.3 => 2.0.0
i18n-tasks: 0.9.37 => 1.0.11
puma: 4.3.12 => 5.6.5
rails: 6.1.6 => 7.0.3.1
rails-i18n: 6.0.0 => 7.0.5
Implicit dependencies
=====================
actioncable: 6.1.6 => 7.0.3.1
actionmailbox: 6.1.6 => 7.0.3.1
actionmailer: 6.1.6 => 7.0.3.1
actionpack: 6.1.6 => 7.0.3.1
actiontext: 6.1.6 => 7.0.3.1
actionview: 6.1.6 => 7.0.3.1
activejob: 6.1.6 => 7.0.3.1
activemodel: 6.1.6 => 7.0.3.1
activerecord: 6.1.6 => 7.0.3.1
activestorage: 6.1.6 => 7.0.3.1
activesupport: 6.1.6 => 7.0.3.1
public_suffix: 4.0.7 => 5.0.0
rack-test: 1.1.0 => 2.0.2
railties: 6.1.6 => 7.0.3.1
Minor bumps
###########
Primary dependencies
====================
bootsnap: 1.12.0 => 1.13.0
newrelic_rpm: 8.8.0 => 8.10.0
pg: 1.4.0 => 1.4.3
selenium-webdriver: 4.2.1 => 4.4.0
shakapacker: 6.4.1 => 6.5.1
warning: 1.2.1 => 1.3.0
Implicit dependencies
=====================
addressable: 2.8.0 => 2.8.1
erubi: 1.10.0 => 1.11.0
i18n: 1.10.0 => 1.12.0
minitest: 5.16.1 => 5.16.3
msgpack: 1.5.2 => 1.5.6
nokogiri: 1.13.6 => 1.13.8
parser: 3.1.2.0 => 3.1.2.1
rack: 2.2.3.1 => 2.2.4
rb-fsevent: 0.11.1 => 0.11.2
sprockets: 4.0.3 => 4.1.1
tilt: 2.0.10 => 2.0.11
tzinfo: 2.0.4 => 2.0.5
unicode-display_width: 2.1.0 => 2.2.0
Removed
#######
mini_portile2: 2.8.0 => ______
Open questions
- How to format the output
- Which way it should be sliced
- is top level / implicit a useful division?
- Should it be major/minor first, or primary/implicit?
- Does the major/minor x primary/implicit combined grouping make sense, or should it be two separate splits of all updated gems by those dimensions?
- Is this the right nomenclature? (primary & implicit in particular)
- Should the feature be added to
bundle update straight-up, or behind a new option flag?
Summary
Feature proposal: Additional output from
bundle updatethat provides a useful summary of which gems were updated, categorised between major and non-major, and top level and implicit dependencies.Describe the problem as clearly as you can
When you run
bundle updateit isn't very obvious from the output which gems updated, because the update messages are mixed in with the install messages:Scrolling a long list to try to see all the updated ones can be quite tiresome, and doesn't really aid the user in what tasks they are likely trying to do. Possible tasks they may be trying to accomplish:
The other approach is to diff the Gemfile.lock, but that has a lot of repetition:
And also doesn't help with extracting higher-level information out of the data such as whether gems are top-level, or highlighting major version bumps.
I think from a flexibility and tooling perspective, a machine-readable output from
bundle installwill be the most useful thing. But I think for the 90% use-case where users are doing a bundle update themselves, directly on a terminal, a lot of value could be delivered by the relatively simpler feature of adding a human-readable summary to the output.I think the highest value is to highlight just which gems changed, but I think it's also extremely valuable to separately highlight major version bumps. I think it may also be useful to distinguish between top-level and implicit dependencies.
Here is the output from a PoC I have made:
Open questions
bundle updatestraight-up, or behind a new option flag?