From 8e5956479374bb325f819ec98f890fb9fea9d3ca Mon Sep 17 00:00:00 2001 From: Sojan Jose Date: Sun, 5 Apr 2020 12:11:50 +0530 Subject: [PATCH] Chore: Update ruby version (#665) --- .circleci/config.yml | 2 +- .rubocop.yml | 4 + .ruby-version | 2 +- Gemfile | 2 +- Gemfile.lock | 119 +++++++++--------- .../concerns/access_token_auth_helper.rb | 1 + docker/Dockerfile | 10 +- 7 files changed, 75 insertions(+), 65 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ce22c7c86..7b72fb0c0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,7 +7,7 @@ defaults: &defaults working_directory: ~/build docker: # specify the version you desire here - - image: circleci/ruby:2.6.5-node-browsers + - image: circleci/ruby:2.7.0-node-browsers # Specify service dependencies here if necessary # CircleCI maintains a library of pre-built images diff --git a/.rubocop.yml b/.rubocop.yml index da3bf7cd2..ff4a0160a 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -80,6 +80,10 @@ Rails/BulkChangeTable: - 'db/migrate/20170511134418_latlong.rb' - 'db/migrate/20191027054756_create_contact_inboxes.rb' - 'db/migrate/20191130164019_add_template_type_to_messages.rb' +Rails/UniqueValidationWithoutIndex: + Exclude: + - 'app/models/channel/twitter_profile.rb' + - 'app/models/webhook.rb' AllCops: Exclude: - 'bin/**/*' diff --git a/.ruby-version b/.ruby-version index 57cf282eb..24ba9a38d 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.6.5 +2.7.0 diff --git a/Gemfile b/Gemfile index d757fca04..4a826347c 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source 'https://rubygems.org' -ruby '2.6.5' +ruby '2.7.0' ##-- base gems for rails --## gem 'rack-cors', require: 'rack/cors' diff --git a/Gemfile.lock b/Gemfile.lock index de6464968..a3374ffea 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/chatwoot/twitty - revision: c1edd557401d1e8a197b19e738f82e39507a8e2d + revision: af4f3e45dca55e42c64f7741a1fedfaa94d36419 specs: twitty (0.1.0) oauth @@ -16,7 +16,7 @@ GIT GEM remote: https://rubygems.org/ specs: - action-cable-testing (0.6.0) + action-cable-testing (0.6.1) actioncable (>= 5.0) actioncable (6.0.2.2) actionpack (= 6.0.2.2) @@ -77,26 +77,26 @@ GEM activerecord (>= 5.0, < 6.1) addressable (2.7.0) public_suffix (>= 2.0.2, < 5.0) - annotate (3.0.3) + annotate (3.1.1) activerecord (>= 3.2, < 7.0) rake (>= 10.4, < 14.0) ast (2.4.0) attr_extras (6.2.3) aws-eventstream (1.0.3) - aws-partitions (1.269.0) - aws-sdk-core (3.89.1) + aws-partitions (1.294.0) + aws-sdk-core (3.92.0) aws-eventstream (~> 1.0, >= 1.0.2) aws-partitions (~> 1, >= 1.239.0) aws-sigv4 (~> 1.1) jmespath (~> 1.0) - aws-sdk-kms (1.28.0) + aws-sdk-kms (1.30.0) aws-sdk-core (~> 3, >= 3.71.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.60.1) + aws-sdk-s3 (1.61.2) aws-sdk-core (~> 3, >= 3.83.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.1) - aws-sigv4 (1.1.0) + aws-sigv4 (1.1.1) aws-eventstream (~> 1.0, >= 1.0.2) axiom-types (0.1.1) descendants_tracker (~> 0.0.4) @@ -113,10 +113,10 @@ GEM nokogiri (~> 1.6, >= 1.6.8) bcrypt (3.1.13) bindex (0.8.1) - bootsnap (1.4.5) + bootsnap (1.4.6) msgpack (~> 1.0) - brakeman (4.7.2) - browser (3.0.3) + brakeman (4.8.0) + browser (4.0.0) builder (3.2.4) bullet (6.1.0) activesupport (>= 3.0.0) @@ -127,7 +127,7 @@ GEM bundler (>= 1.2.0, < 3) thor (~> 0.18) byebug (11.1.1) - chargebee (2.7.3) + chargebee (2.7.5) json_pure (~> 2.1) rest-client (>= 1.8, < 3.0) coderay (1.1.2) @@ -151,7 +151,7 @@ GEM devise (> 3.5.2, < 5) rails (>= 4.2.0, < 6.1) diff-lcs (1.3) - digest-crc (0.4.1) + digest-crc (0.5.1) docile (1.3.2) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) @@ -165,12 +165,12 @@ GEM facebook-messenger (1.4.1) httparty (~> 0.13, >= 0.13.7) rack (>= 1.4.5) - factory_bot (5.1.1) + factory_bot (5.1.2) activesupport (>= 4.2.0) factory_bot_rails (5.1.1) factory_bot (~> 5.1.0) railties (>= 4.2.0) - faker (2.10.1) + faker (2.11.0) i18n (>= 1.6, < 2) faraday (0.17.3) multipart-post (>= 1.2, < 3) @@ -178,10 +178,10 @@ GEM faraday (>= 0.7.4, < 1.0) ffi (1.12.2) flag_shih_tzu (0.3.23) - foreman (0.87.0) + foreman (0.87.1) globalid (0.4.2) activesupport (>= 4.2.0) - google-api-client (0.36.4) + google-api-client (0.37.2) addressable (~> 2.5, >= 2.5.1) googleauth (~> 0.9) httpclient (>= 2.8.1, < 3.0) @@ -192,8 +192,8 @@ GEM google-cloud-core (1.5.0) google-cloud-env (~> 1.0) google-cloud-errors (~> 1.0) - google-cloud-env (1.3.0) - faraday (~> 0.11) + google-cloud-env (1.3.1) + faraday (>= 0.17.3, < 2.0) google-cloud-errors (1.0.0) google-cloud-storage (1.25.1) addressable (~> 2.5) @@ -202,8 +202,8 @@ GEM google-cloud-core (~> 1.2) googleauth (~> 0.9) mini_mime (~> 1.0) - googleauth (0.10.0) - faraday (~> 0.12) + googleauth (0.11.0) + faraday (>= 0.17.3, < 2.0) jwt (>= 1.4, < 3.0) memoist (~> 0.16) multi_json (~> 1.11) @@ -217,7 +217,7 @@ GEM http-accept (1.7.0) http-cookie (1.0.3) domain_name (~> 0.5) - httparty (0.17.3) + httparty (0.18.0) mime-types (~> 3.0) multi_xml (>= 0.5.2) httpclient (2.8.3) @@ -226,11 +226,11 @@ GEM ice_nine (0.11.2) inflecto (0.0.2) jaro_winkler (1.5.4) - jbuilder (2.9.1) - activesupport (>= 4.2.0) + jbuilder (2.10.0) + activesupport (>= 5.0.0) jmespath (1.4.0) json (2.3.0) - json_pure (2.2.0) + json_pure (2.3.0) jwt (2.2.1) kaminari (1.2.0) activesupport (>= 4.1.0) @@ -248,8 +248,8 @@ GEM addressable faraday json (>= 1.8) - launchy (2.4.3) - addressable (~> 2.3) + launchy (2.5.0) + addressable (~> 2.7) letter_opener (1.7.0) launchy (~> 2.2) listen (3.2.1) @@ -263,7 +263,7 @@ GEM marcel (0.3.3) mimemagic (~> 0.3.2) memoist (0.16.2) - method_source (0.9.2) + method_source (1.0.0) mime-types (3.3.1) mime-types-data (~> 3.2015) mime-types-data (3.2019.1009) @@ -273,7 +273,7 @@ GEM mini_portile2 (2.4.0) minitest (5.14.0) mock_redis (0.22.0) - msgpack (1.3.1) + msgpack (1.3.3) multi_json (1.14.1) multi_xml (0.6.0) multipart-post (2.1.1) @@ -284,14 +284,14 @@ GEM mini_portile2 (~> 2.4.0) oauth (0.5.4) orm_adapter (0.5.0) - os (1.0.1) + os (1.1.0) parallel (1.19.1) - parser (2.7.0.2) + parser (2.7.1.0) ast (~> 2.4.0) - pg (1.2.2) - pry (0.12.2) - coderay (~> 1.1.0) - method_source (~> 0.9.0) + pg (1.2.3) + pry (0.13.0) + coderay (~> 1.1) + method_source (~> 1.0) pry-rails (0.3.9) pry (>= 0.10.4) public_suffix (4.0.3) @@ -347,7 +347,7 @@ GEM redis-rack-cache (2.2.1) rack-cache (>= 1.10, < 2) redis-store (>= 1.6, < 2) - redis-store (1.8.1) + redis-store (1.8.2) redis (>= 4, < 5) representable (3.0.4) declarative (< 0.1.0) @@ -362,15 +362,16 @@ GEM mime-types (>= 1.16, < 4.0) netrc (~> 0.8) retriable (3.1.2) + rexml (3.2.4) rspec-core (3.9.1) rspec-support (~> 3.9.1) - rspec-expectations (3.9.0) + rspec-expectations (3.9.1) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.9.0) rspec-mocks (3.9.1) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.9.0) - rspec-rails (4.0.0.beta4) + rspec-rails (4.0.0) actionpack (>= 4.2) activesupport (>= 4.2) railties (>= 4.2) @@ -379,19 +380,21 @@ GEM rspec-mocks (~> 3.9) rspec-support (~> 3.9) rspec-support (3.9.2) - rubocop (0.79.0) + rubocop (0.81.0) jaro_winkler (~> 1.5.1) parallel (~> 1.10) parser (>= 2.7.0.1) rainbow (>= 2.2.2, < 4.0) + rexml ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 1.7) + unicode-display_width (>= 1.4.0, < 2.0) rubocop-performance (1.5.2) rubocop (>= 0.71.0) - rubocop-rails (2.4.2) + rubocop-rails (2.5.1) + activesupport rack (>= 1.1) rubocop (>= 0.72.0) - rubocop-rspec (1.37.1) + rubocop-rspec (1.38.1) rubocop (>= 0.68.1) ruby-progressbar (1.10.1) sass (3.7.4) @@ -399,25 +402,26 @@ GEM sass-listen (4.0.0) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) - scout_apm (2.6.6) + scout_apm (2.6.7) parser scss_lint (0.59.0) sass (~> 3.5, >= 3.5.5) seed_dump (3.3.1) activerecord (>= 4) activesupport (>= 4) + semantic_range (2.3.0) sentry-raven (2.13.0) faraday (>= 0.7.6, < 1.0) - shoulda-matchers (4.2.0) + shoulda-matchers (4.3.0) activesupport (>= 4.2.0) - sidekiq (6.0.4) + sidekiq (6.0.6) connection_pool (>= 2.2.2) - rack (>= 2.0.0) + rack (~> 2.0) rack-protection (>= 2.0.0) redis (>= 4.1.0) - signet (0.12.0) + signet (0.14.0) addressable (~> 2.3) - faraday (~> 0.9) + faraday (>= 0.17.3, < 2.0) jwt (>= 1.5, < 3.0) multi_json (~> 1.10) simplecov (0.17.1) @@ -445,7 +449,7 @@ GEM time_diff (0.3.0) activesupport i18n - tzinfo (1.2.6) + tzinfo (1.2.7) thread_safe (~> 0.1) tzinfo-data (1.2019.3) tzinfo (>= 1.0.0) @@ -454,10 +458,10 @@ GEM execjs (>= 0.3.0, < 3) unf (0.1.4) unf_ext - unf_ext (0.0.7.6) - unicode-display_width (1.6.1) + unf_ext (0.0.7.7) + unicode-display_width (1.7.0) uniform_notifier (1.13.0) - valid_email2 (3.1.3) + valid_email2 (3.2.1) activemodel (>= 3.2) mail (~> 2.5) virtus (1.0.5) @@ -472,10 +476,11 @@ GEM activemodel (>= 6.0.0) bindex (>= 0.4.0) railties (>= 6.0.0) - webpacker (4.2.2) - activesupport (>= 4.2) + webpacker (5.0.1) + activesupport (>= 5.2) rack-proxy (>= 0.6.1) - railties (>= 4.2) + railties (>= 5.2) + semantic_range (>= 2.3.0) websocket-driver (0.7.1) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.4) @@ -557,7 +562,7 @@ DEPENDENCIES wisper (= 2.0.0) RUBY VERSION - ruby 2.6.5p114 + ruby 2.7.0p0 BUNDLED WITH - 2.0.2 + 2.1.2 diff --git a/app/controllers/concerns/access_token_auth_helper.rb b/app/controllers/concerns/access_token_auth_helper.rb index 9ebcf3864..3e3875333 100644 --- a/app/controllers/concerns/access_token_auth_helper.rb +++ b/app/controllers/concerns/access_token_auth_helper.rb @@ -7,6 +7,7 @@ module AccessTokenAuthHelper def authenticate_access_token! access_token = AccessToken.find_by(token: request.headers[:api_access_token]) render_unauthorized('Invalid Access Token') && return unless access_token + token_owner = access_token.owner @resource = token_owner end diff --git a/docker/Dockerfile b/docker/Dockerfile index ace2dd170..80dd6046c 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,5 +1,5 @@ # pre-build stage -FROM ruby:2.6.5-alpine AS pre-builder +FROM ruby:2.7.0-alpine AS pre-builder # ARG default to production settings # For development docker-compose file overrides ARGS @@ -51,7 +51,7 @@ RUN if [ "$RAILS_ENV" = "production" ]; then \ fi # final build stage -FROM ruby:2.6.5-alpine +FROM ruby:2.7.0-alpine ARG BUNDLE_WITHOUT="development:test" ENV BUNDLE_WITHOUT ${BUNDLE_WITHOUT} @@ -83,8 +83,8 @@ COPY --from=pre-builder /gems/ /gems/ COPY --from=pre-builder /app /app # Remove unecessary files -RUN rm -rf /gems/ruby/2.6.0/cache/*.gem \ - && find /gems/ruby/2.6.0/gems/ -name "*.c" -delete \ - && find /gems/ruby/2.6.0/gems/ -name "*.o" -delete +RUN rm -rf /gems/ruby/2.7.0/cache/*.gem \ + && find /gems/ruby/2.7.0/gems/ -name "*.c" -delete \ + && find /gems/ruby/2.7.0/gems/ -name "*.o" -delete WORKDIR /app