Skip to content

Commit

Permalink
Update local development to latest ruby/rails, address console warnin…
Browse files Browse the repository at this point in the history
…gs (#2192)

* bundle update

* update local dev to use latest rails and ruby

* resolve warnings in tests

* opt into new timezone behavior

* move propshaft

* fix ci

* fix ci

* one more
  • Loading branch information
joelhawksley authored Jan 10, 2025
1 parent 4d455f8 commit 3eb9b24
Show file tree
Hide file tree
Showing 10 changed files with 148 additions and 113 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
ruby-version: 3.4
bundler-cache: true
- name: Run benchmarks
run: |
Expand Down Expand Up @@ -113,7 +113,7 @@ jobs:
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
ruby-version: 3.4
bundler-cache: true
working-directory: 'view_component'
- uses: actions/setup-node@v4
Expand All @@ -139,7 +139,7 @@ jobs:
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
ruby-version: 3.4
bundler-cache: true
- name: Download coverage results
uses: actions/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
ruby-version: 3.4
- uses: actions/cache@v4
with:
path: vendor/bundle
Expand Down
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby 3.3.0
ruby 3.4.1
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
source "https://rubygems.org"
gemspec

rails_version = (ENV["RAILS_VERSION"] || "~> 7.0.0").to_s
rails_version = (ENV["RAILS_VERSION"] || "~> 8").to_s
gem "rails", (rails_version == "main") ? {git: "https://github.com/rails/rails", ref: "main"} : rails_version

ruby_version = (ENV["RUBY_VERSION"] || "~> 3.3").to_s
ruby_version = (ENV["RUBY_VERSION"] || "~> 3.4").to_s
ruby ruby_version
178 changes: 101 additions & 77 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,71 +9,77 @@ PATH
GEM
remote: https://rubygems.org/
specs:
actioncable (7.0.8.7)
actionpack (= 7.0.8.7)
activesupport (= 7.0.8.7)
actioncable (8.0.1)
actionpack (= 8.0.1)
activesupport (= 8.0.1)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (7.0.8.7)
actionpack (= 7.0.8.7)
activejob (= 7.0.8.7)
activerecord (= 7.0.8.7)
activestorage (= 7.0.8.7)
activesupport (= 7.0.8.7)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.0.8.7)
actionpack (= 7.0.8.7)
actionview (= 7.0.8.7)
activejob (= 7.0.8.7)
activesupport (= 7.0.8.7)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.0)
actionpack (7.0.8.7)
actionview (= 7.0.8.7)
activesupport (= 7.0.8.7)
rack (~> 2.0, >= 2.2.4)
zeitwerk (~> 2.6)
actionmailbox (8.0.1)
actionpack (= 8.0.1)
activejob (= 8.0.1)
activerecord (= 8.0.1)
activestorage (= 8.0.1)
activesupport (= 8.0.1)
mail (>= 2.8.0)
actionmailer (8.0.1)
actionpack (= 8.0.1)
actionview (= 8.0.1)
activejob (= 8.0.1)
activesupport (= 8.0.1)
mail (>= 2.8.0)
rails-dom-testing (~> 2.2)
actionpack (8.0.1)
actionview (= 8.0.1)
activesupport (= 8.0.1)
nokogiri (>= 1.8.5)
rack (>= 2.2.4)
rack-session (>= 1.0.1)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (7.0.8.7)
actionpack (= 7.0.8.7)
activerecord (= 7.0.8.7)
activestorage (= 7.0.8.7)
activesupport (= 7.0.8.7)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
useragent (~> 0.16)
actiontext (8.0.1)
actionpack (= 8.0.1)
activerecord (= 8.0.1)
activestorage (= 8.0.1)
activesupport (= 8.0.1)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.0.8.7)
activesupport (= 7.0.8.7)
actionview (8.0.1)
activesupport (= 8.0.1)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (7.0.8.7)
activesupport (= 7.0.8.7)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
activejob (8.0.1)
activesupport (= 8.0.1)
globalid (>= 0.3.6)
activemodel (7.0.8.7)
activesupport (= 7.0.8.7)
activerecord (7.0.8.7)
activemodel (= 7.0.8.7)
activesupport (= 7.0.8.7)
activestorage (7.0.8.7)
actionpack (= 7.0.8.7)
activejob (= 7.0.8.7)
activerecord (= 7.0.8.7)
activesupport (= 7.0.8.7)
activemodel (8.0.1)
activesupport (= 8.0.1)
activerecord (8.0.1)
activemodel (= 8.0.1)
activesupport (= 8.0.1)
timeout (>= 0.4.0)
activestorage (8.0.1)
actionpack (= 8.0.1)
activejob (= 8.0.1)
activerecord (= 8.0.1)
activesupport (= 8.0.1)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (7.0.8.7)
concurrent-ruby (~> 1.0, >= 1.0.2)
activesupport (8.0.1)
base64
benchmark (>= 0.3)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
logger (>= 1.4.2)
minitest (>= 5.1)
tzinfo (~> 2.0)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
uri (>= 0.13.1)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
allocation_stats (0.1.5)
Expand All @@ -84,6 +90,7 @@ GEM
thor (>= 0.14.0)
ast (2.4.2)
base64 (0.2.0)
benchmark (0.4.0)
benchmark-ips (2.13.0)
better_html (2.1.1)
actionview (>= 6.0)
Expand All @@ -105,6 +112,7 @@ GEM
xpath (~> 3.2)
coderay (1.1.3)
concurrent-ruby (1.3.4)
connection_pool (2.5.0)
crass (1.0.6)
cuprite (0.15.1)
capybara (~> 3.0)
Expand All @@ -116,7 +124,7 @@ GEM
diff-lcs (1.5.1)
docile (1.4.1)
drb (2.2.1)
erb_lint (0.7.0)
erb_lint (0.8.0)
activesupport
better_html (>= 2.0.1)
parser (>= 2.7.1.4)
Expand Down Expand Up @@ -147,6 +155,7 @@ GEM
json (2.9.1)
language_server-protocol (3.17.0.3)
lint_roller (1.1.0)
logger (1.6.4)
loofah (2.24.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
Expand Down Expand Up @@ -182,6 +191,11 @@ GEM
parser (3.3.6.0)
ast (~> 2.4.1)
racc
propshaft (1.1.0)
actionpack (>= 7.0.0)
activesupport (>= 7.0.0)
rack
railties (>= 7.0.0)
pry (0.15.2)
coderay (~> 1.1)
method_source (~> 1.0)
Expand All @@ -193,36 +207,42 @@ GEM
nio4r (~> 2.0)
racc (1.8.1)
rack (2.2.10)
rack-session (1.0.2)
rack (< 3)
rack-test (2.2.0)
rack (>= 1.3)
rails (7.0.8.7)
actioncable (= 7.0.8.7)
actionmailbox (= 7.0.8.7)
actionmailer (= 7.0.8.7)
actionpack (= 7.0.8.7)
actiontext (= 7.0.8.7)
actionview (= 7.0.8.7)
activejob (= 7.0.8.7)
activemodel (= 7.0.8.7)
activerecord (= 7.0.8.7)
activestorage (= 7.0.8.7)
activesupport (= 7.0.8.7)
rackup (1.0.1)
rack (< 3)
webrick
rails (8.0.1)
actioncable (= 8.0.1)
actionmailbox (= 8.0.1)
actionmailer (= 8.0.1)
actionpack (= 8.0.1)
actiontext (= 8.0.1)
actionview (= 8.0.1)
activejob (= 8.0.1)
activemodel (= 8.0.1)
activerecord (= 8.0.1)
activestorage (= 8.0.1)
activesupport (= 8.0.1)
bundler (>= 1.15.0)
railties (= 7.0.8.7)
railties (= 8.0.1)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
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.0.8.7)
actionpack (= 7.0.8.7)
activesupport (= 7.0.8.7)
method_source
railties (8.0.1)
actionpack (= 8.0.1)
activesupport (= 8.0.1)
irb (~> 1.13)
rackup (>= 1.0.0)
rake (>= 12.2)
thor (~> 1.0)
zeitwerk (~> 2.5)
thor (~> 1.0, >= 1.2.2)
zeitwerk (~> 2.6)
rainbow (3.1.1)
rake (13.2.1)
rdoc (6.10.0)
Expand Down Expand Up @@ -267,6 +287,7 @@ GEM
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (1.13.0)
rubyzip (2.4.1)
securerandom (0.4.1)
selenium-webdriver (4.9.0)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
Expand Down Expand Up @@ -318,6 +339,8 @@ GEM
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.6.0)
uri (1.0.2)
useragent (0.16.11)
warning (1.5.0)
webrick (1.9.1)
websocket (1.2.11)
Expand Down Expand Up @@ -356,9 +379,10 @@ DEPENDENCIES
net-imap
net-pop
net-smtp
propshaft (~> 1.1.0)
pry (~> 0.13)
puma (~> 6)
rails (~> 7.0.0)
rails (~> 8)
rake (~> 13.0)
rspec-rails (~> 5)
rubocop-md (~> 1)
Expand All @@ -375,7 +399,7 @@ DEPENDENCIES
yard-activesupport-concern (~> 0.0.1)

RUBY VERSION
ruby 3.3.0p0
ruby 3.4.1p0

BUNDLED WITH
2.5.3
2 changes: 2 additions & 0 deletions test/sandbox/config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,6 @@
config.action_view.annotate_rendered_view_with_filenames = true if Rails.version.to_f >= 6.1

config.eager_load = true

config.active_support.to_time_preserves_timezone = :zone
end
44 changes: 24 additions & 20 deletions test/sandbox/test/rendering_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -964,11 +964,13 @@ def test_multithread_render
end

def test_concurrency_deadlock_cache
with_compiler_development_mode(true) do
with_new_cache do
render_inline(ContentEvalComponent.new) do
ViewComponent::CompileCache.invalidate!
render_inline(ContentEvalComponent.new)
assert_nothing_raised do
with_compiler_development_mode(true) do
with_new_cache do
render_inline(ContentEvalComponent.new) do
ViewComponent::CompileCache.invalidate!
render_inline(ContentEvalComponent.new)
end
end
end
end
Expand Down Expand Up @@ -1089,27 +1091,29 @@ def test_renders_nested_collection
end

def test_concurrency_deadlock
with_compiler_development_mode(true) do
with_new_cache do
mutex = Mutex.new
assert_nothing_raised do
with_compiler_development_mode(true) do
with_new_cache do
mutex = Mutex.new

t1 = Thread.new do
mutex.synchronize do
sleep 0.02
render_inline(ContentEvalComponent.new)
t1 = Thread.new do
mutex.synchronize do
sleep 0.02
render_inline(ContentEvalComponent.new)
end
end
end

t = Thread.new do
render_inline(ContentEvalComponent.new) do
mutex.synchronize do
sleep 0.01
t = Thread.new do
render_inline(ContentEvalComponent.new) do
mutex.synchronize do
sleep 0.01
end
end
end
end

t1.join
t.join
t1.join
t.join
end
end
end
end
Expand Down
Loading

0 comments on commit 3eb9b24

Please sign in to comment.