From c99a99354a369a79029904b083ef089c9b985772 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Jan 2025 10:05:17 +0000 Subject: [PATCH 1/5] build(deps): bump actionview, activemodel, actionpack and railties Bumps [actionview](https://github.com/rails/rails), [activemodel](https://github.com/rails/rails), [actionpack](https://github.com/rails/rails) and [railties](https://github.com/rails/rails). These dependencies needed to be updated together. Updates `actionview` from 7.2.2.1 to 8.0.1 - [Release notes](https://github.com/rails/rails/releases) - [Changelog](https://github.com/rails/rails/blob/v8.0.1/actionview/CHANGELOG.md) - [Commits](https://github.com/rails/rails/compare/v7.2.2.1...v8.0.1) Updates `activemodel` from 7.2.2.1 to 8.0.1 - [Release notes](https://github.com/rails/rails/releases) - [Changelog](https://github.com/rails/rails/blob/v8.0.1/activemodel/CHANGELOG.md) - [Commits](https://github.com/rails/rails/compare/v7.2.2.1...v8.0.1) Updates `actionpack` from 7.2.2.1 to 8.0.1 - [Release notes](https://github.com/rails/rails/releases) - [Changelog](https://github.com/rails/rails/blob/v8.0.1/actionpack/CHANGELOG.md) - [Commits](https://github.com/rails/rails/compare/v7.2.2.1...v8.0.1) Updates `railties` from 7.2.2.1 to 8.0.1 - [Release notes](https://github.com/rails/rails/releases) - [Changelog](https://github.com/rails/rails/blob/v8.0.1/railties/CHANGELOG.md) - [Commits](https://github.com/rails/rails/compare/v7.2.2.1...v8.0.1) --- updated-dependencies: - dependency-name: actionview dependency-type: direct:production update-type: version-update:semver-major - dependency-name: activemodel dependency-type: direct:production update-type: version-update:semver-major - dependency-name: actionpack dependency-type: direct:production update-type: version-update:semver-major - dependency-name: railties dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- Gemfile | 8 ++++---- Gemfile.lock | 53 ++++++++++++++++++++++++++-------------------------- 2 files changed, 31 insertions(+), 30 deletions(-) diff --git a/Gemfile b/Gemfile index f01d7838e9c..981333eee97 100644 --- a/Gemfile +++ b/Gemfile @@ -44,10 +44,10 @@ gem 'thin' gem 'vmstat', '~> 2.3' # Rails Components -gem 'actionpack', '~> 7.2.2' -gem 'actionview', '~> 7.2.1' -gem 'activemodel', '~> 7.2.2' -gem 'railties', '~> 7.2.1' +gem 'actionpack', '~> 8.0.1' +gem 'actionview', '~> 8.0.1' +gem 'activemodel', '~> 8.0.1' +gem 'railties', '~> 8.0.1' gem 'azure-storage-blob', git: 'https://github.com/sethboyles/azure-storage-ruby.git', branch: 'x-ms-blob-content-type-fix-1.1' diff --git a/Gemfile.lock b/Gemfile.lock index 98f714612c1..961c96a9c3e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -42,26 +42,25 @@ GIT GEM remote: https://rubygems.org/ specs: - actionpack (7.2.2.1) - actionview (= 7.2.2.1) - activesupport (= 7.2.2.1) + actionpack (8.0.1) + actionview (= 8.0.1) + activesupport (= 8.0.1) nokogiri (>= 1.8.5) - racc - rack (>= 2.2.4, < 3.2) + rack (>= 2.2.4) rack-session (>= 1.0.1) rack-test (>= 0.6.3) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) useragent (~> 0.16) - actionview (7.2.2.1) - activesupport (= 7.2.2.1) + actionview (8.0.1) + activesupport (= 8.0.1) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - activemodel (7.2.2.1) - activesupport (= 7.2.2.1) - activesupport (7.2.2.1) + activemodel (8.0.1) + activesupport (= 8.0.1) + activesupport (8.0.1) base64 benchmark (>= 0.3) bigdecimal @@ -73,6 +72,7 @@ GEM minitest (>= 5.1) securerandom (>= 0.3) tzinfo (~> 2.0, >= 2.0.5) + uri (>= 0.13.1) addressable (2.8.7) public_suffix (>= 2.0.2, < 7.0) aliyun-sdk (0.8.0) @@ -135,14 +135,14 @@ GEM irb (~> 1.10) reline (>= 0.3.8) declarative (0.0.20) - delayed_job (4.1.12) - activesupport (>= 3.0, < 8.0) + delayed_job (4.1.13) + activesupport (>= 3.0, < 9.0) diff-lcs (1.5.1) digest-xxhash (0.2.9) docile (1.1.5) domain_name (0.6.20240107) drb (2.2.1) - erubi (1.13.0) + erubi (1.13.1) eventmachine (1.2.7) excon (0.112.0) faraday (0.17.6) @@ -296,7 +296,7 @@ GEM logger (1.6.5) loggregator_emitter (5.2.0) beefcake (~> 1.0.0) - loofah (2.23.1) + loofah (2.24.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) machinist (1.0.6) @@ -364,7 +364,7 @@ GEM pry-byebug (3.10.1) byebug (~> 11.0) pry (>= 0.13, < 0.15) - psych (5.2.2) + psych (5.2.3) date stringio public_suffix (6.0.1) @@ -386,12 +386,12 @@ GEM activesupport (>= 5.0.0) minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.6.1) + rails-html-sanitizer (1.6.2) loofah (~> 2.21) nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) - railties (7.2.2.1) - actionpack (= 7.2.2.1) - activesupport (= 7.2.2.1) + railties (8.0.1) + actionpack (= 8.0.1) + activesupport (= 8.0.1) irb (~> 1.13) rackup (>= 1.0.0) rake (>= 12.2) @@ -404,7 +404,7 @@ GEM ffi (~> 1.0) rbs (3.8.1) logger - rdoc (6.10.0) + rdoc (6.11.0) psych (>= 4.0.0) redis (5.3.0) redis-client (>= 0.22.0) @@ -569,7 +569,8 @@ GEM unicode-display_width (3.1.4) unicode-emoji (~> 4.0, >= 4.0.4) unicode-emoji (4.0.4) - useragent (0.16.10) + uri (1.0.2) + useragent (0.16.11) vhd (0.0.4) bit-struct vmstat (2.3.1) @@ -577,7 +578,7 @@ GEM addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) - webrick (1.9.0) + webrick (1.9.1) xml-simple (1.1.9) rexml yajl-ruby (1.4.3) @@ -590,9 +591,9 @@ PLATFORMS x86_64-linux DEPENDENCIES - actionpack (~> 7.2.2) - actionview (~> 7.2.1) - activemodel (~> 7.2.2) + actionpack (~> 8.0.1) + actionview (~> 8.0.1) + activemodel (~> 8.0.1) addressable allowy (>= 2.1.0) azure-storage-blob! @@ -642,7 +643,7 @@ DEPENDENCIES public_suffix puma rack-test - railties (~> 7.2.1) + railties (~> 8.0.1) rake redis roodi From e122e256a3fb76cf3eb03d66b055b2311fd00159 Mon Sep 17 00:00:00 2001 From: Philipp Thun Date: Fri, 24 Jan 2025 09:05:31 +0100 Subject: [PATCH 2/5] Update uri from 0.12.3 to 0.13.1 The activesupport gem needs uri >= 0.13.1, but Ruby 3.2 includes uri 0.12.3. As switching to the latest uri version (1.0.2) causes several test failures, we stick to the minimal required version 0.13.1. In Ruby 3.3 uri 0.13.1 will be included, but Ruby 3.4 will update to >1, so additional work needs to be done for this Ruby update. --- Gemfile | 1 + Gemfile.lock | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 981333eee97..196f5c09c87 100644 --- a/Gemfile +++ b/Gemfile @@ -41,6 +41,7 @@ gem 'statsd-ruby', '~> 1.5.0' gem 'steno' gem 'talentbox-delayed_job_sequel', '~> 4.3.0' gem 'thin' +gem 'uri', '~> 0.13' gem 'vmstat', '~> 2.3' # Rails Components diff --git a/Gemfile.lock b/Gemfile.lock index 961c96a9c3e..135115e2943 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -569,7 +569,7 @@ GEM unicode-display_width (3.1.4) unicode-emoji (~> 4.0, >= 4.0.4) unicode-emoji (4.0.4) - uri (1.0.2) + uri (0.13.1) useragent (0.16.11) vhd (0.0.4) bit-struct @@ -676,6 +676,7 @@ DEPENDENCIES talentbox-delayed_job_sequel (~> 4.3.0) thin timecop + uri (~> 0.13) vmstat (~> 2.3) webmock (> 2.3.1) From 4d363c2089b023aa33bd03281733c56ae44c4e69 Mon Sep 17 00:00:00 2001 From: Philipp Thun Date: Fri, 24 Jan 2025 10:36:06 +0100 Subject: [PATCH 3/5] Update delayed_job version check The latest delayed_job version (4.1.13) does not contain any code changes, but only metadata changes to support Rails 8. --- spec/unit/lib/delayed_job/delayed_job_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/unit/lib/delayed_job/delayed_job_spec.rb b/spec/unit/lib/delayed_job/delayed_job_spec.rb index c758c019bba..678af679faf 100644 --- a/spec/unit/lib/delayed_job/delayed_job_spec.rb +++ b/spec/unit/lib/delayed_job/delayed_job_spec.rb @@ -1,7 +1,7 @@ RSpec.describe 'delayed_job' do describe 'version' do it 'is not updated' do - expect(Gem.loaded_specs['delayed_job'].version).to eq('4.1.12'), + expect(Gem.loaded_specs['delayed_job'].version).to eq('4.1.13'), 'revisit monkey patch in lib/delayed_job/quit_trap.rb + review the changes related to lib/delayed_job/threaded_worker.rb' end end From 466bc72a31bcc1fa8e428212b8565b70386cccb3 Mon Sep 17 00:00:00 2001 From: Philipp Thun Date: Mon, 3 Feb 2025 14:15:22 +0100 Subject: [PATCH 4/5] Remove compatibility patch for Rails upgrade --- lib/cloud_controller/db.rb | 8 -- spec/unit/jobs/deserialization_spec.rb | 121 +------------------------ 2 files changed, 3 insertions(+), 126 deletions(-) diff --git a/lib/cloud_controller/db.rb b/lib/cloud_controller/db.rb index cd9b9a40ba0..6a2083a6a94 100644 --- a/lib/cloud_controller/db.rb +++ b/lib/cloud_controller/db.rb @@ -255,11 +255,3 @@ def self.logger end end end - -if Rails::VERSION::MAJOR < 8 - module ActiveModel - # rubocop:disable Lint/EmptyClass - class ValidationContext; end - # rubocop:enable Lint/EmptyClass - end -end diff --git a/spec/unit/jobs/deserialization_spec.rb b/spec/unit/jobs/deserialization_spec.rb index 4090492944c..0303fe4c059 100644 --- a/spec/unit/jobs/deserialization_spec.rb +++ b/spec/unit/jobs/deserialization_spec.rb @@ -118,119 +118,7 @@ module Jobs subject(:job) { SpaceApplyManifestActionJob.new(space, app_guid_message_hash, apply_manifest_action, user_audit_info) } - let(:serialized_job_rails_7) do - <<~EOS - --- !ruby/object:VCAP::CloudController::Jobs::LoggingContextJob - handler: !ruby/object:VCAP::CloudController::Jobs::TimeoutJob - handler: !ruby/object:VCAP::CloudController::Jobs::SpaceApplyManifestActionJob - space: !ruby/object:VCAP::CloudController::Space - values: - :id: #{space.id} - :guid: space-guid - :created_at: #{space.created_at.strftime('%F %H:%M:%S.%9N Z')} - :updated_at: #{space.updated_at.strftime('%F %H:%M:%S.%9N Z')} - :name: space-name - :organization_id: #{org.id} - :space_quota_definition_id:#{' '} - :allow_ssh: true - :isolation_segment_guid:#{' '} - app_guid_message_hash: - app-guid: &1 !ruby/object:VCAP::CloudController::AppManifestMessage - requested_keys: - - :name - - :instances - - :routes - - :buildpack - - :stack - extra_keys: [] - buildpack: ruby - instances: 4 - name: app-name - routes: - - :route: app.bommel - stack: cflinuxfs4 - original_yaml: - :name: app-name - :instances: 4 - :routes: - - :route: app.bommel - :buildpack: ruby - :stack: cflinuxfs4 - validation_context:#{' '} - errors: !ruby/object:ActiveModel::Errors - base: *1 - errors: [] - manifest_process_scale_messages: - - &2 !ruby/object:VCAP::CloudController::ManifestProcessScaleMessage - requested_keys: - - :instances - - :type - extra_keys: [] - instances: 4 - type: web - validation_context:#{' '} - errors: !ruby/object:ActiveModel::Errors - base: *2 - errors: [] - manifest_process_update_messages: [] - app_update_message: &3 !ruby/object:VCAP::CloudController::AppUpdateMessage - requested_keys: - - :lifecycle - extra_keys: [] - lifecycle: - :data: - :buildpacks: - - ruby - :stack: cflinuxfs4 - validation_context:#{' '} - errors: !ruby/object:ActiveModel::Errors - base: *3 - errors: [] - manifest_buildpack_message: &4 !ruby/object:VCAP::CloudController::ManifestBuildpackMessage - requested_keys: - - :buildpack - extra_keys: [] - buildpack: ruby - validation_context:#{' '} - errors: !ruby/object:ActiveModel::Errors - base: *4 - errors: [] - manifest_routes_update_message: &5 !ruby/object:VCAP::CloudController::ManifestRoutesUpdateMessage - requested_keys: - - :routes - extra_keys: [] - routes: - - :route: app.bommel - validation_context:#{' '} - errors: !ruby/object:ActiveModel::Errors - base: *5 - errors: [] - manifest_route_mappings: - - :route: !ruby/object:VCAP::CloudController::ManifestRoute - attrs: - :scheme: unspecified - :user:#{' '} - :password:#{' '} - :host: app.bommel - :port:#{' '} - :path: '' - :query:#{' '} - :fragment:#{' '} - :full_route: app.bommel - :options: {} - :protocol:#{' '} - apply_manifest_action: !ruby/object:VCAP::CloudController::AppApplyManifest - user_audit_info: &6 !ruby/object:VCAP::CloudController::UserAuditInfo - user_email: user@bommel.com - user_name: user-name - user_guid: user-guid - user_audit_info: *6 - timeout: 14400 - request_id:#{' '} - EOS - end - - let(:serialized_job_rails_8) do + let(:serialized_job) do <<~EOS --- !ruby/object:VCAP::CloudController::Jobs::LoggingContextJob handler: !ruby/object:VCAP::CloudController::Jobs::TimeoutJob @@ -357,15 +245,12 @@ module Jobs ManifestBuildpackMessage, AppUpdateMessage, ManifestProcessScaleMessage, AppManifestMessage, Space, SpaceApplyManifestActionJob, TimeoutJob, LoggingContextJob] db_job = YAML.safe_load(jobs_in_db[0][:handler], permitted_classes: permitted_classes, aliases: true).as_json - dumped_job = YAML.safe_load(Rails::VERSION::MAJOR >= 8 ? serialized_job_rails_8 : serialized_job_rails_7, permitted_classes: permitted_classes, aliases: true).as_json + dumped_job = YAML.safe_load(serialized_job, permitted_classes: permitted_classes, aliases: true).as_json expect(db_job).to eq(dumped_job) end it 'can be deserialized' do - object = YAML.load_dj(serialized_job_rails_7) - expect(object).not_to be_nil - - object = YAML.load_dj(serialized_job_rails_8) + object = YAML.load_dj(serialized_job) expect(object).not_to be_nil end end From 1a3d6f4000c06d54fbde2c7193efc92af354ec23 Mon Sep 17 00:00:00 2001 From: Philipp Thun Date: Mon, 3 Feb 2025 15:16:04 +0100 Subject: [PATCH 5/5] Opt-in to new 'to_time' behavior (i.e. preserve receiver timezone) --- config/application.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/application.rb b/config/application.rb index af7761ba38c..2206eb9367a 100644 --- a/config/application.rb +++ b/config/application.rb @@ -17,6 +17,7 @@ class Application < Rails::Application Rails.autoloaders.main.ignore(Rails.root.join('app/**/*')) config.active_support.cache_format_version = 7.0 + config.active_support.to_time_preserves_timezone = :zone config.generators do |g| g.orm false