Skip to content

Ruby 3.4 #4236

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.2.6
3.4.2
5 changes: 4 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ gem 'loggregator_emitter', '~> 5.0'
gem 'membrane', '~> 1.0'
gem 'mime-types', '~> 3.6'
gem 'multipart-parser'
gem 'mutex_m'
gem 'netaddr', '>= 2.0.4'
gem 'net-ssh'
gem 'newrelic_rpm'
Expand All @@ -39,10 +40,10 @@ gem 'sinatra-contrib'
gem 'sshkey'
gem 'statsd-ruby', '~> 1.5.0'
gem 'steno'
gem 'syslog'
gem 'talentbox-delayed_job_sequel', '~> 4.3.0'
gem 'thin'
gem 'vmstat', '~> 2.3'

# Rails Components
gem 'actionpack', '~> 7.2.2'
gem 'actionview', '~> 7.2.1'
Expand All @@ -59,6 +60,8 @@ gem 'fog-google', '~> 1.24.1'
gem 'fog-local'
gem 'fog-openstack'

gem 'google-protobuf', '~> 3.25'

gem 'cf-uaa-lib', '~> 4.0.8'

group :db do
Expand Down
24 changes: 13 additions & 11 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -224,29 +224,27 @@ GEM
google-apis-core (>= 0.11.0, < 2.a)
google-cloud-env (1.6.0)
faraday (>= 0.17.3, < 3.0)
google-protobuf (3.25.5)
google-protobuf (3.25.5-x86_64-darwin)
google-protobuf (3.25.5-x86_64-linux)
google-protobuf (3.25.6)
googleapis-common-protos (1.6.0)
google-protobuf (>= 3.18, < 5.a)
googleapis-common-protos-types (~> 1.7)
grpc (~> 1.41)
googleapis-common-protos-types (1.15.0)
googleapis-common-protos-types (1.19.0)
google-protobuf (>= 3.18, < 5.a)
googleauth (1.8.1)
faraday (>= 0.17.3, < 3.a)
jwt (>= 1.4, < 3.0)
multi_json (~> 1.11)
os (>= 0.9, < 2.0)
signet (>= 0.16, < 2.a)
grpc (1.64.0)
google-protobuf (~> 3.25)
grpc (1.71.0)
google-protobuf (>= 3.25, < 5.0)
googleapis-common-protos-types (~> 1.0)
grpc (1.64.0-x86_64-darwin)
google-protobuf (~> 3.25)
grpc (1.71.0-x86_64-darwin)
google-protobuf (>= 3.25, < 5.0)
googleapis-common-protos-types (~> 1.0)
grpc (1.64.0-x86_64-linux)
google-protobuf (~> 3.25)
grpc (1.71.0-x86_64-linux)
google-protobuf (>= 3.25, < 5.0)
googleapis-common-protos-types (~> 1.0)
hashdiff (1.1.2)
honeycomb-beeline (3.1.0)
Expand Down Expand Up @@ -554,6 +552,7 @@ GEM
fluent-logger
yajl-ruby (~> 1.0)
stringio (3.1.2)
syslog (0.1.1)
talentbox-delayed_job_sequel (4.3.0)
delayed_job (~> 4.1.0)
sequel (>= 3.38, < 6.0)
Expand Down Expand Up @@ -617,6 +616,7 @@ DEPENDENCIES
fog-google (~> 1.24.1)
fog-local
fog-openstack
google-protobuf (~> 3.25)
googleapis-common-protos (>= 1.3.12)
hashdiff
honeycomb-beeline
Expand All @@ -631,6 +631,7 @@ DEPENDENCIES
mime-types (~> 3.6)
mock_redis
multipart-parser
mutex_m
mysql2 (~> 0.5.6)
net-ssh
netaddr (>= 2.0.4)
Expand Down Expand Up @@ -676,11 +677,12 @@ DEPENDENCIES
sshkey
statsd-ruby (~> 1.5.0)
steno
syslog
talentbox-delayed_job_sequel (~> 4.3.0)
thin
timecop
vmstat (~> 2.3)
webmock (> 2.3.1)

BUNDLED WITH
2.4.10
2.6.6
2 changes: 1 addition & 1 deletion db/migrations/20220601183937_create_asg_lastest_updates.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Sequel.migration do
change do
create_table :asg_timestamps do
primary_key name: :id
primary_key :id, name: :id
Copy link
Member Author

@sethboyles sethboyles Mar 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think enough time has passed that we don't need to worry about someone having run this migration, but not the followup that corrected it. With Ruby 3.4, this migration would no longer behave consistently, anyway (name: id get serialized to {name: :id} instead of {:name=>:id})

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I initially tried to make these migrations more explicit, but that caused issues with the rename_column on MySQL 5.7 tests. Which we don't actually support, so a different potential workaround is dropping those tests.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth just dropping 5.7 from the pipeline then?

Timestamp :last_update
end
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
Sequel.migration do
change do
alter_table :asg_timestamps do
rename_column :'{:name=>:id}', :id
end
up do
# no op
end

down do
# no op
end
end
2 changes: 2 additions & 0 deletions docs/v3/Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
source 'http://rubygems.org'

gem 'bigdecimal'
gem 'json', '>= 2.3.0'
gem 'middleman', '~> 4.5'
gem 'middleman-autoprefixer', '~> 3.0', '>= 3.0.0'
Expand All @@ -8,6 +9,7 @@ gem 'middleman-livereload', '>= 3.4.7'
gem 'middleman-sprockets', '~> 4.1', '>= 4.1.1'
gem 'middleman-syntax', '3.4.0'
gem 'mini_racer'
gem 'mutex_m'
gem 'nokogiri', '~> 1.18.3'
gem 'rake', '>= 12.3.3'
gem 'redcarpet', '~> 3.6.1'
Expand Down
57 changes: 31 additions & 26 deletions docs/v3/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ GEM
public_suffix (>= 2.0.2, < 6.0)
autoprefixer-rails (10.4.7.0)
execjs (~> 2)
backports (3.25.0)
bigdecimal (3.1.9)
coffee-script (2.4.1)
coffee-script-source
execjs
Expand All @@ -21,9 +21,9 @@ GEM
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
erubis (2.7.0)
erubi (1.13.1)
eventmachine (1.2.7)
execjs (2.9.1)
execjs (2.10.0)
fast_blank (1.0.1)
fastimage (2.3.1)
ffi (1.16.3)
Expand All @@ -48,41 +48,41 @@ GEM
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
memoist (0.16.2)
middleman (4.5.1)
coffee-script (~> 2.2)
haml (>= 4.0.5)
kramdown (>= 2.3.0)
middleman-cli (= 4.5.1)
middleman-core (= 4.5.1)
middleman (4.6.0)
middleman-cli (= 4.6.0)
middleman-core (= 4.6.0)
middleman-autoprefixer (3.0.0)
autoprefixer-rails (~> 10.0)
middleman-core (>= 4.0.0)
middleman-cli (4.5.1)
middleman-cli (4.6.0)
thor (>= 0.17.0, < 1.3.0)
middleman-core (4.5.1)
activesupport (>= 6.1, < 7.1)
middleman-core (4.6.0)
activesupport (>= 6.1)
addressable (~> 2.4)
backports (~> 3.6)
bundler (~> 2.0)
contracts (~> 0.13, < 0.17)
coffee-script (~> 2.2)
contracts
dotenv
erubis
erubi
execjs (~> 2.0)
fast_blank
fastimage (~> 2.0)
haml (>= 4.0.5)
hamster (~> 3.0)
hashie (~> 3.4)
i18n (~> 1.6.0)
hashie (>= 3.4, < 6.0)
i18n (>= 1.6, < 1.15)
kramdown (~> 2.4)
listen (~> 3.0)
memoist (~> 0.14)
padrino-helpers (~> 0.15.0)
parallel
rack (>= 1.4.5, < 3)
rack (>= 3)
rackup
sassc (~> 2.0)
servolux
tilt (~> 2.0.9)
tilt (~> 2.2)
toml
uglifier (~> 3.0)
uglifier (>= 3, < 5)
webrick
middleman-gh-pages (0.4.1)
rake (> 0.9.3)
Expand All @@ -100,6 +100,7 @@ GEM
mini_racer (0.16.0)
libv8-node (~> 18.19.0.0)
minitest (5.23.1)
mutex_m (0.3.0)
nokogiri (1.18.3)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
Expand All @@ -118,9 +119,11 @@ GEM
parslet (2.0.0)
public_suffix (5.0.5)
racc (1.8.1)
rack (2.2.13)
rack (3.1.12)
rack-livereload (0.3.17)
rack
rackup (2.2.1)
rack (>= 3)
rake (13.2.1)
rb-fsevent (0.11.2)
rb-inotify (0.11.1)
Expand All @@ -136,17 +139,17 @@ GEM
sassc (2.4.0)
ffi (~> 1.9)
servolux (0.13.0)
sprockets (3.7.2)
sprockets (4.2.1)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
rack (>= 2.2.4, < 4)
temple (0.10.3)
thor (1.2.2)
tilt (2.0.11)
tilt (2.6.0)
toml (0.3.0)
parslet (>= 1.8.0, < 3.0.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
uglifier (3.2.0)
uglifier (4.2.1)
execjs (>= 0.3.0, < 3)
webrick (1.8.2)

Expand All @@ -157,6 +160,7 @@ PLATFORMS
x86_64-linux

DEPENDENCIES
bigdecimal
json (>= 2.3.0)
middleman (~> 4.5)
middleman-autoprefixer (~> 3.0, >= 3.0.0)
Expand All @@ -165,10 +169,11 @@ DEPENDENCIES
middleman-sprockets (~> 4.1, >= 4.1.1)
middleman-syntax (= 3.4.0)
mini_racer
mutex_m
nokogiri (~> 1.18.3)
rake (>= 12.3.3)
redcarpet (~> 3.6.1)
sass

BUNDLED WITH
2.4.10
2.6.6
1 change: 1 addition & 0 deletions spec/request/admin_actions_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
h = Hash.new(
{ code: 403 }.freeze
)

h['admin'] = {
code: 202
}
Expand Down
3 changes: 3 additions & 0 deletions spec/request/app_features_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@

let(:expected_codes_and_responses) do
h = Hash.new({ code: 404 }.freeze)

%w[admin admin_read_only global_auditor space_developer space_manager space_auditor org_manager
space_supporter].each do |r|
h[r] = { code: 200, response_object: features_response_object }
Expand All @@ -78,6 +79,7 @@
describe 'GET /v3/apps/:guid/features/:name' do
let(:expected_codes_and_responses) do
h = Hash.new({ code: 404 }.freeze)

%w[admin admin_read_only global_auditor space_developer space_manager space_auditor org_manager
space_supporter].each do |r|
h[r] = { code: 200, response_object: feature_response_object }
Expand Down Expand Up @@ -161,6 +163,7 @@

let(:expected_codes_and_responses) do
h = Hash.new({ code: 403, errors: CF_NOT_AUTHORIZED }.freeze)

%w[no_role org_auditor org_billing_manager].each { |r| h[r] = { code: 404 } }
%w[admin space_developer].each { |r| h[r] = { code: 200, response_object: feature_response_object } }
h
Expand Down
2 changes: 1 addition & 1 deletion spec/support/shared_examples/v3_service_binding_delete.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class BadError < StandardError; end
VCAP::Services::ServiceBrokers::V2::Errors::ConcurrencyError.new(
'foo',
:delete,
double(code: '500', reason: '', body: '')
double({ code: '500', reason: '', body: '' })
)
)
dbl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ module V3
context 'when http error is raised' do
let(:fake_logger) { instance_double(Steno::Logger, error: nil, info: nil) }
let(:err) do
response = VCAP::Services::ServiceBrokers::V2::HttpResponse.new(code: 412, body: {})
response = VCAP::Services::ServiceBrokers::V2::HttpResponse.new({ code: 412, body: {} })
HttpResponseError.new('oops', 'GET', response)
end

Expand Down
2 changes: 1 addition & 1 deletion spec/unit/controllers/v3/sidecars_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
it 'fails to map a route' do
expect do
get :index_by_process
end.to raise_error(ActionController::UrlGenerationError, /No route matches \{:action=>"index_by_process", :controller=>"sidecars"\}/)
end.to raise_error(ActionController::UrlGenerationError, /No route matches \{action: "index_by_process", controller: "sidecars"\}/)
end
end

Expand Down
4 changes: 2 additions & 2 deletions spec/unit/jobs/pollable_job_wrapper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ class BigException < StandardError

context 'with a big message' do
# postgres complains with 15,826
# mysql complains with 15,828, so test for failure at that point
# mysql complains with 15,829, so test for failure at that point

it 'squeezes just right one in' do
expect do
Expand All @@ -295,7 +295,7 @@ class BigException < StandardError
pg_error = /value too long for type character varying/
mysql_error = /Data too long for column 'cf_api_error'/
expect do
pollable_job.error(job, BigException.new(message: 'x' * 15_828))
pollable_job.error(job, BigException.new(message: 'x' * 15_829))
end.to raise_error(::Sequel::DatabaseError, /#{pg_error}|#{mysql_error}/)
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ def run_job(job)

context 'when calling last operation responds with an error HttpResponseError' do
before do
response = VCAP::Services::ServiceBrokers::V2::HttpResponse.new(code: 412, body: {})
response = VCAP::Services::ServiceBrokers::V2::HttpResponse.new({ code: 412, body: {} })
err = HttpResponseError.new('oops', 'GET', response)
allow(client).to receive(:fetch_service_binding_last_operation).and_raise(err)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ def run_job(job)

context 'due to an HttpResponseError' do
before do
response = VCAP::Services::ServiceBrokers::V2::HttpResponse.new(code: 412, body: {})
response = VCAP::Services::ServiceBrokers::V2::HttpResponse.new({ code: 412, body: {} })
err = HttpResponseError.new('oops', 'GET', response)
allow(client).to receive(:fetch_service_instance_last_operation).and_raise(err)
end
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/lib/cloud_controller/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ module VCAP::CloudController
it "can't handle an unescaped @" do
expect do
DatabasePartsParser.database_parts_from_connection(uri)
end.to raise_error(URI::InvalidURIError, "bad URI(is not URI?): \"#{uri}\"")
end.to raise_error(URI::InvalidURIError, "bad URI (is not URI?): \"#{uri}\"")
end
end

Expand Down
Loading