From 8ab468dfd6b5f8b1ad00f800eb7a892461306c99 Mon Sep 17 00:00:00 2001 From: Kyle Le Date: Wed, 3 Apr 2024 09:45:18 +0700 Subject: [PATCH 1/3] Issue 254 Upgrade Ruby version --- .github/workflows/kpm_ci.yml | 2 +- .github/workflows/kpm_rubocop.yml | 2 +- kpm/Gemfile | 1 + kpm/kpm.gemspec | 1 + kpm/tasks/package.rake | 4 ++-- 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/kpm_ci.yml b/.github/workflows/kpm_ci.yml index 66550897..0f3532cf 100644 --- a/.github/workflows/kpm_ci.yml +++ b/.github/workflows/kpm_ci.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: # See HOMEBREW_PORTABLE_RUBY_VERSION in kpm/tasks/package.rake - ruby-version: ['2.6.8', 'jruby-9.3.4.0'] + ruby-version: ['3.1.4', 'jruby-9.4.5.0'] steps: - name: Checkout code uses: actions/checkout@v2 diff --git a/.github/workflows/kpm_rubocop.yml b/.github/workflows/kpm_rubocop.yml index ba96dc9f..9788d957 100644 --- a/.github/workflows/kpm_rubocop.yml +++ b/.github/workflows/kpm_rubocop.yml @@ -10,7 +10,7 @@ jobs: - name: Set up Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: 2.6.8 + ruby-version: 3.1.4 bundler-cache: true working-directory: kpm - name: Run RuboCop diff --git a/kpm/Gemfile b/kpm/Gemfile index 7f4f5e95..8dc2619c 100644 --- a/kpm/Gemfile +++ b/kpm/Gemfile @@ -1,5 +1,6 @@ # frozen_string_literal: true source 'https://rubygems.org' +gem 'sorted_set', '~> 1.0', '>= 1.0.3' gemspec diff --git a/kpm/kpm.gemspec b/kpm/kpm.gemspec index ef8f5a3f..b197b1c1 100644 --- a/kpm/kpm.gemspec +++ b/kpm/kpm.gemspec @@ -45,6 +45,7 @@ Gem::Specification.new do |s| s.add_dependency 'killbill-client', '~> 3.2' s.add_dependency 'rubyzip', '>= 1.3', '< 2.4' s.add_dependency 'thor', '>= 0.19.1', '< 1.3.0' + s.add_dependency 'sorted_set', '~> 1.0', '>= 1.0.3' s.add_development_dependency 'gem-release', '~> 2.2' s.add_development_dependency 'rake', '~> 13.0' diff --git a/kpm/tasks/package.rake b/kpm/tasks/package.rake index 8fe816a1..27a99ae1 100644 --- a/kpm/tasks/package.rake +++ b/kpm/tasks/package.rake @@ -10,9 +10,9 @@ require './lib/kpm/version' VERSION = KPM::VERSION # See https://www.jruby.org/download -JRUBY_VERSION = '9.3.4.0' +JRUBY_VERSION = '9.4.5.0' # See https://github.com/Homebrew/homebrew-portable-ruby/releases -HOMEBREW_PORTABLE_RUBY_VERSION = '2.6.8_1' +HOMEBREW_PORTABLE_RUBY_VERSION = '3.1.4' # Remove unused files to reduce package size GEMS_PATH = 'packaging/vendor/ruby/*/gems/*/' From d4e4fb85bb4bde2bc6fa15b865be1b7a91b8df6c Mon Sep 17 00:00:00 2001 From: Kyle Le Date: Wed, 3 Apr 2024 09:45:18 +0700 Subject: [PATCH 2/3] Issue 254 Upgrade Ruby version --- .github/workflows/kpm_ci.yml | 2 +- .github/workflows/kpm_rubocop.yml | 2 +- ansible/library/killbill_diagnostics | 1 - ansible/library/killbill_facts | 1 - ansible/library/killbill_migrations | 1 - kpm/Gemfile | 1 + kpm/kpm.gemspec | 1 + kpm/lib/kpm/kaui_artifact.rb | 5 ++--- kpm/lib/kpm/killbill_plugin_artifact.rb | 4 ++-- kpm/lib/kpm/killbill_server_artifact.rb | 5 ++--- kpm/tasks/package.rake | 4 ++-- 11 files changed, 12 insertions(+), 15 deletions(-) diff --git a/.github/workflows/kpm_ci.yml b/.github/workflows/kpm_ci.yml index 66550897..0f3532cf 100644 --- a/.github/workflows/kpm_ci.yml +++ b/.github/workflows/kpm_ci.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: # See HOMEBREW_PORTABLE_RUBY_VERSION in kpm/tasks/package.rake - ruby-version: ['2.6.8', 'jruby-9.3.4.0'] + ruby-version: ['3.1.4', 'jruby-9.4.5.0'] steps: - name: Checkout code uses: actions/checkout@v2 diff --git a/.github/workflows/kpm_rubocop.yml b/.github/workflows/kpm_rubocop.yml index ba96dc9f..9788d957 100644 --- a/.github/workflows/kpm_rubocop.yml +++ b/.github/workflows/kpm_rubocop.yml @@ -10,7 +10,7 @@ jobs: - name: Set up Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: 2.6.8 + ruby-version: 3.1.4 bundler-cache: true working-directory: kpm - name: Run RuboCop diff --git a/ansible/library/killbill_diagnostics b/ansible/library/killbill_diagnostics index 2196ebf3..e13e86a2 100755 --- a/ansible/library/killbill_diagnostics +++ b/ansible/library/killbill_diagnostics @@ -4,7 +4,6 @@ require 'json' require 'logger' require 'pathname' -require 'set' require 'uri' require 'yaml' diff --git a/ansible/library/killbill_facts b/ansible/library/killbill_facts index f8b3cede..836cad48 100755 --- a/ansible/library/killbill_facts +++ b/ansible/library/killbill_facts @@ -4,7 +4,6 @@ require 'json' require 'logger' require 'pathname' -require 'set' require 'yaml' data = {} diff --git a/ansible/library/killbill_migrations b/ansible/library/killbill_migrations index 17840cce..8b097a56 100755 --- a/ansible/library/killbill_migrations +++ b/ansible/library/killbill_migrations @@ -4,7 +4,6 @@ require 'json' require 'logger' require 'pathname' -require 'set' require 'yaml' data = {} diff --git a/kpm/Gemfile b/kpm/Gemfile index 7f4f5e95..8dc2619c 100644 --- a/kpm/Gemfile +++ b/kpm/Gemfile @@ -1,5 +1,6 @@ # frozen_string_literal: true source 'https://rubygems.org' +gem 'sorted_set', '~> 1.0', '>= 1.0.3' gemspec diff --git a/kpm/kpm.gemspec b/kpm/kpm.gemspec index ef8f5a3f..b197b1c1 100644 --- a/kpm/kpm.gemspec +++ b/kpm/kpm.gemspec @@ -45,6 +45,7 @@ Gem::Specification.new do |s| s.add_dependency 'killbill-client', '~> 3.2' s.add_dependency 'rubyzip', '>= 1.3', '< 2.4' s.add_dependency 'thor', '>= 0.19.1', '< 1.3.0' + s.add_dependency 'sorted_set', '~> 1.0', '>= 1.0.3' s.add_development_dependency 'gem-release', '~> 2.2' s.add_development_dependency 'rake', '~> 13.0' diff --git a/kpm/lib/kpm/kaui_artifact.rb b/kpm/lib/kpm/kaui_artifact.rb index e1132eda..ac0862e0 100644 --- a/kpm/lib/kpm/kaui_artifact.rb +++ b/kpm/lib/kpm/kaui_artifact.rb @@ -1,7 +1,6 @@ # frozen_string_literal: true require 'rexml/document' -require 'set' module KPM class KauiArtifact < BaseArtifact @@ -11,9 +10,9 @@ def versions(overrides = {}, ssl_verify = true) coordinates = KPM::Coordinates.build_coordinates(coordinate_map) response = REXML::Document.new nexus_remote(overrides, ssl_verify).search_for_artifacts(coordinates) - versions = SortedSet.new + versions = [] response.elements.each('searchNGResponse/data/artifact/version') { |element| versions << element.text } - versions + versions.sort!.uniq end end end diff --git a/kpm/lib/kpm/killbill_plugin_artifact.rb b/kpm/lib/kpm/killbill_plugin_artifact.rb index fa4bca50..043e515a 100644 --- a/kpm/lib/kpm/killbill_plugin_artifact.rb +++ b/kpm/lib/kpm/killbill_plugin_artifact.rb @@ -1,7 +1,6 @@ # frozen_string_literal: true require 'rexml/document' -require 'set' module KPM class KillbillPluginArtifact < BaseArtifact @@ -20,8 +19,9 @@ def versions(overrides = {}, ssl_verify = true) response = REXML::Document.new nexus.search_for_artifacts(type_and_group_id[1]) response.elements.each('searchNGResponse/data/artifact') do |element| artifact_id = element.elements['artifactId'].text - plugins[type_and_group_id[0]][artifact_id] ||= SortedSet.new + plugins[type_and_group_id[0]][artifact_id] ||= [] plugins[type_and_group_id[0]][artifact_id] << element.elements['version'].text + plugins[type_and_group_id[0]][artifact_id].sort!.uniq! end end diff --git a/kpm/lib/kpm/killbill_server_artifact.rb b/kpm/lib/kpm/killbill_server_artifact.rb index 59234c50..b6c871bd 100644 --- a/kpm/lib/kpm/killbill_server_artifact.rb +++ b/kpm/lib/kpm/killbill_server_artifact.rb @@ -1,7 +1,6 @@ # frozen_string_literal: true require 'rexml/document' -require 'set' module KPM class KillbillServerArtifact < BaseArtifact @@ -10,9 +9,9 @@ def versions(artifact_id, packaging = KPM::BaseArtifact::KILLBILL_PACKAGING, cla coordinate_map = { group_id: KPM::BaseArtifact::KILLBILL_GROUP_ID, artifact_id: artifact_id, packaging: packaging, classifier: classifier } coordinates = KPM::Coordinates.build_coordinates(coordinate_map) response = REXML::Document.new nexus_remote(overrides, ssl_verify).search_for_artifacts(coordinates) - versions = SortedSet.new + versions = [] response.elements.each('searchNGResponse/data/artifact/version') { |element| versions << element.text } - versions + versions.sort!.uniq end def info(version = 'LATEST', sha1_file = nil, force_download = false, verify_sha1 = true, overrides = {}, ssl_verify = true) diff --git a/kpm/tasks/package.rake b/kpm/tasks/package.rake index 8fe816a1..27a99ae1 100644 --- a/kpm/tasks/package.rake +++ b/kpm/tasks/package.rake @@ -10,9 +10,9 @@ require './lib/kpm/version' VERSION = KPM::VERSION # See https://www.jruby.org/download -JRUBY_VERSION = '9.3.4.0' +JRUBY_VERSION = '9.4.5.0' # See https://github.com/Homebrew/homebrew-portable-ruby/releases -HOMEBREW_PORTABLE_RUBY_VERSION = '2.6.8_1' +HOMEBREW_PORTABLE_RUBY_VERSION = '3.1.4' # Remove unused files to reduce package size GEMS_PATH = 'packaging/vendor/ruby/*/gems/*/' From 8ee18a5c3c975ea89ae1884e32f20df687589fbc Mon Sep 17 00:00:00 2001 From: Kyle Le Date: Tue, 9 Apr 2024 21:38:38 +0700 Subject: [PATCH 3/3] Issue 254 Replace SortedSet by Array --- kpm/kpm.gemspec | 1 - 1 file changed, 1 deletion(-) diff --git a/kpm/kpm.gemspec b/kpm/kpm.gemspec index b197b1c1..ef8f5a3f 100644 --- a/kpm/kpm.gemspec +++ b/kpm/kpm.gemspec @@ -45,7 +45,6 @@ Gem::Specification.new do |s| s.add_dependency 'killbill-client', '~> 3.2' s.add_dependency 'rubyzip', '>= 1.3', '< 2.4' s.add_dependency 'thor', '>= 0.19.1', '< 1.3.0' - s.add_dependency 'sorted_set', '~> 1.0', '>= 1.0.3' s.add_development_dependency 'gem-release', '~> 2.2' s.add_development_dependency 'rake', '~> 13.0'