Skip to content

Warn on empty or open required_ruby_version specification attribute.#5010

Merged
hsbt merged 1 commit into
masterfrom
recommend-ruby-version
Feb 27, 2024
Merged

Warn on empty or open required_ruby_version specification attribute.#5010
hsbt merged 1 commit into
masterfrom
recommend-ruby-version

Conversation

@simi

@simi simi commented Oct 25, 2021

Copy link
Copy Markdown

This is just concept what we can do to improve situation of filled in required_ruby_version value to prevent problems described in rubygems/rfcs#34.

I have used placeholder text for now. Feel free to suggest better. We can also use different text for different situations.

ℹ️ required_ruby_version is already part of bundle gem template based on this logic.

https://github.com/rubygems/rubygems/blob/2f48d60afe050862258212d0c68530f39fb5fdfa/bundler/lib/bundler/cli/gem.rb#L407-L414

Later on we can move this attribute to required. It could be also possible to warn on "potentially misused values". For example when newer Ruby is used to build gem (then the minimal), we can inform user to ensure it is good idea to check if gem is still compatible with minimal Ruby version.

related to rubygems/guides#295, rubygems/rfcs#34 and rubygems/rfcs#26

/cc @marcandre

@deivid-rodriguez

Copy link
Copy Markdown
Contributor

I really like this! 👍

@doodzik

doodzik commented Oct 26, 2021

Copy link
Copy Markdown
Contributor

I really like it 🔥

This is a bit tangential, but I wonder If it would make sense to enforce a minimal ruby version based on what ruby version is supported by rubygems/bundler. I could see this being problematic if we prevent security patches to gems, but I'm not sure how much that is a concern.

@deivid-rodriguez

Copy link
Copy Markdown
Contributor

@doodzik That seems a bit too much to me. I think there's a variety of reasons why people still support old rubies in their gems, and I think completely forbidding it might have the effect of discouraging people from upgrading rubygems/bundler.

@deivid-rodriguez

Copy link
Copy Markdown
Contributor

What's left to do here?

@simi

simi commented Nov 1, 2021

Copy link
Copy Markdown
Author

Warning text is currently just a placeholder. Feel free to suggest better.

Comment thread lib/rubygems/specification_policy.rb Outdated
Comment thread lib/rubygems/specification_policy.rb Outdated
@simi simi force-pushed the recommend-ruby-version branch 2 times, most recently from 2d88804 to ded2a57 Compare April 19, 2023 21:23
@simi simi marked this pull request as ready for review April 19, 2023 21:27

@doodzik doodzik left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@deivid-rodriguez deivid-rodriguez left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

@hsbt

hsbt commented Aug 8, 2023

Copy link
Copy Markdown
Member

@simi Can you merge this? I'd like to merge for Ruby 3.3.0-preview2.

@simi

simi commented Aug 8, 2023 via email

Copy link
Copy Markdown
Author

Comment thread lib/rubygems/specification_policy.rb Outdated
@hsbt

hsbt commented Dec 6, 2023

Copy link
Copy Markdown
Member

I'll handle this for RubyGems 3.6 and Ruby 3.4.

@hsbt hsbt self-assigned this Dec 6, 2023
@hsbt hsbt force-pushed the recommend-ruby-version branch from 7f07c4f to 9c2d1e6 Compare December 8, 2023 05:19
@simi simi force-pushed the recommend-ruby-version branch 2 times, most recently from cd2ab99 to c418947 Compare February 25, 2024 22:05
@simi

simi commented Feb 25, 2024

Copy link
Copy Markdown
Author

rebased @hsbt

@simi simi force-pushed the recommend-ruby-version branch from c418947 to e4bb337 Compare February 25, 2024 22:10

@hsbt hsbt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@simi Thank you!

@hsbt hsbt merged commit 1aa7252 into master Feb 27, 2024
@hsbt hsbt deleted the recommend-ruby-version branch February 27, 2024 03:32
deivid-rodriguez pushed a commit that referenced this pull request Mar 20, 2024
Warn on empty or open required_ruby_version specification attribute.

(cherry picked from commit 1aa7252)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants