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

Deprecate Ruby 2.7 #340

Closed
joshbuker opened this issue Mar 30, 2023 · 0 comments · Fixed by #357
Closed

Deprecate Ruby 2.7 #340

joshbuker opened this issue Mar 30, 2023 · 0 comments · Fixed by #357

Comments

@joshbuker
Copy link
Member

joshbuker commented Mar 30, 2023

Per ossf/osv-schema#123 (comment), Ruby 2.7 has reached end-of-life, and the new minimum version should be at least 3.0 which is in security-only maintenance.

Need to update the CI and gemspec accordingly.

willnet added a commit to willnet/sorcery that referenced this issue Jan 10, 2024
Now, Ruby 2.7 is EOL, and Rails 6.0 is also EOL.

So I changed the CI settings to support only those higher versions.

Fix Sorcery#340
willnet added a commit to willnet/sorcery that referenced this issue Jan 10, 2024
Now, Ruby 2.7 is EOL, and Rails 6.0 is also EOL.

So I changed the CI settings to support only those higher versions.

Fix Sorcery#340
willnet added a commit to willnet/sorcery that referenced this issue Jan 31, 2024
Now, Ruby 2.7 is EOL, and Rails 6.0 is also EOL.

So I changed the CI settings to support only those higher versions.

Fix Sorcery#340
joshbuker added a commit that referenced this issue Mar 8, 2024
* Change CI settings for support Ruby3.0+ Rails6.1+

Now, Ruby 2.7 is EOL, and Rails 6.0 is also EOL.

So I changed the CI settings to support only those higher versions.

Fix #340

* Move rspec-rails development dependency to Gemfiles

Since the supported version of rspec-rails depends on the version of rails we use, move the description to each Gemfile

* Fix the following failure

```
Failures:

  1) SorceryController with session timeout features with 'session_timeout_from_last_action' does not logout if there was activity
     Failure/Error: expect(response).to be_successful
       expected `#<ActionDispatch::TestResponse:0x0000557bab96c6d0 @mon_data=#<Monitor:0x0000557bab96c630>, @mon_data_...control={}, @request=#<ActionController::TestRequest GET "http://test.host/test_login" for 0.0.0.0>>.successful?` to return true, got false
     # ./spec/controllers/controller_session_timeout_spec.rb:146:in `block (4 levels) in <top (required)>'

Finished in 2.52 seconds (files took 1.66 seconds to load)
```

[Starting with Rails 7.0, instance variables are reset between controller test requests](rails/rails#43735).

This causes the second and subsequent requests to be judged as un-logged-in if there are no records in the DB.  Putting a record in the DB fixes the failure.

* Fix failures of specs due to a change in the keyword argument specification

fix failing tests like the following

```
  1) SorceryController using create_from supports nested attributes
     Failure/Error: @user = user_class.create_from_provider(provider_name, @user_hash[:uid], attrs, &block)

       #<User(id: integer, username: string, email: string, crypted_password: string, salt: string, created_at: datetime, updated_at: datetime, activation_state: string, activation_token: string, activation_token_expires_at: datetime, last_login_at: datetime, last_logout_at: datetime, last_activity_at: datetime, last_login_from_ip_address: string) (class)> received :create_from_provider with unexpected arguments
         expected: ("facebook", "123", {:username=>"Haifa, Israel"}) (keyword arguments)
              got: ("facebook", "123", {:username=>"Haifa, Israel"}) (options hash)
     # ./lib/sorcery/controller/submodules/external.rb:194:in `create_from'
     # ./spec/rails_app/app/controllers/sorcery_controller.rb:456:in `test_create_from_provider'
     # ./spec/controllers/controller_oauth2_spec.rb:44:in `block (3 levels) in <top (required)>'
```

* Remove an useless spec

A spec fails like the following in Rails 7.1

```
  1) SorceryController when activated with sorcery #login when succeeds sets csrf token in session
     Failure/Error: expect(session[:_csrf_token]).not_to be_nil

       expected: not nil
            got: nil
     # ./spec/controllers/controller_spec.rb:68:in `block (5 levels) in <top (required)>'
```

Delete this because it didn't seem like a useful test.

* Add Changelog

* Readd rspec-rails to dev dependencies for running tests locally

* Do not remove the csrf test

* Gitignore new sqlite3 files

* Add pending clause for Rails 7.1 for CSRF token

---------

Co-authored-by: Josh Buker <[email protected]>
willnet added a commit to willnet/sorcery that referenced this issue Mar 14, 2024
work related to Sorcery#340. While CI was targeted for Ruby 3.0 and above, gem dependencies were still specified for older versions.
willnet added a commit to willnet/sorcery that referenced this issue Mar 14, 2024
This commit is related to Sorcery#340. In Sorcery#357, we limited CI support to Ruby 3.0 and above, but in the gemspec, we still had dependencies set for older Ruby versions.
joshbuker pushed a commit that referenced this issue Mar 25, 2024
* Bump up required ruby version to 3.0.0

This commit is related to #340. In #357, we limited CI support to Ruby 3.0 and above, but in the gemspec, we still had dependencies set for older Ruby versions.

* Update CHANGELOG.md
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 a pull request may close this issue.

1 participant