Skip to content
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

Fix supported Ruby version to be only 3.1.x #32

Merged
merged 2 commits into from
Sep 3, 2023
Merged

Conversation

kudojp
Copy link
Owner

@kudojp kudojp commented Sep 3, 2023

Why

Current implementation of the scheduler cannot be used in Ruby ver3.1.x, because the scheduler of this gem accepts only 3 arguments (src) on #io_read.

  • In Ruby 3.0.x, io_read is called with 4 arguments (not documented, src)
  • In Ruby 3.1.x, io_read is called with 3 arguments (doc, src)
  • In Ruby 3.2.x, io_read is called with 3 arguments (doc is wrong, src) - Not added to CI testing yet

What

  • Specify spec.required_ruby_version = "~> 3.1.0" in gemspec
  • Remove CI testing with Ruby ver 3.0.

📝 Why this was not noticed so far.

image

The CI testing with Ruby 3.0 began to fail suddenly on some time between Dec 13, 2022 and Jul 4, 2023.
I will explain the reason of this.

jobs:
  test:
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest]
        ruby: [3.0, 3.1]
    runs-on: ${{ matrix.os }}
    steps:
      - uses: ruby/setup-ruby@v1
        with:
          ruby-version: ${{ matrix.ruby }}

On Dec 13, 2022

CI testing was triggered. At this time, the latest ruby was 3.1.x.
3.0 was interpreted as 3, and the latest version of 3.x (=3.1.x) was used.
(ref: actions/runner#849 ruby/setup-ruby#252).

Since #io_read takes 3 arguments in Ruby3.1, the CI testing did not fail.

On Dec 25, 2022

Ruby 3.2 was released. At this time, the latest ruby became 3.2.x.

On Jul 4, 2023

CI testing was triggered. At this time, the latest ruby was 3.2.x.
3.0 was interpreted as 3, and the latest version of 3.x (= 3.2.x), was used.

Since #io_read takes 4 arguments in Ruby3.2, the CI testing failed.

@kudojp kudojp changed the title Fix supported Ruby version to be ~> 3.1 Fix supported Ruby version to be 3.1 or later Sep 3, 2023
@codecov-commenter
Copy link

codecov-commenter commented Sep 3, 2023

Codecov Report

Merging #32 (463e3b2) into main (cfc404d) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main      #32   +/-   ##
=======================================
  Coverage   66.96%   66.96%           
=======================================
  Files           3        3           
  Lines         112      112           
=======================================
  Hits           75       75           
  Misses         37       37           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@kudojp kudojp changed the title Fix supported Ruby version to be 3.1 or later Fix supported Ruby version to be 3.1.x Sep 3, 2023
@kudojp kudojp force-pushed the fix-ci-test-in-ruby3.0 branch 2 times, most recently from 463e3b2 to 7a6d992 Compare September 3, 2023 08:54
@kudojp kudojp changed the title Fix supported Ruby version to be 3.1.x Fix supported Ruby version to be only 3.1.x Sep 3, 2023
@kudojp kudojp merged commit cd62479 into main Sep 3, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants