From ad91686b62c8a006044b230e7628f99fca994867 Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Tue, 9 Feb 2021 10:03:34 -0300 Subject: [PATCH] Test on Ruby 3+ with Rails 6+ And remove dupe entry in the exclude matrix. In order to get Ruby 3 working we needed to install `rexml` as part of the test dependencies, only done on the main Gemfile (Rails 6.1) and the 6.0 versions. (which are the only ones supported by Ruby 3.) Devise itself doesn't require `rexml` as it does nothing with it, but a dependency we use during tests seem to require it. I was able to track it down to omniauth-openid -> rack-openid -> ruby-openid requiring it: https://github.com/openid/ruby-openid/blob/13a88ad6442133a613d2b7d6601991a84b34630d/lib/openid/yadis/xrds.rb#L1 So while we have tests using omniauth-openid, we'll need this require in place as well. Ideally that upstream version of ruby-openid should have it, but it seems that one isn't updated in a while. --- .github/workflows/test.yml | 13 +++++++++++-- CHANGELOG.md | 2 ++ Gemfile | 1 + Gemfile.lock | 2 ++ gemfiles/Gemfile-rails-6-0 | 1 + 5 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3937d5c4..0af48ddd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,6 +21,7 @@ jobs: - 2.5 - 2.6 - 2.7 + - 3.0 env: - DEVISE_ORM=active_record - DEVISE_ORM=mongoid @@ -59,8 +60,6 @@ jobs: gemfile: gemfiles/Gemfile-rails-4-2 - ruby: 2.7 gemfile: gemfiles/Gemfile-rails-4-1 - - ruby: 2.7 - gemfile: gemfiles/Gemfile-rails-4-1 - ruby: 2.7 gemfile: gemfiles/Gemfile-rails-4-2 - ruby: 2.7 @@ -69,6 +68,16 @@ jobs: gemfile: gemfiles/Gemfile-rails-5-1 - ruby: 2.7 gemfile: gemfiles/Gemfile-rails-5-2 + - ruby: 3.0 + gemfile: gemfiles/Gemfile-rails-4-1 + - ruby: 3.0 + gemfile: gemfiles/Gemfile-rails-4-2 + - ruby: 3.0 + gemfile: gemfiles/Gemfile-rails-5-0 + - ruby: 3.0 + gemfile: gemfiles/Gemfile-rails-5-1 + - ruby: 3.0 + gemfile: gemfiles/Gemfile-rails-5-2 - env: DEVISE_ORM=mongoid gemfile: Gemfile - env: DEVISE_ORM=mongoid diff --git a/CHANGELOG.md b/CHANGELOG.md index 995f9f08..7cdbdd6c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ * Devise now enables the upgrade of OmniAuth 2+. Previously Devise would raise an error if you'd try to upgrade. Please note that OmniAuth 2 is considered a security upgrade and recommended to everyone. You can read more about the details (and possible necessary changes to your app as part of the upgrade) in [their release notes](https://github.com/omniauth/omniauth/releases/tag/v2.0.0). [Devise's OmniAuth Overview wiki](https://github.com/heartcombo/devise/wiki/OmniAuth:-Overview) was also updated to cover OmniAuth 2.0 requirements. - Note that the upgrade required Devise shared links that initiate the OmniAuth flow to be changed to `method: :post`, which is now a requirement for OmniAuth, part of the security improvement. If you have copied and customized the Devise shared links partial to your app, or if you have other links in your app that initiate the OmniAuth flow, they will have to be updated to use `method: :post`, or changed to use buttons (e.g. `button_to`) to work with OmniAuth 2. (if you're using links with `method: :post`, make sure your app has `rails-ujs` or `jquery-ujs` included in order for these links to work properly.) - As part of the OmniAuth 2.0 upgrade you might also need to add the [`omniauth-rails_csrf_protection`](https://github.com/cookpad/omniauth-rails_csrf_protection) gem to your app if you don't have it already. (and you don't want to roll your own code to verify requests.) Check the OmniAuth v2 release notes for more info. + * Add support for Ruby 3. + * Add support for Rails 6.1. * Move CI to GitHub Actions. * deprecations diff --git a/Gemfile b/Gemfile index f9112334..22ca4afe 100644 --- a/Gemfile +++ b/Gemfile @@ -18,6 +18,7 @@ gem "responders", "~> 3.0" group :test do gem "omniauth-facebook" gem "omniauth-openid" + gem "rexml" gem "timecop" gem "webrat", "0.7.3", require: false gem "mocha", "~> 1.1", require: false diff --git a/Gemfile.lock b/Gemfile.lock index c178bd18..e08446d7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -183,6 +183,7 @@ GEM responders (3.0.1) actionpack (>= 5.0) railties (>= 5.0) + rexml (3.2.4) ruby-openid (2.9.2) ruby2_keywords (0.0.4) sprockets (4.0.2) @@ -223,6 +224,7 @@ DEPENDENCIES rails-controller-testing! rdoc responders (~> 3.0) + rexml sqlite3 (~> 1.4) timecop webrat (= 0.7.3) diff --git a/gemfiles/Gemfile-rails-6-0 b/gemfiles/Gemfile-rails-6-0 index e4328485..d01a464f 100644 --- a/gemfiles/Gemfile-rails-6-0 +++ b/gemfiles/Gemfile-rails-6-0 @@ -16,6 +16,7 @@ gem "responders", "~> 3.0" group :test do gem "omniauth-facebook" gem "omniauth-openid" + gem "rexml" gem "timecop" gem "webrat", "0.7.3", require: false gem "mocha", "~> 1.1", require: false