diff --git a/Gemfile b/Gemfile index f01d7838e9c..196f5c09c87 100644 --- a/Gemfile +++ b/Gemfile @@ -41,13 +41,14 @@ 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 -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..135115e2943 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 (0.13.1) + 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 @@ -675,6 +676,7 @@ DEPENDENCIES talentbox-delayed_job_sequel (~> 4.3.0) thin timecop + uri (~> 0.13) vmstat (~> 2.3) webmock (> 2.3.1) 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 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 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