-
Notifications
You must be signed in to change notification settings - Fork 106
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
Centralize Ruby Version to .ruby-version
#171
Conversation
The `.ruby-version` file is the ecosystem standard for defining a Ruby version. This PR adds the `.ruby-version` file, ensures a `required_ruby_version` is set, and removes all other references to Ruby in this repository, aligning it with the standard. > [!IMPORTANT] > Please verify the following before merging: Verify that the changes in the PR meets the following requirements or adjust manually to make it compliant: - [ ] `.ruby-version` file is present with the correct Ruby version defined - [ ] A `required_ruby_version` in your gemspec is set - [ ] There is no Ruby version present in the `dev.yml` Ruby task (before: `- ruby: x.x.x`, after: `- ruby`) - [ ] There is no Ruby version/requirement referenced in the `Gemfile` (no lines with `ruby <some-version>`) - [ ] A `Gemfile.lock` is built with the defined Ruby version - [ ] The version of Rubocop installed is 1.61.0 or greater - [ ] There is no `TargetRubyVersion` defined in `rubocop.yml` (reads from `required_ruby_version` on Rubocop 1.61.0) - [ ] There is no Ruby argument present in `ruby/setup-ruby` Github Actions that do **not** run on a Ruby matrix (no lines with `ruby-version: “x.x”`) To establish consistency, the `required_ruby_version` is set to 2.7. If you think that another version is a better fit, please make the applicable changes. Please merge this PR if it looks good, this PR will be addressed if there isn't any activity after 4 weeks.
.ruby-version
@george-ma this doesn't actually add a |
d5554a3
to
0769198
Compare
Forgot to commit that file good 👁️ @swalkinshaw ! |
graphql-batch.gemspec
Outdated
@@ -10,6 +10,8 @@ Gem::Specification.new do |spec| | |||
spec.homepage = "https://github.com/Shopify/graphql-batch" | |||
spec.license = "MIT" | |||
|
|||
spec.required_ruby_version = ">= 2.4" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@george-ma we have tests using 2.4
graphql-batch/.github/workflows/ci.yml
Lines 16 to 19 in 8afcdbb
- ruby: 2.4 | |
graphql_version: '~> 1.12.18' | |
- ruby: 2.4 | |
graphql_version: '~> 1.13' |
So I updated this to 2.4 instead of 2.7, but now Rubocop requires 2.7. Was there a reason why you had to bump rubocop?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes it's for this PR rubocop/rubocop#12645 (released in 1.61.0)
This way removing the TargetRubyVersion
, Rubocop will use the ruby version defined in the .gemspec
instead of the .ruby-version
file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can drop 2.4 now anyway to simplify this. I'll do that
What are you trying to accomplish?
The
.ruby-version
file is the ecosystem standard for defining a Ruby version. This PR adds the.ruby-version
file, ensures arequired_ruby_version
is set, and removes all other references to Ruby in this repository, aligning it with the standard.What should reviewers focus on?
Important
Please verify the following before merging:
Verify that the changes in the PR meets the following requirements or adjust manually to make it compliant:
.ruby-version
file is present with the correct Ruby version definedrequired_ruby_version
in your gemspec is setdev.yml
Ruby task (before:- ruby: x.x.x
, after:- ruby
)Gemfile
(no lines withruby <some-version>
)Gemfile.lock
is built with the defined Ruby versionTargetRubyVersion
defined inrubocop.yml
(reads fromrequired_ruby_version
on Rubocop 1.61.0)ruby/setup-ruby
Github Actions that do not run on a Ruby matrix (no lines withruby-version: “x.x”
)To establish consistency, the
required_ruby_version
is set to 2.7. If you think that another version is a better fit, please make the applicable changes.Please merge this PR if it looks good, this PR will be addressed if there isn't any activity after 4 weeks.