Skip to content
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

Update to Ruby 3.2.0 #7594

Merged
merged 9 commits into from
Jan 11, 2023
Merged
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 .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ variables:
GITLAB_CI: 'true'
JUNIT_OUTPUT: 'true'
ECR_REGISTRY: '${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com'
IDP_CI_SHA: 'sha256:cea459aea56802327075b873cc73a8859ecffa359a9311b359ea49b19b1ba934'
IDP_CI_SHA: 'sha256:f5bbf6917b20e559176962ddf499cf320a873b0099711ef4dae4fd7b5cb7f3eb'

default:
image: '${ECR_REGISTRY}/idp/ci@${IDP_CI_SHA}'
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.4
3.2
7 changes: 3 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ gem 'foundation_emails'
gem 'good_job', '~> 3.0'
gem 'hashie', '~> 4.1'
gem 'http_accept_language'
gem 'identity-hostdata', github: '18F/identity-hostdata', tag: 'v3.4.1'
gem 'identity-hostdata', github: '18F/identity-hostdata', tag: 'v3.4.2'
gem 'identity-logging', github: '18F/identity-logging', tag: 'v0.1.0'
gem 'identity_validations', github: '18F/identity-validations', tag: 'v0.7.2'
gem 'jsbundling-rails', '~> 1.0.0'
Expand Down Expand Up @@ -91,12 +91,11 @@ group :development, :test do
gem 'aws-sdk-cloudwatchlogs', require: false
gem 'brakeman', require: false
gem 'bullet', '~> 7.0'
gem 'capybara-webmock', git: 'https://github.com/hashrocket/capybara-webmock.git', ref: '63d790a0'
gem 'data_uri', require: false
gem 'capybara-webmock', git: 'https://github.com/hashrocket/capybara-webmock.git', ref: 'd3f3b7c'
gem 'erb_lint', '~> 0.3.0', require: false
gem 'i18n-tasks', '>= 0.9.31'
gem 'knapsack'
gem 'nokogiri', '~> 1.13.10'
gem 'nokogiri', '1.14.0.rc1'
gem 'parallel_tests'
gem 'pg_query', require: false
gem 'pry-byebug'
Expand Down
93 changes: 46 additions & 47 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GIT
remote: https://github.com/18F/identity-hostdata.git
revision: 25a7e98919b1eb0d61dbcce314807a412aff62ad
tag: v3.4.1
revision: e33cbdb3a9c8826f6fc2b1f857fb713a4a233750
tag: v3.4.2
specs:
identity-hostdata (3.4.1)
activesupport (>= 6.1, < 8)
Expand Down Expand Up @@ -38,8 +38,8 @@ GIT

GIT
remote: https://github.com/hashrocket/capybara-webmock.git
revision: 63d790a0b6c779b9700634bfc153e25ccdeb3688
ref: 63d790a0
revision: d3f3b7c8edbeca7b575e74b256ad22df80d2b420
ref: d3f3b7c
specs:
capybara-webmock (0.6.0)
capybara (>= 2.4, < 4)
Expand Down Expand Up @@ -117,8 +117,8 @@ GEM
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
addressable (2.8.1)
public_suffix (>= 2.0.2, < 6.0)
ahoy_matey (3.3.0)
activesupport (>= 5)
device_detector
Expand All @@ -128,26 +128,26 @@ GEM
ast (2.4.2)
awrence (1.2.1)
aws-eventstream (1.2.0)
aws-partitions (1.543.0)
aws-partitions (1.684.0)
aws-sdk-cloudwatchlogs (1.49.0)
aws-sdk-core (~> 3, >= 3.122.0)
aws-sigv4 (~> 1.1)
aws-sdk-core (3.125.0)
aws-sdk-core (3.168.4)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.525.0)
aws-sigv4 (~> 1.1)
jmespath (~> 1.0)
aws-sdk-kms (1.53.0)
aws-sdk-core (~> 3, >= 3.125.0)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.5)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.61.0)
aws-sdk-core (~> 3, >= 3.165.0)
aws-sigv4 (~> 1.1)
aws-sdk-pinpoint (1.62.0)
aws-sdk-core (~> 3, >= 3.122.0)
aws-sigv4 (~> 1.1)
aws-sdk-pinpointsmsvoice (1.29.0)
aws-sdk-core (~> 3, >= 3.122.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.110.0)
aws-sdk-core (~> 3, >= 3.125.0)
aws-sdk-s3 (1.117.2)
aws-sdk-core (~> 3, >= 3.165.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.4)
aws-sdk-ses (1.44.0)
Expand All @@ -156,7 +156,7 @@ GEM
aws-sdk-sns (1.49.0)
aws-sdk-core (~> 3, >= 3.122.0)
aws-sigv4 (~> 1.1)
aws-sigv4 (1.4.0)
aws-sigv4 (1.5.2)
aws-eventstream (~> 1, >= 1.0.2)
axe-core-api (4.3.2)
dumb_delegator
Expand Down Expand Up @@ -199,7 +199,7 @@ GEM
bundler (>= 1.2.0, < 3)
thor (~> 1.0)
byebug (11.1.3)
capybara (3.36.0)
capybara (3.38.0)
addressable
matrix
mini_mime (>= 0.1.3)
Expand All @@ -209,7 +209,6 @@ GEM
regexp_parser (>= 1.5, < 3.0)
xpath (~> 3.2)
cbor (0.5.9.6)
childprocess (4.1.0)
choice (0.2.0)
chunky_png (1.4.0)
coderay (1.1.3)
Expand All @@ -227,7 +226,6 @@ GEM
addressable
cssbundling-rails (1.0.0)
railties (>= 6.0.0)
data_uri (0.1.0)
debug_inspector (1.1.0)
derailed_benchmarks (1.8.1)
benchmark-ips (~> 2)
Expand Down Expand Up @@ -306,7 +304,7 @@ GEM
railties (>= 6.0.0)
thor (>= 0.14.1)
webrick (>= 1.3)
google-protobuf (3.21.9)
google-protobuf (3.21.12)
guard (2.16.2)
formatador (>= 0.2.4)
listen (>= 2.7, < 4.0)
Expand Down Expand Up @@ -346,7 +344,7 @@ GEM
ipaddr (1.2.4)
irb (1.3.7)
reline (>= 0.2.7)
jmespath (1.6.1)
jmespath (1.6.2)
jsbundling-rails (1.0.0)
railties (>= 6.0.0)
json (2.6.3)
Expand Down Expand Up @@ -417,7 +415,7 @@ GEM
net-ssh (6.1.0)
newrelic_rpm (8.12.0)
nio4r (2.5.8)
nokogiri (1.13.10)
nokogiri (1.14.0.rc1)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
notiffany (0.1.3)
Expand Down Expand Up @@ -449,19 +447,19 @@ GEM
actionmailer (>= 3)
premailer (~> 1.7, >= 1.7.9)
profanity_filter (0.1.1)
pry (0.13.1)
pry (0.14.1)
coderay (~> 1.1)
method_source (~> 1.0)
pry-byebug (3.9.0)
pry-byebug (3.10.1)
byebug (~> 11.0)
pry (~> 0.13.0)
pry-doc (1.2.0)
pry (>= 0.13, < 0.15)
pry-doc (1.4.0)
pry (~> 0.11)
yard (~> 0.9.11)
pry-rails (0.3.9)
pry (>= 0.10.4)
psych (4.0.2)
public_suffix (4.0.6)
public_suffix (5.0.1)
puma (5.6.4)
nio4r (~> 2.0)
raabro (1.4.0)
Expand All @@ -474,7 +472,7 @@ GEM
rack-headers_filter (0.0.1)
rack-mini-profiler (2.3.3)
rack (>= 1.2.0)
rack-proxy (0.7.2)
rack-proxy (0.7.4)
rack
rack-test (2.0.2)
rack (>= 1.3)
Expand Down Expand Up @@ -549,18 +547,18 @@ GEM
chunky_png (~> 1.0)
rqrcode_core (~> 1.0)
rqrcode_core (1.2.0)
rspec (3.11.0)
rspec-core (~> 3.11.0)
rspec-expectations (~> 3.11.0)
rspec-mocks (~> 3.11.0)
rspec-core (3.11.0)
rspec-support (~> 3.11.0)
rspec-expectations (3.11.1)
rspec (3.12.0)
rspec-core (~> 3.12.0)
rspec-expectations (~> 3.12.0)
rspec-mocks (~> 3.12.0)
rspec-core (3.12.0)
rspec-support (~> 3.12.0)
rspec-expectations (3.12.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.11.0)
rspec-mocks (3.11.2)
rspec-support (~> 3.12.0)
rspec-mocks (3.12.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.11.0)
rspec-support (~> 3.12.0)
rspec-rails (6.0.1)
actionpack (>= 6.1)
activesupport (>= 6.1)
Expand All @@ -571,7 +569,7 @@ GEM
rspec-support (~> 3.11)
rspec-retry (0.6.2)
rspec-core (> 3.3)
rspec-support (3.11.1)
rspec-support (3.12.0)
rspec_junit_formatter (0.6.0)
rspec-core (>= 2, < 4, != 2.12.0)
rubocop (1.42.0)
Expand Down Expand Up @@ -613,10 +611,10 @@ GEM
faraday (>= 0.17.3, < 3)
scrypt (3.0.7)
ffi-compiler (>= 1.0, < 2.0)
selenium-webdriver (4.1.0)
childprocess (>= 0.5, < 5.0)
selenium-webdriver (4.7.1)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
shellany (0.0.1)
shoulda-matchers (4.5.1)
activesupport (>= 4.2.0)
Expand Down Expand Up @@ -645,7 +643,7 @@ GEM
stringex (2.8.5)
strong_migrations (0.8.0)
activerecord (>= 5.2)
strscan (3.0.1)
strscan (3.0.5)
subprocess (1.5.5)
systemu (2.6.5)
terminal-table (3.0.2)
Expand Down Expand Up @@ -698,6 +696,7 @@ GEM
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
webrick (1.7.0)
websocket (1.2.9)
websocket-driver (0.7.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
Expand All @@ -712,7 +711,8 @@ GEM
nokogiri (~> 1.11)
xpath (3.2.0)
nokogiri (~> 1.8)
yard (0.9.26)
yard (0.9.28)
webrick (~> 1.7.0)
zeitwerk (2.6.6)
zonebie (0.6.1)
zxcvbn (0.1.7)
Expand Down Expand Up @@ -741,7 +741,6 @@ DEPENDENCIES
capybara-webmock!
connection_pool
cssbundling-rails
data_uri
derailed_benchmarks (~> 1.8)
devise (~> 4.8)
dotiw (>= 4.0.1)
Expand Down Expand Up @@ -772,7 +771,7 @@ DEPENDENCIES
multiset
net-sftp
newrelic_rpm (~> 8.0)
nokogiri (~> 1.13.10)
nokogiri (= 1.14.0.rc1)
octokit (>= 4.25.0)
parallel_tests
pg
Expand Down Expand Up @@ -836,7 +835,7 @@ DEPENDENCIES
zxcvbn (= 0.1.7)

RUBY VERSION
ruby 3.0.4p208
ruby 3.2.0p0

BUNDLED WITH
2.2.33
2 changes: 1 addition & 1 deletion bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Dir.chdir APP_ROOT do

puts '== Setting up config overrides =='
default_application_yml = { 'development' => { 'config_key' => nil } }
File.write('config/application.yml', default_application_yml.to_yaml) unless File.exists?('config/application.yml')
File.write('config/application.yml', default_application_yml.to_yaml) unless File.exist?('config/application.yml')

puts "== Linking service_providers.yml =="
run "test -r config/service_providers.yml || ln -sv service_providers.localdev.yml config/service_providers.yml"
Expand Down
2 changes: 1 addition & 1 deletion lib/tasks/create_test_accounts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def create_account(email: '[email protected]', password: 'salty pickles', mfa_
def create_accounts_from_csv(data)
require 'csv'
accounts_created = []
users = File.exists?(data) ? CSV.read(data, headers: true) : CSV.parse(data, headers: true)
users = File.exist?(data) ? CSV.read(data, headers: true) : CSV.parse(data, headers: true)
users.each do |row|
email = row['email']
if User.find_with_email(email).present?
Expand Down
20 changes: 3 additions & 17 deletions spec/views/shared/_personal_key.html.erb_spec.rb
Original file line number Diff line number Diff line change
@@ -1,32 +1,18 @@
require 'rails_helper'
require 'data_uri'

RSpec.describe 'shared/_personal_key.html.erb' do
let(:personal_key) { RandomPhrase.new(num_words: 4).to_s }

subject(:rendered) { render 'shared/personal_key', code: personal_key, update_path: '/test' }

describe 'download link' do
around do |ex|
# data_uri depends on URI.decode which was removed in Ruby 3.0 :sob:
module URI
def self.decode(value)
CGI.unescape(value)
end
end

ex.run

URI.singleton_class.undef_method(:decode)
end

it 'has the download attribute and a data: url for the personal key' do
doc = Nokogiri::HTML(rendered)
download_link = doc.at_css('a[download]')
data_uri = URI::Data.new(download_link[:href])
data_uri = Idv::DataUrlImage.new(download_link[:href])

expect(data_uri.content_type).to eq('text/plain')
expect(data_uri.data).to eq(personal_key)
expect(data_uri.content_type).to include('text/plain')
expect(data_uri.read).to eq(personal_key)
end
end
end
20 changes: 3 additions & 17 deletions spec/views/users/backup_code_setup/create.html.erb_spec.rb
Original file line number Diff line number Diff line change
@@ -1,22 +1,8 @@
require 'rails_helper'
require 'data_uri'

describe 'users/backup_code_setup/create.html.erb' do
let(:user) { build(:user, :signed_up) }

around do |ex|
# data_uri depends on URI.decode which was removed in Ruby 3.0 :sob:
module URI
def self.decode(value)
CGI.unescape(value)
end
end

ex.run

URI.singleton_class.undef_method(:decode)
end

before do
allow(view).to receive(:current_user).and_return(user)
@codes = BackupCodeGenerator.new(user).create
Expand All @@ -27,10 +13,10 @@ def self.decode(value)

doc = Nokogiri::HTML(rendered)
download_link = doc.at_css('a[download]')
data_uri = URI::Data.new(download_link[:href])
data_uri = Idv::DataUrlImage.new(download_link[:href])

expect(rendered).to have_content((t('components.download_button.label')))
expect(data_uri.content_type).to eq('text/plain')
expect(data_uri.data).to eq(@codes.join("\n"))
expect(data_uri.content_type).to include('text/plain')
expect(data_uri.read).to eq(@codes.join("\n"))
end
end
Loading