Skip to content

Commit

Permalink
chore: Upgrade to Rails 7 (#6719)
Browse files Browse the repository at this point in the history
fixes: #6736
  • Loading branch information
sojan-official authored May 6, 2023
1 parent 59433d9 commit 022383d
Show file tree
Hide file tree
Showing 53 changed files with 1,696 additions and 682 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ defaults: &defaults
working_directory: ~/build
docker:
# specify the version you desire here
- image: cimg/ruby:3.1.3-browsers
- image: cimg/ruby:3.2.2-browsers

# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
npm

# Install rbenv and ruby
ARG RUBY_VERSION="3.1.3"
ARG RUBY_VERSION="3.2.2"
RUN git clone https://github.com/rbenv/rbenv.git ~/.rbenv \
&& echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc \
&& echo 'eval "$(rbenv init -)"' >> ~/.bashrc
Expand Down
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,10 @@ test/cypress/videos/*
# yalc for local testing
.yalc
yalc.lock

/public/packs
/public/packs-test
/node_modules
/yarn-error.log
yarn-debug.log*
.yarn-integrity
33 changes: 33 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,39 @@ Performance/CollectionLiteralInLoop:
- 'db/migrate/20210315101919_enable_email_channel.rb'
RSpec/NamedSubject:
Enabled: false
Style/RedundantConstantBase:
Enabled: false
Rails/RootPathnameMethods:
Enabled: false
RSpec/Rails/MinitestAssertions:
Enabled: false
RSpec/Rails/InferredSpecType:
Enabled: false
RSpec/IndexedLet:
Enabled: false
RSpec/MatchArray:
Enabled: false
Rails/ResponseParsedBody:
Enabled: false
RSpec/FactoryBot/ConsistentParenthesesStyle:
Enabled: false
Rails/ThreeStateBooleanColumn:
Enabled: false
Rails/Pluck:
Enabled: false
Rails/TopLevelHashWithIndifferentAccess:
Enabled: false
Rails/ActionOrder:
Enabled: false
Style/ArrayIntersect:
Enabled: false
RSpec/NoExpectationExample:
Enabled: false
Style/RedundantReturn:
Enabled: false
Rails/I18nLocaleTexts:
Enabled: false

# we should bring this down
RSpec/MultipleMemoizedHelpers:
Max: 14
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.3
3.2.2
1 change: 1 addition & 0 deletions .slugignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/spec
46 changes: 24 additions & 22 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
source 'https://rubygems.org'

ruby '3.1.3'
ruby '3.2.2'

##-- base gems for rails --##
gem 'rack-cors', require: 'rack/cors'
gem 'rails', '~> 6.1', '>= 6.1.7.3'
gem 'rails', '~> 7'
# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', require: false

Expand Down Expand Up @@ -36,19 +36,19 @@ gem 'json_schemer'
# Rack middleware for blocking & throttling abusive requests
gem 'rack-attack'
# a utility tool for streaming, flexible and safe downloading of remote files
gem 'down', '~> 5.0'
gem 'down'
# authentication type to fetch and send mail over oauth2.0
gem 'gmail_xoauth'
# Prevent CSV injection
gem 'csv-safe'
# Support message translation
gem 'google-cloud-translate'

##-- for active storage --##
gem 'aws-sdk-s3', require: false
gem 'azure-storage-blob', require: false
# original gem isn't maintained actively
# we wanted updated version of faraday which is a dependency for slack-ruby-client
gem 'azure-storage-blob', git: 'https://github.com/chatwoot/azure-storage-ruby', branch: 'chatwoot', require: false
gem 'google-cloud-storage', require: false
gem 'image_processing', '~> 1.12.2'
gem 'image_processing'

##-- gems for database --#
gem 'groupdate'
Expand All @@ -62,13 +62,13 @@ gem 'activerecord-import'
gem 'dotenv-rails'
gem 'foreman'
gem 'puma'
gem 'webpacker', '~> 5.4', '>= 5.4.3'
gem 'webpacker'
# metrics on heroku
gem 'barnes'

##--- gems for authentication & authorization ---##
gem 'devise'
gem 'devise-secure_password', '~> 2.0', git: 'https://github.com/chatwoot/devise-secure_password'
gem 'devise-secure_password', git: 'https://github.com/chatwoot/devise-secure_password', branch: 'chatwoot'
gem 'devise_token_auth'
# authorization
gem 'jwt'
Expand All @@ -81,7 +81,6 @@ gem 'administrate'
gem 'wisper', '2.0.0'

##--- gems for channels ---##
# TODO: bump up gem to 2.0
gem 'facebook-messenger'
gem 'line-bot-api'
gem 'twilio-ruby', '~> 5.66'
Expand All @@ -91,9 +90,14 @@ gem 'twitty', '~> 0.1.5'
# facebook client
gem 'koala'
# slack client
gem 'slack-ruby-client'
gem 'slack-ruby-client', '~> 2.0.0'
# for dialogflow integrations
gem 'google-cloud-dialogflow'
gem 'google-cloud-dialogflow-v2'
gem 'grpc'
# Translate integrations
# 'google-cloud-translate' gem depends on faraday 2.0 version
# this dependency breaks the slack-ruby-client gem
gem 'google-cloud-translate-v3'

##-- apm and error monitoring ---#
# loaded only when environment variables are set.
Expand All @@ -108,9 +112,9 @@ gem 'sentry-ruby', require: false
gem 'sentry-sidekiq', require: false

##-- background job processing --##
gem 'sidekiq', '~> 6.4.2'
gem 'sidekiq'
# We want cron jobs
gem 'sidekiq-cron', '~> 1.6', '>= 1.6.0'
gem 'sidekiq-cron'

##-- Push notification service --##
gem 'fcm'
Expand All @@ -129,7 +133,10 @@ gem 'procore-sift'

# parse email
gem 'email_reply_trimmer'
gem 'html2text'

# TODO: we might have to fork this gem since 0.3.1 has hard depency on nokogir 1.10.
# and this gem hasn't been updated for a while.
gem 'html2text', git: 'https://github.com/chatwoot/html2text_ruby', branch: 'chatwoot'

# to calculate working hours
gem 'working_hours'
Expand All @@ -144,11 +151,6 @@ gem 'stripe'
## to populate db with sample data
gem 'faker'

# Can remove this in rails 7
gem 'net-imap', require: false
gem 'net-pop', require: false
gem 'net-smtp', require: false

# Include logrange conditionally in intializer using env variable
gem 'lograge', '~> 0.12.0', require: false

Expand Down Expand Up @@ -189,7 +191,7 @@ end

group :test do
# Cypress in rails.
gem 'cypress-on-rails', '~> 1.13', '>= 1.13.1'
gem 'cypress-on-rails'
# fast cleaning of database
gem 'database_cleaner'
# mock http calls
Expand All @@ -211,7 +213,7 @@ group :development, :test do
gem 'mock_redis'
gem 'pry-rails'
gem 'rspec_junit_formatter'
gem 'rspec-rails', '~> 5.0.3'
gem 'rspec-rails'
gem 'rubocop', require: false
gem 'rubocop-performance', require: false
gem 'rubocop-rails', require: false
Expand Down
Loading

0 comments on commit 022383d

Please sign in to comment.