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 rails 8 #5430

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
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 .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ concurrency:
cancel-in-progress: true
env:
os: ubuntu-22.04
ruby: '3.1'
ruby: '3.2'
jobs:
rubocop:
name: RuboCop
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
ubuntu: [22.04, 24.04]
ruby: ['3.1', '3.2', '3.3']
ruby: ['3.2', '3.3']
runs-on: ubuntu-${{ matrix.ubuntu }}
env:
RAILS_ENV: test
Expand Down
6 changes: 5 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require:
- rubocop-rake

AllCops:
TargetRubyVersion: 3.1
TargetRubyVersion: 3.2
NewCops: enable
Exclude:
- 'vendor/**/*'
Expand Down Expand Up @@ -105,6 +105,10 @@ Style/MixinUsage:
- 'bin/setup'
- 'bin/update'

Style/RaiseArgs:
Exclude:
- 'lib/osm.rb'

Style/StringLiterals:
EnforcedStyle: double_quotes

Expand Down
10 changes: 5 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source "https://rubygems.org"

# Require rails
gem "rails", "~> 7.2.0"
gem "rails", "~> 8.0.0"
gem "turbo-rails"

# Require json for multi_json
Expand Down Expand Up @@ -49,7 +49,7 @@ gem "file_exists"
# Load rails plugins
gem "actionpack-page_caching", ">= 1.2.0"
gem "activerecord-import"
gem "active_record_union"
gem "active_record_union", :github => "brianhempel/active_record_union", :ref => "master"
gem "bootstrap", "~> 5.3.2"
gem "bootstrap_form", "~> 5.0"
gem "cancancan"
Expand All @@ -61,7 +61,7 @@ gem "http_accept_language", "~> 2.1.1"
gem "i18n-js", "~> 3.9.2"
gem "openstreetmap-deadlock_retry", ">= 1.3.1", :require => "deadlock_retry"
gem "rack-cors"
gem "rails-i18n", "~> 7.0.0"
gem "rails-i18n", "~> 8.0.0"
gem "rails_param"
gem "rinku", ">= 2.0.6", :require => "rails_rinku"
gem "strong_migrations", "< 2.0.0"
Expand Down Expand Up @@ -118,7 +118,7 @@ gem "dalli"
gem "kgio"

# Load canonical-rails to generate canonical URLs
gem "canonical-rails"
gem "canonical-rails", :github => "kolide/canonical-rails", :ref => "master"

# Used to generate logstash friendly log files
gem "logstasher"
Expand Down Expand Up @@ -182,7 +182,7 @@ group :test do
end

group :development, :test do
gem "annotate"
gem "annotate", :github => "andynu/annotate_models", :ref => "rails-8-0"
gem "teaspoon"
gem "teaspoon-mocha", "~> 2.3.3"

Expand Down
156 changes: 87 additions & 69 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,74 +1,96 @@
GIT
remote: https://github.com/andynu/annotate_models.git
revision: 2c72ee8995ae8c1b9f5cf8690e8e3d22b7bd080d
ref: rails-8-0
specs:
annotate (3.2.0)
activerecord (>= 3.2, < 9.0)
rake (>= 10.4, < 14.0)

GIT
remote: https://github.com/brianhempel/active_record_union.git
revision: 8ebe558709aabe039abd24e3e7dd4d4354a6de88
ref: master
specs:
active_record_union (1.3.0)
activerecord (>= 6.0)

GIT
remote: https://github.com/kolide/canonical-rails.git
revision: 09b093de055fb4bbf2f33525a01896377a4b1adf
ref: master
specs:
canonical-rails (0.2.16)
actionview (>= 4.1, < 8.1)

GEM
remote: https://rubygems.org/
specs:
aasm (5.5.0)
concurrent-ruby (~> 1.0)
actioncable (7.2.2.1)
actionpack (= 7.2.2.1)
activesupport (= 7.2.2.1)
actioncable (8.0.1)
actionpack (= 8.0.1)
activesupport (= 8.0.1)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
zeitwerk (~> 2.6)
actionmailbox (7.2.2.1)
actionpack (= 7.2.2.1)
activejob (= 7.2.2.1)
activerecord (= 7.2.2.1)
activestorage (= 7.2.2.1)
activesupport (= 7.2.2.1)
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 (7.2.2.1)
actionpack (= 7.2.2.1)
actionview (= 7.2.2.1)
activejob (= 7.2.2.1)
activesupport (= 7.2.2.1)
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 (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)
actionpack-page_caching (1.2.4)
actionpack (>= 4.0.0)
actiontext (7.2.2.1)
actionpack (= 7.2.2.1)
activerecord (= 7.2.2.1)
activestorage (= 7.2.2.1)
activesupport (= 7.2.2.1)
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.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)
active_record_union (1.3.0)
activerecord (>= 4.0)
activejob (7.2.2.1)
activesupport (= 7.2.2.1)
activejob (8.0.1)
activesupport (= 8.0.1)
globalid (>= 0.3.6)
activemodel (7.2.2.1)
activesupport (= 7.2.2.1)
activerecord (7.2.2.1)
activemodel (= 7.2.2.1)
activesupport (= 7.2.2.1)
activemodel (8.0.1)
activesupport (= 8.0.1)
activerecord (8.0.1)
activemodel (= 8.0.1)
activesupport (= 8.0.1)
timeout (>= 0.4.0)
activerecord-import (2.0.0)
activerecord (>= 4.2)
activestorage (7.2.2.1)
actionpack (= 7.2.2.1)
activejob (= 7.2.2.1)
activerecord (= 7.2.2.1)
activesupport (= 7.2.2.1)
activestorage (8.0.1)
actionpack (= 8.0.1)
activejob (= 8.0.1)
activerecord (= 8.0.1)
activesupport (= 8.0.1)
marcel (~> 1.0)
activesupport (7.2.2.1)
activesupport (8.0.1)
base64
benchmark (>= 0.3)
bigdecimal
Expand All @@ -80,11 +102,9 @@ 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)
annotate (3.2.0)
activerecord (>= 3.2, < 8.0)
rake (>= 10.4, < 14.0)
argon2 (2.3.0)
ffi (~> 1.15)
ffi-compiler (~> 1.0)
Expand Down Expand Up @@ -139,8 +159,6 @@ GEM
bzip2-ffi (1.1.1)
ffi (~> 1.0)
cancancan (3.6.1)
canonical-rails (0.2.16)
actionview (>= 4.1, < 7.3)
capybara (3.40.0)
addressable
matrix
Expand Down Expand Up @@ -487,20 +505,20 @@ GEM
rackup (1.0.1)
rack (< 3)
webrick
rails (7.2.2.1)
actioncable (= 7.2.2.1)
actionmailbox (= 7.2.2.1)
actionmailer (= 7.2.2.1)
actionpack (= 7.2.2.1)
actiontext (= 7.2.2.1)
actionview (= 7.2.2.1)
activejob (= 7.2.2.1)
activemodel (= 7.2.2.1)
activerecord (= 7.2.2.1)
activestorage (= 7.2.2.1)
activesupport (= 7.2.2.1)
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.2.2.1)
railties (= 8.0.1)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
actionview (>= 5.0.1.rc1)
Expand All @@ -512,15 +530,15 @@ GEM
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)
rails-i18n (7.0.10)
rails-i18n (8.0.1)
i18n (>= 0.7, < 2)
railties (>= 6.0.0, < 8)
railties (>= 8.0.0, < 9)
rails_param (1.3.1)
actionpack (>= 3.2.0)
activesupport (>= 3.2.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)
Expand Down Expand Up @@ -664,10 +682,10 @@ PLATFORMS
DEPENDENCIES
aasm
actionpack-page_caching (>= 1.2.0)
active_record_union
active_record_union!
activerecord-import
addressable (~> 2.8)
annotate
annotate!
argon2
autoprefixer-rails
aws-sdk-s3
Expand All @@ -680,7 +698,7 @@ DEPENDENCIES
browser (< 6)
bzip2-ffi
cancancan
canonical-rails
canonical-rails!
capybara (>= 2.15)
config
connection_pool
Expand Down Expand Up @@ -738,9 +756,9 @@ DEPENDENCIES
quad_tile (~> 1.0.1)
rack-cors
rack-uri_sanitizer
rails (~> 7.2.0)
rails (~> 8.0.0)
rails-controller-testing
rails-i18n (~> 7.0.0)
rails-i18n (~> 8.0.0)
rails_param
rinku (>= 2.0.6)
rotp
Expand Down
8 changes: 4 additions & 4 deletions app/helpers/svg_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ def notice_svg_tag
tag.svg path_tag, :width => 16, :height => 16
end

def previous_page_svg_tag(**options)
adjacent_page_svg_tag(dir == "rtl" ? 1 : -1, **options)
def previous_page_svg_tag(**)
adjacent_page_svg_tag(dir == "rtl" ? 1 : -1, **)
end

def next_page_svg_tag(**options)
adjacent_page_svg_tag(dir == "rtl" ? -1 : 1, **options)
def next_page_svg_tag(**)
adjacent_page_svg_tag(dir == "rtl" ? -1 : 1, **)
end

def key_svg_tag(**options)
Expand Down
2 changes: 2 additions & 0 deletions bin/dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env ruby
exec "./bin/rails", "server", *ARGV
17 changes: 7 additions & 10 deletions bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
require "fileutils"

APP_ROOT = File.expand_path("..", __dir__)
APP_NAME = "openstreetmap".freeze

def system!(*args)
system(*args, :exception => true)
def system!(*)
system(*, :exception => true)
end

FileUtils.chdir APP_ROOT do
Expand All @@ -14,7 +13,6 @@ FileUtils.chdir APP_ROOT do
# Add necessary setup steps to this file.

puts "== Installing dependencies =="
system! "gem install bundler --conservative"
system("bundle check") || system!("bundle install")

# puts "\n== Copying sample files =="
Expand All @@ -28,10 +26,9 @@ FileUtils.chdir APP_ROOT do
puts "\n== Removing old logs and tempfiles =="
system! "bin/rails log:clear tmp:clear"

puts "\n== Restarting application server =="
system! "bin/rails restart"

# puts "\n== Configuring puma-dev =="
# system "ln -nfs #{APP_ROOT} ~/.puma-dev/#{APP_NAME}"
# system "curl -Is https://#{APP_NAME}.test/up | head -n 1"
unless ARGV.include?("--skip-server")
puts "\n== Starting development server =="
$stdout.flush # flush the output before exec(2) so that it displays
exec "bin/dev"
end
end
5 changes: 5 additions & 0 deletions bin/thrust
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env ruby
require "rubygems"
require "bundler/setup"

load Gem.bin_path("thruster", "thrust")
Loading
Loading