-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Soft-yanking #34
Comments
🤔 It seems majority of examples are related to old EOL Ruby. I suggest to upgrade instead looking for bandaid. |
Sounds to me like a good idea. It's not clear to me what the advantages of "hard-yanking" over this. |
For the user standpoint? Practically, it's often easier said than done. See e.g. GitLab 2.5.3 -> 2.6.3. From maintainers' standpoint? |
@pirj gem support isn't relevant at all. Related Ruby itself is not supported anymore and you should not use it. 🤔 If I remember well, yank of gem is recommended to be done only under some circumstances (for example when you include some secrets as part of the gem bundle by mistake). If you just release broken version, you can fix it by releasing another one. Can you explain on your examples why releasing new version isn't enough to fix the problem and how soft-yanking would solve the problem instead? |
Hard-yanking should stay for cases like
IANAL, but probably not for licensing issues. |
Easy. # Gemfile
gem 'rspec-rails' Releasing See the link from the description for details. |
And and wouldn't be locking to minor version enough for you in this case? # Gemfile
gem 'rspec-rails', '~> 3.9' |
You got straight to the point. |
@pirj that's from your point of view. Another projects will get into trouble even they don't care in this case getting (and also potentially reporting) annoying warning. And since in your case the reason is EOL Ruby, I think maintainer should prefer comfort for officially supported Ruby versions and this this is not valid reason for any kind of yank (even soft) IMHO. |
I apologize for making this point, but I'm speaking not just as a developer of a project who is too lazy to update Ruby version, but as one of RSpec maintainers. |
My understanding is that the warning would only occur for anyone who happened to have locked on the 4.0.0 version. It would disappear as soon as they follow instructions, which would install the correct version. Any other users would have the correct version installed (i.e. the latest 3.x.x or 4.0.1 depending on their set). |
@marcandre according to
I assumed anyone using soft-yanked version will get warning or error. @pirj no need to apologise, I'm just sharing my ideas and trying to find out potential problems to discuss. |
Speaking of hard-yanking, I stick to the belief this should be reserved exclusively to the scenario when this is coordinated with the RubyGems team. But it's an off-topic, better suited for rubygems/rubygems#1506 or another RFC. |
Right. To use a soft-yanked version you must have done a |
🤔 Also getting back to this solution. Wouldn't be enough to release |
This assumes that this 4.0.0.1 gem can successfully be installed and run on older Ruby... |
This just assumes 4.0.0.1 gem can be successfully installed on older Ruby. It will immediately raise (and print explaining message) on older Ruby once required -> there is no need to make it really compatible. |
Understood, but depending on the issue (an unresolvable dependency, etc.) it can be difficult to do from the 4.x code. |
@pirj @marcandre regarding
If I understand it well, those problems will solve picking non-supported old rubies thanks to missing 🤔 Current minimal Ruby supported is 2.3 and there is plan to drop it (rubygems/rubygems#3260). So in theory, even this will get shipped, old clients (RubyGems on Ruby 2.2) will not be able to use this feature and all reported example problems will be still present. |
Releasing 4.0.0.1 based on 3.x branch doesn't make sense since it in theory can be still provided for clients not facing any problems (for example having gem locked to raise "rspec-rails 4.x and newer is not supported on Ruby #{RUBY_VERSION}, please lock rspec-rails to ~> 3.9 in your Gemfile." if RUBY_VERSION < '2.2'
IMHO There is nothing ugly on locking your gems if newer version is not supported yet. For example currently I do this for psych 4, since it is not compatible with our app yet. And also that's the price you pay for using really old Ruby in this case. 🤷 |
I understand this, but it may not be easy/feasible. In your example, you assume:
Maybe the situation is better now, with the latest available
AFAIK, there's no way for
Absolutely, if this is due to your app's code. If it is not supported yet because of dependencies, then I have a different opinion and believe it is the job of the gems to accurately describe those dependencies, and that of the dependency manager ( |
OK, clear. It is not about IMHO this is also the price for using old Ruby. Ruby 2.2 EOL (of security maintenance) was 3 years ago. If all you need to do to fix this problem currently is to lock
Not sure how related this is, but my reason is not only in app's code, it is also related to gems using YAML configuration since there are some new limitations enabled by default. |
Right, and the proposal here does not solve anything for |
BTW, I was curious about the equivalent in |
I haven't gone through the issues raised in this thread, however, I want to add that we do plan to implement a soft yank-like feature for security advisories. Prev work rubygems/rubygems#2319 |
@sonalkr132 Nice, thanks for the heads-up. My reasoning for soft-yanking was different - installing a certain gem version will most probably result in app errors. Or dependent gem CI builds would break. |
Hex's retire is basically this feature, it'd be nice if there was a way to make a gem retirable to new installs, but not existing installs, e.g. bundler rejects adding a "retired" gem to a lock file, but if its present already will only warn (loudly if needed) about it, or would require a |
Any conclusion? I can send an RFC PR, but would like to know that it's preliminarily agreed on.
|
As an alternative, can a hard yank instead include a suggested alternate version? |
Another case where soft-yanking or yanking with an alternate version would help mitigate a loose dependency mistake. |
Problem
Occasionally, when maintainers publish new gem versions, they make mistakes.
Examples:
rails
Ruby 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#L323It has been fixed in May 2020, but only released nearly a year later in Rails 5.2.4.6 (May 2021).
rspec-rails
Ruby version constraint mistake that brokerspec-rails
on Ruby 2.2.diff-lcs
issue with older Ruby versionscucumber
4.0.0 broke compatibility due todiff-lcs
dependency, fixed in 4.0.1 by pinningdiff-lcs
version 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:
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: rubygems/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.
The text was updated successfully, but these errors were encountered: