-
Notifications
You must be signed in to change notification settings - Fork 30
Description
Problem
Occasionally, when maintainers publish new gem versions, they make mistakes.
Examples:
-
railsRuby version constraint mistake that broke 5.2.4.3-5.2.4.5 on Ruby 2.2. See https://github.com/rails/rails/blob/v5.2.4.3/activesupport/lib/active_support/cache/redis_cache_store.rb#L323
It has been fixed in May 2020, but only released nearly a year later in Rails 5.2.4.6 (May 2021). -
rspec-railsRuby version constraint mistake that brokerspec-railson Ruby 2.2. -
diff-lcsissue with older Ruby versions -
cucumber4.0.0 broke compatibility due todiff-lcsdependency, fixed in 4.0.1 by pinningdiff-lcsversion to~> 1.3.
Suggestion: Soft-yank
What soft-yanking means?
Gem maintainer scenario
The maintainer can soft-yank a gem version, just like they can yank it:
gem soft-yank GEM -v VERSION [-p PLATFORM] [--key KEY_NAME] [--host HOST]Server/CI scenario
It remains possible to install the soft-yanked version of a gem with bundle install from Gemfile.lock.
Bundler emits a warning.
Developer scenario
Bundler excludes soft-yanked versions from dependency resolution.
bundle update/bundle lock show an error, just like for a yanked gem version or a removed gem.
Could things have gone better?
rspec-rails 4.0.0 could have been soft-yanked.
cucumber 4.0.0 could have been soft-yanked.
diff-lcs 1.4.3 could have been soft-yanked.
I have no such certainty regarding Rails, since it took a year to release the fix.
Misc
Related: ruby/rubygems#1506 (comment)
#26 is semi-related, a proposal to prevent the only cause I'm practically aware of, weak Ruby version constraint. There might be others, like adding extra runtime dependencies, but I have not seen this in the wild.
cc @halostatue @JonRowe @marcandre @mattwynne @aslakhellesoy.