From ac2d3625c7fd932486818c141859395441581f70 Mon Sep 17 00:00:00 2001 From: Joe Rafaniello Date: Fri, 12 Jan 2024 16:17:07 -0500 Subject: [PATCH 1/4] Allow rails 7 gems in gemspec --- manageiq-postgres_ha_admin.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manageiq-postgres_ha_admin.gemspec b/manageiq-postgres_ha_admin.gemspec index 26c4145..a25de2e 100644 --- a/manageiq-postgres_ha_admin.gemspec +++ b/manageiq-postgres_ha_admin.gemspec @@ -27,7 +27,7 @@ Gem::Specification.new do |spec| spec.required_ruby_version = ">= 2.5.8" - spec.add_runtime_dependency "activesupport", ">=5.0", "< 7.0" + spec.add_runtime_dependency "activesupport", ">=5.0", "<7.1" spec.add_runtime_dependency "awesome_spawn", "~> 1.4" spec.add_runtime_dependency "manageiq-password", "< 2" spec.add_runtime_dependency "pg" From fee920f748cabc2b67bdbe0ac53ae7aef1bb8099 Mon Sep 17 00:00:00 2001 From: Joe Rafaniello Date: Tue, 16 Jan 2024 16:07:40 -0500 Subject: [PATCH 2/4] Drop EOL rubies --- .github/workflows/ci.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 27bf989..a6bd84f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -12,8 +12,6 @@ jobs: strategy: matrix: ruby-version: - - '2.5' - - '2.6' - '2.7' - '3.0' rails-version: From e0a10cc03c9edcbba150d8923ff3b917cfae2aee Mon Sep 17 00:00:00 2001 From: Joe Rafaniello Date: Tue, 16 Jan 2024 16:08:10 -0500 Subject: [PATCH 3/4] Add rails 7 to test matrix, default to rails 6.1 when not specified --- .github/workflows/ci.yaml | 1 + Gemfile | 17 +++++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a6bd84f..7986fb7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -17,6 +17,7 @@ jobs: rails-version: - '6.0' - '6.1' + - '7.0' services: postgres: image: manageiq/postgresql:13 diff --git a/Gemfile b/Gemfile index 63f6c95..eb7f872 100644 --- a/Gemfile +++ b/Gemfile @@ -3,9 +3,14 @@ source 'https://rubygems.org' # Specify your gem's dependencies in manageiq-postgres_ha_admin.gemspec gemspec -case ENV['TEST_RAILS_VERSION'] -when "6.0" - gem "activesupport", "~>6.0.4" -when "6.1" - gem "activesupport", "~>6.1.4" -end +minimum_version = + case ENV['TEST_RAILS_VERSION'] + when "6.0" + "~>6.0.4" + when "7.0" + "~>7.0.8" + else + "~>6.1.4" + end + +gem "activesupport", minimum_version From e643c4d896620ea983654ec6c0a1791743ea75de Mon Sep 17 00:00:00 2001 From: Joe Rafaniello Date: Thu, 18 Jan 2024 17:13:36 -0500 Subject: [PATCH 4/4] Support ruby 3.1 by using a compatible way to YAML.load with aliases --- .github/workflows/ci.yaml | 1 + spec/config_handler/rails_config_handler_spec.rb | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7986fb7..18ac8e3 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -14,6 +14,7 @@ jobs: ruby-version: - '2.7' - '3.0' + - '3.1' rails-version: - '6.0' - '6.1' diff --git a/spec/config_handler/rails_config_handler_spec.rb b/spec/config_handler/rails_config_handler_spec.rb index 9d72d13..7602e2e 100644 --- a/spec/config_handler/rails_config_handler_spec.rb +++ b/spec/config_handler/rails_config_handler_spec.rb @@ -5,7 +5,7 @@ before do @yml_file = Tempfile.new('database.yml') - yml_data = YAML.load(<<-DOC) + data = <<-DOC --- base: &base username: user @@ -16,6 +16,12 @@ pool: 3 database: vmdb_test DOC + yml_data = + if YAML.respond_to?(:safe_load) + YAML.safe_load(data, :aliases => true) + else + YAML.load(data) + end File.write(@yml_file.path, yml_data.to_yaml) end