Feature #25048

Ruby 2.4 support

Added by VVD VVD 9 months ago. Updated 9 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Ruby support
Target version:3.4.0
Resolution:Fixed

Description

Ruby 2.4.0 was released 25 Dec 2016.


Related issues

Related to Redmine - Defect #25460: Redmine 3.3.2 db:migrate terminate with cryptic error mes... Closed
Copied from Redmine - Feature #21668: Ruby 2.3 support Closed

Associated revisions

Revision 16340
Added by Toshi MARUYAMA 9 months ago

upgrade Rails to 4.2.8 (#25048)

Ruby 2.4 tests fail.

Revision 16353
Added by Jean-Philippe Lang 9 months ago

Ruby 2.4: Fixed "Fixnum is deprecated" warning of nokogiri (#25048).

Patch by Go MAEDA.

Revision 16354
Added by Jean-Philippe Lang 9 months ago

Ruby 2.4: Fixed "key must be 32 bytes" error of OpenSSL::Cipher (#25048).

Patch by Go MAEDA.

Revision 16355
Added by Jean-Philippe Lang 9 months ago

Ruby 2.4: Fixed "Fixnum is deprecated" warning in QueryTest. (#25048).

Patch by Go MAEDA.

History

#1 Updated by VVD VVD 9 months ago

#2 Updated by Go MAEDA 9 months ago

  • Target version set to Candidate for next major release

Ruby on Rails 4.2.8 that is compatible with Ruby 2.4 will be released next week.

http://weblog.rubyonrails.org/2017/2/10/Rails-4-2-8-rc1-has-been-released/

If no regressions are found, expect the final release on Wednesday, February 15, 2017.

#4 Updated by Toshi MARUYAMA 9 months ago

Rails 4.2.8 on Ruby 2.4 tests fail.

  1) Failure:
QueryTest#test_issue_count_by_list_custom_field_group [/REDMINE/WORK-DIR-NO-RAID/hg-workdir/bb-my-work-clean/test/unit/query_test.rb:1591]:
Expected: ["Fixnum"]
  Actual: ["Integer"]

  2) Failure:
QueryTest#test_issue_count_by_association_group [/REDMINE/WORK-DIR-NO-RAID/hg-workdir/bb-my-work-clean/test/unit/query_test.rb:1582]:
Expected: ["Fixnum"]
  Actual: ["Integer"]

  3) Failure:
QueryTest#test_issue_count_by_date_custom_field_group [/REDMINE/WORK-DIR-NO-RAID/hg-workdir/bb-my-work-clean/test/unit/query_test.rb:1600]:
Expected: ["Fixnum"]
  Actual: ["Integer"]

  4) Error:
Redmine::CipheringTest#test_ciphered_password_with_no_cipher_key_configured_should_be_returned_ciphered:
ArgumentError: key must be 32 bytes
    lib/redmine/ciphering.rb:32:in `key='
    lib/redmine/ciphering.rb:32:in `encrypt_text'
    lib/redmine/ciphering.rb:100:in `write_ciphered_attribute'
    app/models/repository.rb:92:in `password='
    test/unit/lib/redmine/ciphering_test.rb:67:in `block in test_ciphered_password_with_no_cipher_key_configured_should_be_returned_ciphered'
    lib/redmine/configuration.rb:77:in `with'
    test/unit/lib/redmine/ciphering_test.rb:66:in `test_ciphered_password_with_no_cipher_key_configured_should_be_returned_ciphered'

  5) Error:
Redmine::CipheringTest#test_encrypt_all:
ArgumentError: key must be 32 bytes
    lib/redmine/ciphering.rb:32:in `key='
    lib/redmine/ciphering.rb:32:in `encrypt_text'
    lib/redmine/ciphering.rb:100:in `write_ciphered_attribute'
    app/models/repository.rb:92:in `password='
    lib/redmine/ciphering.rb:74:in `block (2 levels) in encrypt_all'
    lib/redmine/ciphering.rb:72:in `block in encrypt_all'
    lib/redmine/ciphering.rb:71:in `encrypt_all'
    test/unit/lib/redmine/ciphering_test.rb:87:in `block in test_encrypt_all'
    lib/redmine/configuration.rb:77:in `with'
    test/unit/lib/redmine/ciphering_test.rb:86:in `test_encrypt_all'

  6) Error:
Redmine::CipheringTest#test_password_should_be_encrypted:
ArgumentError: key must be 32 bytes
    lib/redmine/ciphering.rb:32:in `key='
    lib/redmine/ciphering.rb:32:in `encrypt_text'
    lib/redmine/ciphering.rb:100:in `write_ciphered_attribute'
    app/models/repository.rb:92:in `password='
    test/unit/lib/redmine/ciphering_test.rb:24:in `block in test_password_should_be_encrypted'
    lib/redmine/configuration.rb:77:in `with'
    test/unit/lib/redmine/ciphering_test.rb:23:in `test_password_should_be_encrypted'

  7) Error:
Redmine::CipheringTest#test_decrypt_all:
ArgumentError: key must be 32 bytes
    lib/redmine/ciphering.rb:32:in `key='
    lib/redmine/ciphering.rb:32:in `encrypt_text'
    lib/redmine/ciphering.rb:100:in `write_ciphered_attribute'
    app/models/repository.rb:92:in `password='
    test/unit/lib/redmine/ciphering_test.rb:97:in `block in test_decrypt_all'
    lib/redmine/configuration.rb:77:in `with'
    test/unit/lib/redmine/ciphering_test.rb:96:in `test_decrypt_all'

4364 runs, 25207 assertions, 3 failures, 4 errors, 3 skips

#5 Updated by Go MAEDA 9 months ago

We have to use Nokogiri >= 1.7.0 to fix "FixNum is deprecated" warning. (https://github.com/sparklemotion/nokogiri/issues/1565)

diff --git a/Gemfile b/Gemfile
index bb8ba53..f9a5dbc 100644
--- a/Gemfile
+++ b/Gemfile
@@ -15,7 +15,7 @@ gem "actionpack-xml_parser" 
 gem "roadie-rails" 
 gem "mimemagic" 

-gem "nokogiri", "~> 1.6.8" 
+gem "nokogiri", (RUBY_VERSION >= "2.1" ? ">= 1.7.0" : "~> 1.6.8")
 gem "i18n", "~> 0.7.0" 

 # Request at least rails-html-sanitizer 1.0.3 because of security advisories
</diff>

#6 Updated by Go MAEDA 9 months ago

  • File ruby-2_4-support.diff added

This is a patch to support ruby 2.4: attachment:ruby-2_4-support.diff

  • Fixed "Fixnum is deprecated" warning from nokogiri
  • s/FixNum/Integer/ in test/unit/query_test.rb
  • Fixed "key must be 32 bytes" error from OpenSSL::Cipher

#7 Updated by Go MAEDA 9 months ago

Go MAEDA wrote:

This is a patch to support ruby 2.4: attachment:ruby-2_4-support.diff

Sorry, I withdraw this patch. I have found compatibility problem in Redmine::Ciphering.encrypt_text / Redmine::Ciphering.decrypt_text.

#8 Updated by Go MAEDA 9 months ago

  • File deleted (ruby-2_4-support.diff)

#10 Updated by Jean-Philippe Lang 9 months ago

  • Target version changed from Candidate for next major release to 3.4.0

#11 Updated by Jean-Philippe Lang 9 months ago

Fix committed and ruby2.4 added to the CI server, thanks.

#12 Updated by Jean-Philippe Lang 9 months ago

  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang
  • Resolution set to Fixed

Tests pass on the CI server.

#13 Updated by Go MAEDA 8 months ago

  • Related to Defect #25460: Redmine 3.3.2 db:migrate terminate with cryptic error message added

Also available in: Atom PDF