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

Upgrade to Ruby v3 and Rails v7 #2183

Merged
merged 25 commits into from
May 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
fffaa77
application running with 16 rspec failures
uzorjchibuzor Oct 22, 2022
16ceeec
ruby version updated to 2.7.2 as a milestone step
uzorjchibuzor Oct 24, 2022
31ff147
application loading, tests failing
uzorjchibuzor Oct 25, 2022
ce3da52
moments index graph tests passing
uzorjchibuzor Oct 25, 2022
38d424b
stepped ruby-version up to 3.0.3
uzorjchibuzor Oct 25, 2022
48d0254
services and features are passing
uzorjchibuzor Oct 25, 2022
e4a351b
helpers specs passing
uzorjchibuzor Oct 25, 2022
442ae91
4 failures in spec/models
uzorjchibuzor Oct 25, 2022
9c4fe8f
models specs passing
uzorjchibuzor Oct 25, 2022
85284df
requests specs are passing
uzorjchibuzor Oct 25, 2022
cf1c29b
tests are passing at this point empty commit, ruby 3.0.3 and rails 6.0
uzorjchibuzor Oct 25, 2022
a957300
add updated ruby version to cicleci
uzorjchibuzor Oct 25, 2022
193ae10
rails v 6.0.6
uzorjchibuzor Oct 25, 2022
f6d3c52
fixed bug that was failing for ally to view moment and strategy
uzorjchibuzor Oct 25, 2022
60096eb
bundle install for rails 6.1.7 completed okay
uzorjchibuzor Oct 25, 2022
12b8aa3
checkpoint rails 6.1.7
uzorjchibuzor Oct 25, 2022
18934e6
checkpoint rails 7.0.4 bundled
uzorjchibuzor Oct 25, 2022
7b031eb
checkpoint: ran rails app:update
uzorjchibuzor Oct 25, 2022
c47a378
raised circle ci ruby version and dockerfile
uzorjchibuzor Oct 26, 2022
bf6f81f
fixed notifications spec test
uzorjchibuzor Oct 26, 2022
22ee95a
removed node install follwing suggestion from CircleCI devOps support
uzorjchibuzor Oct 26, 2022
86973f2
removed `ActionView::Helpers::AssetUrlHelper` as it has a conflict wi…
uzorjchibuzor Oct 27, 2022
722c055
Rails 7 fixes
seanmarcia Apr 8, 2023
e69abd9
Merge branch 'main' into upgrade_ruby_3.1.2_rails_7
seanmarcia Apr 9, 2023
3cb1f81
Bump ruby version to most recent semantic version in 3.1
seanmarcia Apr 10, 2023
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
34 changes: 20 additions & 14 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ defaults: &defaults
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
docker:
# List of image tags: https://circleci.com/developer/images/image/cimg/ruby#image-tags
- image: cimg/ruby:2.6.10-browsers
- image: cimg/ruby:3.1.4-browsers
environment:
PGHOST: 127.0.0.1
PGUSER: circleci
Expand Down Expand Up @@ -53,18 +53,26 @@ jobs:
- v1-dep-main-
- v1-dep-
- run:
name: Update to Node v16.14.2
name: Swap node versions
command: |
Copy link
Member

Choose a reason for hiding this comment

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

Any specific reason why you removed this? It would be good to use a locked version of Node so that there's consistency across prod and dev.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I followed a suggestion from the DevOP from Circle CI. Will put it back as it did not fix my problem..

curl -sSL "https://nodejs.org/dist/v16.14.2/node-v16.14.2-linux-x64.tar.xz" | sudo tar --strip-components=2 -xJ -C /usr/local/bin/ node-v16.14.2-linux-x64/bin/node
curl https://www.npmjs.com/install.sh | sudo bash
set +e
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.1/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
nvm install v16.14
nvm alias default 16.14

echo 'export NVM_DIR="$HOME/.nvm"' >> $BASH_ENV
echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $BASH_ENV
- run: gem install bundler
- run: bundle install --path=vendor/bundle --jobs=4 --retry=3
- run: yarn install --cache-folder ~/.cache/yarn
- run:
name: Setup Chrome
command: |
sudo apt-get update
sudo apt-get install libu2f-udev
wget http://archive.ubuntu.com/ubuntu/pool/main/libu/libu2f-host/libu2f-udev_1.1.4-1_all.deb
sudo dpkg -i libu2f-udev_1.1.4-1_all.deb
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i ./google-chrome*.deb
sudo apt-get install
Expand All @@ -75,27 +83,25 @@ jobs:
- ./node_modules
- ./vendor/bundle
- run: dockerize -wait tcp://localhost:5432 -timeout 1m
- run:
name: Download libssl1.1
command: |
wget http://nz2.archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.17_amd64.deb
sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2.17_amd64.deb
- run:
command: bundle exec rake db:create db:schema:load --trace
environment:
RAILS_ENV: test
RACK_ENV: test
- run: RAILS_ENV=test bundle exec rake db:create db:schema:load
- run: RAILS_ENV=test bundle exec rake react_on_rails:locale
- run: RAILS_ENV=test bundle exec rails assets:precompile
- run:
name: Run React Jest Tests
command: |
set -e
(cd client && yarn lint:flow && yarn lint:eslint && yarn test:circleci)
(cd client && ../tmp/cc-test-reporter format-coverage -t lcov -o ../tmp/codeclimate.frontend.json coverage/lcov.info)
- run:
name: Run YAML linter
command: |
set -e
curl https://bootstrap.pypa.io/pip/3.5/get-pip.py -o get-pip.py
python3 get-pip.py --user
python3 -m pip install --user yamllint
cd config && yamllint locales/
- persist_to_workspace:
root: tmp
paths:
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.6.10
3.1.4
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ruby:2.6.10
FROM ruby:3.1.4

RUN apt-get update -qq && \
apt-get install -y build-essential cmake git tzdata libpq-dev ruby-dev curl
Expand Down
29 changes: 15 additions & 14 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# frozen_string_literal: true

source 'https://rubygems.org'
ruby '~> 2.6.10'
ruby '~> 3.1.4'

gem 'puma'
gem 'puma', '5.6.4' # Latest capybara doesn't work with puma 6.0 at the moment.
gem 'rack-rewrite'
gem 'rails', '~> 6.0.4.8'
gem 'rails', '~> 7.0.4.3'

gem 'activerecord-import'
gem 'bcrypt', '3.1.13'
Expand All @@ -28,8 +28,7 @@ gem 'uglifier', '~> 4.1.20'
gem 'carrierwave', '~> 1.3.1'
gem 'certified', '1.0.0'
gem 'chronic', '0.10.2'
gem 'cloudinary', '~> 1.21.0'
gem 'figaro', '1.1.1'
gem 'cloudinary', '~> 1.25.0'
gem 'google-api-client', '~> 0.53.0'
gem 'kaminari', '1.2.1'
gem 'omniauth', '~> 2.0'
Expand All @@ -38,35 +37,37 @@ gem 'omniauth-google-oauth2', '~> 1.0.1'
gem 'omniauth-rails_csrf_protection', '~> 1.0.1'
gem 'premailer-rails'
gem 'pusher', '1.3.3'
gem 'rails-i18n', '~> 6.0.0'
gem 'rails-i18n', '~> 7.0.5'

gem 'friendly_id', '~> 5.2.5'
gem 'sdoc', '1.0.0', group: :doc

gem 'font-awesome-sass'
gem 'inline_svg'

gem 'groupdate', '4.1.2'
gem 'groupdate', '~> 6.1'

gem 'react_on_rails', '12.0.1'
gem 'webpacker', '5.1.1'
gem 'webpacker'

gem 'selenium-webdriver', '~> 4.1.0'

gem 'rubyzip', '~> 1.3.0'

gem 'sidekiq', '6.4.0'
gem 'sidekiq'
gem 'sidekiq-middleware'
gem 'sidekiq-failures'
gem "sidekiq-cron", "~> 1.1"
gem 'net-smtp', require: false # this is a rails 6 fix and will go away soon.
gem "sprockets-rails"

group :development, :test do
gem 'bundler-audit'
gem 'dotenv-rails', '~> 2.7.2'

gem 'spring'

gem 'annotate', '~> 2.7'
gem 'annotate', '~> 3.2.0'
gem 'railroady', '1.5.3'
gem 'rails-erd', '~> 1.6'

Expand All @@ -76,7 +77,7 @@ group :development, :test do
gem 'pry-rails'
gem 'rack-mini-profiler'

gem 'capybara', '~> 3.24.0'
gem 'capybara', '~> 3.37.0'
gem 'factory_bot_rails'
gem 'rspec-collection_matchers', '~> 1.1.3'
gem 'rspec-html-matchers', '~> 0.9.0'
Expand All @@ -85,7 +86,7 @@ group :development, :test do
gem 'letter_opener'
gem 'rspec_junit_formatter'

gem 'rubocop', '~> 0.80.1'
gem 'rubocop'
gem 'rubocop-performance'
gem 'rubocop-rails'
gem 'rubocop-rspec'
Expand All @@ -102,8 +103,8 @@ end
group :test do
gem 'database_cleaner'
gem 'rails-controller-testing'
gem 'shoulda-matchers'
gem 'simplecov', '0.16.1'
gem 'shoulda-matchers', '~> 5.3.0'
gem 'simplecov', '~> 0.17.0'
end

group :production do
Expand Down
Loading