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

Rails upgrade 7.0.4.1 and ruby 3.2.0 #312

Open
wants to merge 26 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
30958bd
WIP upgrade
mestachs Jan 17, 2023
6edb9ee
Fix validation for activity state
mestachs Jan 17, 2023
519828c
Fix formula validations
mestachs Jan 17, 2023
d2aec13
fix more
mestachs Jan 17, 2023
d4c68f9
regenerated schema.rb
mestachs Jan 18, 2023
6ac826c
More spec fixes
mestachs Jan 18, 2023
7584e6f
Allow some float tolerance since dentaku upgrade
mestachs Jan 18, 2023
32870df
Fix display_name arg error
mestachs Jan 18, 2023
7af0c7d
Fix some serialisation problem with lambda/proc
mestachs Jan 18, 2023
ba68394
Fix validations on decision table
mestachs Jan 18, 2023
946c708
Fix frozen error assertion
mestachs Jan 18, 2023
9a361dc
Allow redirect to external server
mestachs Jan 18, 2023
249c032
Metadata initialize/new keyword args fix
mestachs Jan 18, 2023
2603559
Missing version associtations column
mestachs Jan 18, 2023
dba34fc
Delete unused spec
mestachs Jan 18, 2023
ec60d30
Fix clone rspec to ignore ActiveRecord::InternalMetadata
mestachs Jan 18, 2023
784f446
Fix url validator
mestachs Jan 18, 2023
8bc11bb
Update capybara, selenium and its config
mestachs Jan 18, 2023
2ac80b1
Goodbye selenium
mestachs Jan 18, 2023
d8d802a
Don't launch system tests
mestachs Jan 18, 2023
60e1df9
Stop caching chromedriver
mestachs Jan 18, 2023
fb9e65a
Stop installing chrome driver
mestachs Jan 18, 2023
ed761f0
Forget about system tests
mestachs Jan 18, 2023
6b5a40d
Upgrade ruby, Allow docker compose .env
mestachs Jan 20, 2023
8020dce
WIP asset upgrade and fixes
mestachs Jan 23, 2023
b358702
rails 7.0.4.1
mestachs Jan 24, 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
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
node_modules
./docker
55 changes: 25 additions & 30 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,33 +33,28 @@ jobs:
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2
- name: Set up Ruby (uses .ruby-version)
uses: ruby/setup-ruby@v1
with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Install postgres client
run: sudo apt-get install libpq-dev
- name: Cache chromedriver
uses: actions/cache@v2
with:
path: "/usr/local/share/chromedriver"
key: chromedriver-${{ runner.os }}-${{ hashFiles('/usr/local/share/chromedriver') }}
- name: Cache clode climate reporter
uses: actions/cache@v2
with:
path: "cc-test-reporter"
key: cc-${{ runner.os }}-${{ hashFiles('./cc-test-reporter') }}
- name: script/cibuild
run: |
script/cibuild
env:
DB_PASSWORD: ${{ env.POSTGRES_PASSWORD }}
DB_NAME: ${{ env.POSTGRES_DB }}
DB_USER: ${{ env.POSTGRES_USER }}
REDIS_URL: redis://localhost:6379/0
DATA_TEST_S3_BUCKET: ${{ secrets.DATA_TEST_S3_BUCKET }}
DATA_TEST_S3_REGION: ${{ secrets.DATA_TEST_S3_REGION }}
FETCHER_S3_ACCESS: ${{ secrets.FETCHER_S3_ACCESS }}
FETCHER_S3_KEY: ${{ secrets.FETCHER_S3_KEY }}
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
- uses: actions/checkout@v2
- name: Set up Ruby (uses .ruby-version)
uses: ruby/setup-ruby@v1
with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Install postgres client
run: sudo apt-get install libpq-dev
- name: Cache clode climate reporter
uses: actions/cache@v2
with:
path: "cc-test-reporter"
key: cc-${{ runner.os }}-${{ hashFiles('./cc-test-reporter') }}
- name: script/cibuild
run: |
script/cibuild
env:
DB_PASSWORD: ${{ env.POSTGRES_PASSWORD }}
DB_NAME: ${{ env.POSTGRES_DB }}
DB_USER: ${{ env.POSTGRES_USER }}
REDIS_URL: redis://localhost:6379/0
DATA_TEST_S3_BUCKET: ${{ secrets.DATA_TEST_S3_BUCKET }}
DATA_TEST_S3_REGION: ${{ secrets.DATA_TEST_S3_REGION }}
FETCHER_S3_ACCESS: ${{ secrets.FETCHER_S3_ACCESS }}
FETCHER_S3_KEY: ${{ secrets.FETCHER_S3_KEY }}
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ dump.rdb
coverage
spec/artefacts/*
config/data_test.json
.env*
./.env*

# I, pj, still vendor my ruby gems in the directory of the
# application, this stops me from committing them here.
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.5.8
3.2.0
16 changes: 8 additions & 8 deletions Dockerfile.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ruby:2.5.8-alpine AS build-env
FROM ruby:3.2.0-alpine AS build-env

ARG RAILS_ROOT=/app
ARG BUILD_PACKAGES="build-base curl-dev git"
Expand All @@ -19,23 +19,23 @@ RUN apk update \
COPY Gemfile* ./
# install rubygem
COPY Gemfile Gemfile.lock $RAILS_ROOT/
RUN gem update --system 3.2.3 && gem install bundler -i 2.2.3 && bundle config set --local without 'development test' && bundle config set --local path 'vendor/bundle'
RUN gem update --system 3.4.1 && gem install bundler -i 2.4.4 && bundle config set --local without 'development test' && bundle config set --local path 'vendor/bundle'
RUN bundle install \
&& rm -rf vendor/bundle/ruby/2.5.0/cache/*.gem \
&& find vendor/bundle/ruby/2.5.0/gems/ -name "*.c" -delete \
&& find vendor/bundle/ruby/2.5.0/gems/ -name "*.o" -delete
&& rm -rf vendor/bundle/ruby/3.2.0/cache/*.gem \
&& find vendor/bundle/ruby/3.2.0/gems/ -name "*.c" -delete \
&& find vendor/bundle/ruby/3.2.0/gems/ -name "*.o" -delete
COPY . .
RUN DATABASE_URL=nulldb:://null SECRET_KEY_BASE=1 RAILS_ENV=production bundle exec rake assets:precompile --trace
# Remove folders not needed in resulting image
RUN rm -rf node_modules tmp/cache app/assets vendor/assets spec
RUN rm -rf node_modules tmp/cache vendor/assets spec


FROM ruby:2.5.8-alpine
FROM ruby:3.2.0-alpine
ARG RAILS_ROOT=/app
ARG PACKAGES="tzdata postgresql-client nodejs bash curl-dev"
ENV RAILS_ENV=production
ENV BUNDLE_APP_CONFIG="$RAILS_ROOT/.bundle"
RUN gem update --system 3.2.3 && gem install bundler -i 2.2.3
RUN gem update --system 3.4.1 && gem install bundler -i 2.4.4
WORKDIR $RAILS_ROOT
# install packages
RUN apk update \
Expand Down
49 changes: 21 additions & 28 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

source "https://rubygems.org"

ruby "2.5.8"
ruby "3.2.0"

git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
Expand All @@ -11,30 +11,30 @@ end

## Infrastructure

gem "activerecord-nulldb-adapter"
gem "dhis2", github: "BLSQ/dhis2", branch: "legacy-v2"
gem "paper_trail", "~> 10.1.0"
gem "paper_trail-association_tracking", "~> 1.0.0"
gem "pg", "~> 0.18"
gem "paper_trail", "~> 13.0.0"
gem "paper_trail-association_tracking", "~> 2.2.1"
gem "pg", "~> 1.4.5"
gem "puma", "~> 4.3"
gem "rack", ">= 2.0.6"
gem "rails", "~> 5.2", "< 5.3"
gem "activerecord-nulldb-adapter"
gem "rails_admin", "~> 1.4.2"
gem "rails", "~> 7.0.4.1"
gem "rails_admin", "~> 3.1.1"
gem "sidekiq", "< 6"
gem "sidekiq-throttled", "~> 0.9.0"

## Tooling

gem "bootsnap", "~> 1.3.2"
gem "bootsnap", "~> 1.15.0"
gem "figaro"
gem "lograge", "~> 0.10.0"
gem "lograge", "~> 0.12.0"
gem "sentry-raven", "~> 2.7.4"

# Feature flipper is the act of enabling/disabling features in your app...
# [flipper](https://github.com/jnunemaker/flipper)
gem "flipper", "~> 0.16.1"
gem "flipper-active_record", "~> 0.16.1"
gem "flipper-ui", "~> 0.16.1"
gem "flipper", "~> 0.26.0"
gem "flipper-active_record", "~> 0.26.0"
gem "flipper-ui", "~> 0.26.0"

## Frontend and asset related

Expand All @@ -45,17 +45,16 @@ gem "coffee-rails", "~> 4.2"
gem "jquery-rails", "~> 4.3.3"
gem "jquery-ui-rails", "~> 5.0.5"
gem "rails-jquery-autocomplete"
gem "sassc-rails", "~> 2.0.0"
gem "sassc-rails", "~> 2.1.2"
gem "simple_form"
gem "sprockets", "~> 3.7.2"
gem "sprockets", "~> 4.2.0"
gem "turbolinks", "~> 5"
gem "uglifier", ">= 1.3.0"

## Authentication

# Flexible authentication solution for Rails with Warden
# [devise](https://github.com/plataformatec/devise)
gem "devise", "~> 4.7.1"
gem "devise", "~> 4.8.1"

# Log in as another user in Rails
# [pretender](https://github.com/ankane/pretender)
Expand Down Expand Up @@ -86,7 +85,7 @@ else
# We're using both of them against the latest master. We should set
# them to versions when they become more stable
gem "hesabu", github: "BLSQ/hesabu"
gem "orbf-rules_engine", github: "BLSQ/orbf-rules_engine", branch: "master"
gem "orbf-rules_engine", github: "BLSQ/orbf-rules_engine", branch: "ruby-3.2.0-test" # TODO: back to master
end
# Like a modern code version of the mythical beast with 100 serpent hea...
# [typhoeus](https://github.com/typhoeus/typhoeus)
Expand All @@ -96,28 +95,26 @@ group :development, :test do
gem "byebug", platform: :mri

# Use pry instead of irb: http://pryrepl.org
gem "pry", "~> 0.12.2"
gem "pry", "~> 0.14.2"
gem "pry-rails", "~> 0.3.9"

gem "database_cleaner"
gem "factory_bot_rails", "~> 4.11.1"
gem "factory_bot_rails", "~> 6.2.0"
gem "faker"
gem "immigrant"
gem "rails-controller-testing"
gem "rest-client-logger", github: "uswitch/rest-client-logger"
gem "rspec-its"
gem "rspec-rails", "~> 3.0"
gem "rspec-rails", "~> 6.0.1"
gem "ruby-prof"
gem "shoulda-matchers", require: false

gem "capybara"
gem "json-diff", "~> 0.4.1"
gem "rubyzip", "~> 1.3.0"
gem "selenium-webdriver"
end

group :development do
gem "annotate", "~> 2.7.4"
gem "annotate", "~> 3.2.0"
gem "flamegraph"
gem "listen", "~> 3.0.5"
gem "memory_profiler"
Expand All @@ -127,7 +124,7 @@ group :development do
gem "pronto-simplecov", require: false
gem "rack-mini-profiler"
gem "rubocop", require: false
gem 'rubocop-rails', require: false
gem "rubocop-rails", require: false
gem "spring"
gem "spring-watcher-listen", "~> 2.0.0"
gem "stackprof"
Expand All @@ -140,9 +137,5 @@ group :test do
gem "webmock"
end

group :production do
gem "heroku-deflater"
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem "tzinfo-data", platforms: %i[mingw mswin x64_mingw jruby]
Loading