From f66af94f65cf7a952736d4f4c6e3b7b2ae2cec42 Mon Sep 17 00:00:00 2001 From: yuenmichelle1 Date: Tue, 21 May 2024 11:03:57 -0500 Subject: [PATCH 1/5] set up dual boot --- Dockerfile.rails-next | 32 +++ Gemfile | 4 + Gemfile.lock | 24 ++ Gemfile.next | 1 + Gemfile.next.lock | 398 ++++++++++++++++++++++++++++++++++ docker-compose-rails-next.yml | 57 +++++ 6 files changed, 516 insertions(+) create mode 100644 Dockerfile.rails-next create mode 120000 Gemfile.next create mode 100644 Gemfile.next.lock create mode 100644 docker-compose-rails-next.yml diff --git a/Dockerfile.rails-next b/Dockerfile.rails-next new file mode 100644 index 00000000..25bca299 --- /dev/null +++ b/Dockerfile.rails-next @@ -0,0 +1,32 @@ +FROM ruby:2.6-slim-buster + +WORKDIR /rails_app + +RUN rm -f /etc/apt/apt.conf.d/docker-clean; echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache + +RUN --mount=type=cache,id=talk-apt-cache,target=/var/cache/apt --mount=type=cache,id=talk-apt-lib,target=/var/lib/apt \ + apt-get update && \ + apt-get install --no-install-recommends -y \ + build-essential \ + git \ + libpq-dev \ + tmpreaper + +ARG RAILS_ENV=production + +ADD ./Gemfile.next /rails_app/ +ADD ./Gemfile.next.lock /rails_app/ + +# ensure we use the rails-next gemfile setup to ensure we boot the upgraded libaries +ENV BUNDLE_GEMFILE=Gemfile.next + +RUN bundle config --global jobs `cat /proc/cpuinfo | grep processor | wc -l | xargs -I % expr % - 1` +RUN if [ "$RAILS_ENV" = "development" ]; then bundle install; else bundle install --without development test; fi + +ADD ./ /rails_app + +RUN (git log --format="%H" -n 1 > /rails_app/public/commit_id.txt && rm -rf .git) + +EXPOSE 81 + +CMD [ "/rails_app/docker/start.sh" ] diff --git a/Gemfile b/Gemfile index 6bf76fed..2af7b721 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,6 @@ +def next? + File.basename(__FILE__) == "Gemfile.next" +end source 'https://rubygems.org' gem 'rails', '~> 4.2' @@ -32,6 +35,7 @@ group :test, :development do gem 'timecop' gem 'pry', '~> 0.11.3' gem 'benchmark-ips' + gem 'ten_years_rails' end group :test do diff --git a/Gemfile.lock b/Gemfile.lock index d61f37e0..2608d4ed 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -77,6 +77,7 @@ GEM codeclimate-test-reporter (0.5.0) simplecov (>= 0.7.1, < 1.0.0) coderay (1.1.2) + colorize (0.8.1) concurrent-ruby (1.1.6) congestion (0.1.0) connection_pool (>= 2.0) @@ -87,6 +88,8 @@ GEM crass (1.0.6) diff-lcs (1.2.5) docile (1.1.5) + domain_name (0.5.20190701) + unf (>= 0.0.5, < 1.0.0) erubis (2.7.0) factory_girl (4.7.0) activesupport (>= 3.0.0) @@ -118,6 +121,9 @@ GEM hashdiff (0.3.7) hitimes (1.3.0) honeybadger (4.5.6) + http-accept (1.7.0) + http-cookie (1.0.5) + domain_name (~> 0.5) i18n (0.9.5) concurrent-ruby (~> 1.0) ice_cube (0.14.0) @@ -159,6 +165,9 @@ GEM mail (2.7.1) mini_mime (>= 0.1.1) method_source (0.9.0) + mime-types (3.5.2) + mime-types-data (~> 3.2015) + mime-types-data (3.2024.0507) mini_mime (1.1.2) mini_portile2 (2.6.1) minitest (5.14.4) @@ -166,6 +175,7 @@ GEM key_struct (~> 0.4) multipart-post (2.1.1) nenv (0.3.0) + netrc (0.11.0) newrelic_rpm (6.12.0.367) nio4r (2.5.8) nokogiri (1.12.5) @@ -221,6 +231,11 @@ GEM ffi (>= 0.5.0) redis (3.3.5) request_store (1.3.1) + rest-client (2.1.0) + http-accept (>= 1.7.0, < 2.0) + http-cookie (>= 1.0.2, < 2.0) + mime-types (>= 1.16, < 4.0) + netrc (~> 0.8) rspec (3.4.0) rspec-core (~> 3.4.0) rspec-expectations (~> 3.4.0) @@ -291,6 +306,11 @@ GEM actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) + ten_years_rails (0.2.0) + actionview + activesupport + colorize (>= 0.8.1) + rest-client (>= 2.0.2) thor (1.1.0) thread_safe (0.3.6) timecop (0.8.1) @@ -298,6 +318,9 @@ GEM hitimes tzinfo (1.2.10) thread_safe (~> 0.1) + unf (0.1.4) + unf_ext + unf_ext (0.0.9.1) webmock (3.4.2) addressable (>= 2.3.6) crack (>= 0.3.2) @@ -339,6 +362,7 @@ DEPENDENCIES simplecov (~> 0.11.2) spring (~> 1.7.1) spring-commands-rspec (~> 1.0.4) + ten_years_rails timecop webmock (~> 3.4) zoo_stream (~> 1.0) diff --git a/Gemfile.next b/Gemfile.next new file mode 120000 index 00000000..6ab79009 --- /dev/null +++ b/Gemfile.next @@ -0,0 +1 @@ +Gemfile \ No newline at end of file diff --git a/Gemfile.next.lock b/Gemfile.next.lock new file mode 100644 index 00000000..725463a6 --- /dev/null +++ b/Gemfile.next.lock @@ -0,0 +1,398 @@ +GIT + remote: https://github.com/zooniverse/restpack_serializer.git + revision: 637aaaf85eda4f467c034f19f52e3f0cb6b20112 + ref: 637aaaf85e + branch: talk-api-version + specs: + restpack_serializer (0.5.9) + activerecord (>= 4.0.3, < 6.0) + activesupport (>= 4.0.3, < 6.0) + kaminari (< 2.0) + +GEM + remote: https://rubygems.org/ + specs: + actionmailer (4.2.11.3) + actionpack (= 4.2.11.3) + actionview (= 4.2.11.3) + activejob (= 4.2.11.3) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 1.0, >= 1.0.5) + actionpack (4.2.11.3) + actionview (= 4.2.11.3) + activesupport (= 4.2.11.3) + rack (~> 1.6) + rack-test (~> 0.6.2) + rails-dom-testing (~> 1.0, >= 1.0.5) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + actionview (4.2.11.3) + activesupport (= 4.2.11.3) + builder (~> 3.1) + erubis (~> 2.7.0) + rails-dom-testing (~> 1.0, >= 1.0.5) + rails-html-sanitizer (~> 1.0, >= 1.0.3) + activejob (4.2.11.3) + activesupport (= 4.2.11.3) + globalid (>= 0.3.0) + activemodel (4.2.11.3) + activesupport (= 4.2.11.3) + builder (~> 3.1) + activerecord (4.2.11.3) + activemodel (= 4.2.11.3) + activesupport (= 4.2.11.3) + arel (~> 6.0) + activesupport (4.2.11.3) + i18n (~> 0.7) + minitest (~> 5.1) + thread_safe (~> 0.3, >= 0.3.4) + tzinfo (~> 1.1) + addressable (2.8.6) + public_suffix (>= 2.0.2, < 6.0) + arel (6.0.4) + aws-sdk (2.3.23) + aws-sdk-resources (= 2.3.23) + aws-sdk-core (2.3.23) + jmespath (~> 1.0) + aws-sdk-resources (2.3.23) + aws-sdk-core (= 2.3.23) + benchmark-ips (2.13.0) + bigdecimal (3.1.8) + builder (3.2.4) + celluloid (0.18.0) + timers (~> 4) + codeclimate-test-reporter (0.6.0) + simplecov (>= 0.7.1, < 1.0.0) + coderay (1.1.3) + colorize (0.8.1) + concurrent-ruby (1.2.3) + congestion (0.1.0) + connection_pool (>= 2.0) + redis (>= 3.1) + connection_pool (2.4.1) + crack (1.0.0) + bigdecimal + rexml + crass (1.0.6) + diff-lcs (1.5.1) + digest (3.1.1) + docile (1.1.5) + domain_name (0.5.20190701) + unf (>= 0.0.5, < 1.0.0) + erubis (2.7.0) + factory_girl (4.7.0) + activesupport (>= 3.0.0) + factory_girl_rails (4.7.0) + factory_girl (~> 4.7.0) + railties (>= 3.0.0) + faraday (1.10.3) + faraday-em_http (~> 1.0) + faraday-em_synchrony (~> 1.0) + faraday-excon (~> 1.1) + faraday-httpclient (~> 1.0) + faraday-multipart (~> 1.0) + faraday-net_http (~> 1.0) + faraday-net_http_persistent (~> 1.0) + faraday-patron (~> 1.0) + faraday-rack (~> 1.0) + faraday-retry (~> 1.0) + ruby2_keywords (>= 0.0.4) + faraday-em_http (1.0.0) + faraday-em_synchrony (1.0.0) + faraday-excon (1.1.0) + faraday-httpclient (1.0.1) + faraday-multipart (1.0.4) + multipart-post (~> 2) + faraday-net_http (1.0.1) + faraday-net_http_persistent (1.2.0) + faraday-patron (1.0.0) + faraday-rack (1.0.0) + faraday-retry (1.0.3) + faraday_middleware (1.2.0) + faraday (~> 1.0) + ffi (1.16.3) + formatador (1.1.0) + globalid (0.4.2) + activesupport (>= 4.2.0) + guard (2.14.2) + formatador (>= 0.2.4) + listen (>= 2.7, < 4.0) + lumberjack (>= 1.0.12, < 2.0) + nenv (~> 0.1) + notiffany (~> 0.0) + pry (>= 0.9.12) + shellany (~> 0.0) + thor (>= 0.18.1) + guard-compat (1.2.1) + guard-rspec (4.6.5) + guard (~> 2.1) + guard-compat (~> 1.1) + rspec (>= 2.99.0, < 4.0) + hashdiff (1.1.0) + honeybadger (4.5.6) + http-accept (1.7.0) + http-cookie (1.0.5) + domain_name (~> 0.5) + i18n (0.9.5) + concurrent-ruby (~> 1.0) + ice_cube (0.14.0) + io-wait (0.3.1) + its-it (1.3.0) + jmespath (1.6.2) + json (1.8.6) + json-schema (2.8.1) + addressable (>= 2.4) + json-schema_builder (0.0.9) + activesupport (>= 4.0) + json-schema (~> 2.5) + kaminari (1.2.2) + activesupport (>= 4.1.0) + kaminari-actionview (= 1.2.2) + kaminari-activerecord (= 1.2.2) + kaminari-core (= 1.2.2) + kaminari-actionview (1.2.2) + actionview + kaminari-core (= 1.2.2) + kaminari-activerecord (1.2.2) + activerecord + kaminari-core (= 1.2.2) + kaminari-core (1.2.2) + key_struct (0.4.2) + listen (3.9.0) + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) + logstash-event (1.2.02) + logstasher (0.9.0) + activerecord (>= 3.0) + activesupport (>= 3.0) + logstash-event (~> 1.2.0) + request_store + loofah (2.22.0) + crass (~> 1.0.2) + nokogiri (>= 1.12.0) + lumberjack (1.2.10) + mail (2.8.1) + mini_mime (>= 0.1.1) + net-imap + net-pop + net-smtp + method_source (0.9.2) + mime-types (3.5.2) + mime-types-data (~> 3.2015) + mime-types-data (3.2024.0507) + mini_mime (1.1.2) + mini_portile2 (2.6.1) + minitest (5.15.0) + modware (0.1.3) + key_struct (~> 0.4) + multipart-post (2.4.1) + nenv (0.3.0) + net-imap (0.2.2) + digest + net-protocol + strscan + net-pop (0.1.2) + net-protocol + net-protocol (0.1.2) + io-wait + timeout + net-smtp (0.3.0) + digest + net-protocol + timeout + netrc (0.11.0) + newrelic_rpm (9.9.0) + nio4r (2.7.3) + nokogiri (1.12.5) + mini_portile2 (~> 2.6.1) + racc (~> 1.4) + notiffany (0.1.3) + nenv (~> 0.1) + shellany (~> 0.0) + pg (0.21.0) + pry (0.11.3) + coderay (~> 1.1.0) + method_source (~> 0.9.0) + public_suffix (4.0.7) + puma (6.4.2) + nio4r (~> 2.0) + pundit (1.1.0) + activesupport (>= 3.0.0) + racc (1.8.0) + rack (1.6.13) + rack-cors (1.0.6) + rack (>= 1.6.0) + rack-protection (2.2.4) + rack + rack-test (0.6.3) + rack (>= 1.0) + rails (4.2.11.3) + actionmailer (= 4.2.11.3) + actionpack (= 4.2.11.3) + actionview (= 4.2.11.3) + activejob (= 4.2.11.3) + activemodel (= 4.2.11.3) + activerecord (= 4.2.11.3) + activesupport (= 4.2.11.3) + bundler (>= 1.3.0, < 2.0) + railties (= 4.2.11.3) + sprockets-rails + rails-deprecated_sanitizer (1.0.4) + activesupport (>= 4.2.0.alpha) + rails-dom-testing (1.0.9) + activesupport (>= 4.2.0, < 5.0) + nokogiri (~> 1.6) + rails-deprecated_sanitizer (>= 1.0.1) + rails-html-sanitizer (1.5.0) + loofah (~> 2.19, >= 2.19.1) + railties (4.2.11.3) + actionpack (= 4.2.11.3) + activesupport (= 4.2.11.3) + rake (>= 0.8.7) + thor (>= 0.18.1, < 2.0) + rake (13.2.1) + rb-fsevent (0.11.2) + rb-inotify (0.11.1) + ffi (~> 1.0) + redis (3.3.5) + request_store (1.7.0) + rack (>= 1.4) + rest-client (2.1.0) + http-accept (>= 1.7.0, < 2.0) + http-cookie (>= 1.0.2, < 2.0) + mime-types (>= 1.16, < 4.0) + netrc (~> 0.8) + rexml (3.2.8) + strscan (>= 3.0.9) + rspec (3.4.0) + rspec-core (~> 3.4.0) + rspec-expectations (~> 3.4.0) + rspec-mocks (~> 3.4.0) + rspec-core (3.4.4) + rspec-support (~> 3.4.0) + rspec-expectations (3.4.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.4.0) + rspec-its (1.2.0) + rspec-core (>= 3.0.0) + rspec-expectations (>= 3.0.0) + rspec-mocks (3.4.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.4.0) + rspec-rails (3.4.2) + actionpack (>= 3.0, < 4.3) + activesupport (>= 3.0, < 4.3) + railties (>= 3.0, < 4.3) + rspec-core (~> 3.4.0) + rspec-expectations (~> 3.4.0) + rspec-mocks (~> 3.4.0) + rspec-support (~> 3.4.0) + rspec-support (3.4.1) + ruby2_keywords (0.0.5) + schema_monkey (2.1.6) + activerecord (>= 4.2) + modware (~> 0.1.0) + schema_plus_core (1.0.2) + activerecord (~> 4.2) + its-it (~> 1.2) + schema_monkey (~> 2.1) + schema_plus_indexes (0.3.1) + activerecord (>= 4.2, < 5.3) + its-it (~> 1.2) + schema_plus_core + schema_plus_pg_indexes (0.1.12) + activerecord (~> 4.2) + its-it (~> 1.2) + schema_plus_core (~> 1.0) + schema_plus_indexes (~> 0.1, >= 0.1.3) + shellany (0.0.1) + sidekiq (5.2.8) + connection_pool (~> 2.2, >= 2.2.2) + rack (< 2.1.0) + rack-protection (>= 1.5.0) + redis (>= 3.3.5, < 5) + sidekiq-congestion (0.1.1) + congestion (~> 0.1) + sidekiq (>= 3.0) + sidetiq (0.7.2) + celluloid (>= 0.17.3) + ice_cube (~> 0.14.0) + sidekiq (>= 4.1.0) + simplecov (0.11.2) + docile (~> 1.1.0) + json (~> 1.8) + simplecov-html (~> 0.10.0) + simplecov-html (0.10.2) + spring (1.7.2) + spring-commands-rspec (1.0.4) + spring (>= 0.9.1) + sprockets (4.1.1) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.2.2) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) + strscan (3.1.0) + ten_years_rails (0.2.0) + actionview + activesupport + colorize (>= 0.8.1) + rest-client (>= 2.0.2) + thor (1.2.2) + thread_safe (0.3.6) + timecop (0.9.8) + timeout (0.4.0) + timers (4.3.5) + tzinfo (1.2.11) + thread_safe (~> 0.1) + unf (0.1.4) + unf_ext + unf_ext (0.0.9.1) + webmock (3.23.0) + addressable (>= 2.8.0) + crack (>= 0.3.2) + hashdiff (>= 0.4.0, < 2.0.0) + zoo_stream (1.0.1) + aws-sdk + +PLATFORMS + ruby + +DEPENDENCIES + aws-sdk (~> 2.3.7) + benchmark-ips + codeclimate-test-reporter (~> 0.5) + factory_girl_rails (~> 4.7.0) + faraday + faraday_middleware + guard (~> 2.14.0) + guard-rspec (~> 4.6.5) + honeybadger (~> 4.5.0) + json-schema (~> 2.8) + json-schema_builder (~> 0.0.8) + logstasher (~> 0.9.0) + newrelic_rpm + pg (~> 0.21) + pry (~> 0.11.3) + puma + pundit (~> 1.1.0) + rack-cors (~> 1.0.5) + rails (~> 4.2) + redis (~> 3.3.0) + restpack_serializer! + rspec-its (~> 1.2.0) + rspec-rails (~> 3.4.2) + schema_plus_pg_indexes (~> 0.1.12) + sidekiq (< 6) + sidekiq-congestion (~> 0.1.0) + sidetiq (~> 0.7.2) + simplecov (~> 0.11.2) + spring (~> 1.7.1) + spring-commands-rspec (~> 1.0.4) + ten_years_rails + timecop + webmock (~> 3.4) + zoo_stream (~> 1.0) + +BUNDLED WITH + 1.17.3 diff --git a/docker-compose-rails-next.yml b/docker-compose-rails-next.yml new file mode 100644 index 00000000..73bdfdd3 --- /dev/null +++ b/docker-compose-rails-next.yml @@ -0,0 +1,57 @@ +version: '3' +services: + postgres: + image: postgres:11 + environment: + - "POSTGRES_USER=talkapi" + - "POSTGRES_PASSWORD=talkapi" + ports: + - "5432:5432" + + redis: + image: redis + command: redis-server --appendonly yes + ports: + - "6379:6379" + + talkapi: + image: talkapi:rails-next-local + build: + context: . + dockerfile: Dockerfile.rails-next + args: + RAILS_ENV: development + volumes: + - ./:/rails_app + - gem_cache:/usr/local/bundle + ports: + - "3000:3000" + environment: + - "RAILS_ENV=development" + - "DATABASE_URL=postgresql://talkapi:talkapi@pg" + - "PANOPTES_DATABASE_URL=postgresql://talkapi:talkapi@pg" + - "REDIS_URL=redis://redis:6379/0" + - "DISABLE_SPRING=true" + links: + - postgres:pg + - redis + + sidekiq: + image: talkapi:rails-next-local + volumes: + - ./:/rails_app + - gem_cache:/usr/local/bundle + command: ["/rails_app/docker/start-sidekiq.sh"] + environment: + - "RAILS_ENV=development" + - "DATABASE_URL=postgresql://talkapi:talkapi@pg" + - "PANOPTES_DATABASE_URL=postgresql://talkapi:talkapi@pg" + - "REDIS_URL=redis://redis:6379/0" + - "DISABLE_SPRING=true" + - "SIDEKIQ_VERBOSE=true" + links: + - redis:redis + - postgres:pg + +volumes: + gem_cache: \ No newline at end of file From 9a3d74f83329e63bb44aa5900ee631014d488794 Mon Sep 17 00:00:00 2001 From: yuenmichelle1 Date: Tue, 21 May 2024 12:52:29 -0500 Subject: [PATCH 2/5] update next versions and readme and add workflow run ci tests --- .github/workflows/run_tests_CI.yml | 12 +- .guardrails/ignore | 3 +- Dockerfile.rails-next | 1 + Gemfile | 24 +++- Gemfile.next.lock | 222 +++++++++++++++-------------- README.md | 21 ++- 6 files changed, 165 insertions(+), 118 deletions(-) diff --git a/.github/workflows/run_tests_CI.yml b/.github/workflows/run_tests_CI.yml index 0cabd64d..04f7c9cf 100644 --- a/.github/workflows/run_tests_CI.yml +++ b/.github/workflows/run_tests_CI.yml @@ -21,12 +21,20 @@ jobs: --health-interval 10s --health-timeout 5s --health-retries 5 + continue-on-error: true + strategy: + matrix: + gemfile: + - Gemfile + - Gemfile.next + ruby: + - 2.6 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: 2.5 + ruby-version: ${{ matrix.ruby }} bundler-cache: true - name: Install PG Client run: | diff --git a/.guardrails/ignore b/.guardrails/ignore index bb848af9..af2e968a 100644 --- a/.guardrails/ignore +++ b/.guardrails/ignore @@ -1,3 +1,4 @@ docker-compose.yml config/database.yml -config/secrets.yml \ No newline at end of file +config/secrets.yml +docker-compose-rails-next.yml \ No newline at end of file diff --git a/Dockerfile.rails-next b/Dockerfile.rails-next index 25bca299..115a8bf0 100644 --- a/Dockerfile.rails-next +++ b/Dockerfile.rails-next @@ -13,6 +13,7 @@ RUN --mount=type=cache,id=talk-apt-cache,target=/var/cache/apt --mount=type=cach tmpreaper ARG RAILS_ENV=production +ENV RAILS_ENV=$RAILS_ENV ADD ./Gemfile.next /rails_app/ ADD ./Gemfile.next.lock /rails_app/ diff --git a/Gemfile b/Gemfile index 2af7b721..13144c10 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,11 @@ def next? end source 'https://rubygems.org' -gem 'rails', '~> 4.2' +if next? + gem 'rails', '5.0.7.2' +else + gem 'rails', '~> 4.2' +end gem 'rack-cors', '~> 1.0.5' gem 'pg', '~> 0.21' gem 'redis', '~> 3.3.0' @@ -17,16 +21,28 @@ gem 'aws-sdk', '~> 2.3.7' gem 'faraday' gem 'faraday_middleware' gem 'pundit', '~> 1.1.0' -gem 'spring', '~> 1.7.1', group: :development +if next? + gem 'spring', '~> 2.0.2', group: :development +else + gem 'spring', '~> 1.7.1', group: :development +end gem 'newrelic_rpm' gem 'honeybadger', '~> 4.5.0' gem 'logstasher', '~> 0.9.0' gem 'zoo_stream', '~> 1.0' -gem 'schema_plus_pg_indexes', '~> 0.1.12' +if next? + gem 'schema_plus_pg_indexes', '~> 0.2.1' +else + gem 'schema_plus_pg_indexes', '~> 0.1.12' +end gem 'puma' group :test, :development do - gem 'rspec-rails', '~> 3.4.2' + if next? + gem 'rspec-rails', '~> 4.1.2' + else + gem 'rspec-rails', '~> 3.4.2' + end gem 'rspec-its', '~> 1.2.0' gem 'spring-commands-rspec', '~> 1.0.4' gem 'factory_girl_rails', '~> 4.7.0' diff --git a/Gemfile.next.lock b/Gemfile.next.lock index 725463a6..4f3b8415 100644 --- a/Gemfile.next.lock +++ b/Gemfile.next.lock @@ -12,49 +12,53 @@ GIT GEM remote: https://rubygems.org/ specs: - actionmailer (4.2.11.3) - actionpack (= 4.2.11.3) - actionview (= 4.2.11.3) - activejob (= 4.2.11.3) + actioncable (5.0.7.2) + actionpack (= 5.0.7.2) + nio4r (>= 1.2, < 3.0) + websocket-driver (~> 0.6.1) + actionmailer (5.0.7.2) + actionpack (= 5.0.7.2) + actionview (= 5.0.7.2) + activejob (= 5.0.7.2) mail (~> 2.5, >= 2.5.4) - rails-dom-testing (~> 1.0, >= 1.0.5) - actionpack (4.2.11.3) - actionview (= 4.2.11.3) - activesupport (= 4.2.11.3) - rack (~> 1.6) - rack-test (~> 0.6.2) - rails-dom-testing (~> 1.0, >= 1.0.5) + rails-dom-testing (~> 2.0) + actionpack (5.0.7.2) + actionview (= 5.0.7.2) + activesupport (= 5.0.7.2) + rack (~> 2.0) + rack-test (~> 0.6.3) + rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (4.2.11.3) - activesupport (= 4.2.11.3) + actionview (5.0.7.2) + activesupport (= 5.0.7.2) builder (~> 3.1) erubis (~> 2.7.0) - rails-dom-testing (~> 1.0, >= 1.0.5) + rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (4.2.11.3) - activesupport (= 4.2.11.3) - globalid (>= 0.3.0) - activemodel (4.2.11.3) - activesupport (= 4.2.11.3) - builder (~> 3.1) - activerecord (4.2.11.3) - activemodel (= 4.2.11.3) - activesupport (= 4.2.11.3) - arel (~> 6.0) - activesupport (4.2.11.3) - i18n (~> 0.7) + activejob (5.0.7.2) + activesupport (= 5.0.7.2) + globalid (>= 0.3.6) + activemodel (5.0.7.2) + activesupport (= 5.0.7.2) + activerecord (5.0.7.2) + activemodel (= 5.0.7.2) + activesupport (= 5.0.7.2) + arel (~> 7.0) + activesupport (5.0.7.2) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) minitest (~> 5.1) - thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) addressable (2.8.6) public_suffix (>= 2.0.2, < 6.0) - arel (6.0.4) + arel (7.1.4) aws-sdk (2.3.23) aws-sdk-resources (= 2.3.23) aws-sdk-core (2.3.23) jmespath (~> 1.0) aws-sdk-resources (2.3.23) aws-sdk-core (= 2.3.23) + base64 (0.2.0) benchmark-ips (2.13.0) bigdecimal (3.1.8) builder (3.2.4) @@ -63,7 +67,7 @@ GEM codeclimate-test-reporter (0.6.0) simplecov (>= 0.7.1, < 1.0.0) coderay (1.1.3) - colorize (0.8.1) + colorize (1.1.0) concurrent-ruby (1.2.3) congestion (0.1.0) connection_pool (>= 2.0) @@ -73,8 +77,8 @@ GEM bigdecimal rexml crass (1.0.6) + date (3.3.4) diff-lcs (1.5.1) - digest (3.1.1) docile (1.1.5) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) @@ -111,8 +115,8 @@ GEM faraday (~> 1.0) ffi (1.16.3) formatador (1.1.0) - globalid (0.4.2) - activesupport (>= 4.2.0) + globalid (1.1.0) + activesupport (>= 5.0) guard (2.14.2) formatador (>= 0.2.4) listen (>= 2.7, < 4.0) @@ -132,10 +136,9 @@ GEM http-accept (1.7.0) http-cookie (1.0.5) domain_name (~> 0.5) - i18n (0.9.5) + i18n (1.14.5) concurrent-ruby (~> 1.0) ice_cube (0.14.0) - io-wait (0.3.1) its-it (1.3.0) jmespath (1.6.2) json (1.8.6) @@ -179,31 +182,27 @@ GEM mime-types (3.5.2) mime-types-data (~> 3.2015) mime-types-data (3.2024.0507) - mini_mime (1.1.2) - mini_portile2 (2.6.1) - minitest (5.15.0) + mini_mime (1.1.5) + mini_portile2 (2.8.6) + minitest (5.23.0) modware (0.1.3) key_struct (~> 0.4) multipart-post (2.4.1) nenv (0.3.0) - net-imap (0.2.2) - digest + net-imap (0.3.7) + date net-protocol - strscan net-pop (0.1.2) net-protocol - net-protocol (0.1.2) - io-wait + net-protocol (0.2.2) timeout - net-smtp (0.3.0) - digest + net-smtp (0.5.0) net-protocol - timeout netrc (0.11.0) newrelic_rpm (9.9.0) nio4r (2.7.3) - nokogiri (1.12.5) - mini_portile2 (~> 2.6.1) + nokogiri (1.13.10) + mini_portile2 (~> 2.8.0) racc (~> 1.4) notiffany (0.1.3) nenv (~> 0.1) @@ -212,41 +211,42 @@ GEM pry (0.11.3) coderay (~> 1.1.0) method_source (~> 0.9.0) - public_suffix (4.0.7) + public_suffix (5.0.5) puma (6.4.2) nio4r (~> 2.0) pundit (1.1.0) activesupport (>= 3.0.0) racc (1.8.0) - rack (1.6.13) + rack (2.2.9) rack-cors (1.0.6) rack (>= 1.6.0) - rack-protection (2.2.4) - rack + rack-protection (3.2.0) + base64 (>= 0.1.0) + rack (~> 2.2, >= 2.2.4) rack-test (0.6.3) rack (>= 1.0) - rails (4.2.11.3) - actionmailer (= 4.2.11.3) - actionpack (= 4.2.11.3) - actionview (= 4.2.11.3) - activejob (= 4.2.11.3) - activemodel (= 4.2.11.3) - activerecord (= 4.2.11.3) - activesupport (= 4.2.11.3) - bundler (>= 1.3.0, < 2.0) - railties (= 4.2.11.3) - sprockets-rails - rails-deprecated_sanitizer (1.0.4) - activesupport (>= 4.2.0.alpha) - rails-dom-testing (1.0.9) - activesupport (>= 4.2.0, < 5.0) - nokogiri (~> 1.6) - rails-deprecated_sanitizer (>= 1.0.1) + rails (5.0.7.2) + actioncable (= 5.0.7.2) + actionmailer (= 5.0.7.2) + actionpack (= 5.0.7.2) + actionview (= 5.0.7.2) + activejob (= 5.0.7.2) + activemodel (= 5.0.7.2) + activerecord (= 5.0.7.2) + activesupport (= 5.0.7.2) + bundler (>= 1.3.0) + railties (= 5.0.7.2) + sprockets-rails (>= 2.0.0) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest + nokogiri (>= 1.6) rails-html-sanitizer (1.5.0) loofah (~> 2.19, >= 2.19.1) - railties (4.2.11.3) - actionpack (= 4.2.11.3) - activesupport (= 4.2.11.3) + railties (5.0.7.2) + actionpack (= 5.0.7.2) + activesupport (= 5.0.7.2) + method_source rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) rake (13.2.1) @@ -263,53 +263,53 @@ GEM netrc (~> 0.8) rexml (3.2.8) strscan (>= 3.0.9) - rspec (3.4.0) - rspec-core (~> 3.4.0) - rspec-expectations (~> 3.4.0) - rspec-mocks (~> 3.4.0) - rspec-core (3.4.4) - rspec-support (~> 3.4.0) - rspec-expectations (3.4.0) + rspec (3.13.0) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.0) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.4.0) + rspec-support (~> 3.13.0) rspec-its (1.2.0) rspec-core (>= 3.0.0) rspec-expectations (>= 3.0.0) - rspec-mocks (3.4.1) + rspec-mocks (3.13.1) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.4.0) - rspec-rails (3.4.2) - actionpack (>= 3.0, < 4.3) - activesupport (>= 3.0, < 4.3) - railties (>= 3.0, < 4.3) - rspec-core (~> 3.4.0) - rspec-expectations (~> 3.4.0) - rspec-mocks (~> 3.4.0) - rspec-support (~> 3.4.0) - rspec-support (3.4.1) + rspec-support (~> 3.13.0) + rspec-rails (4.1.2) + actionpack (>= 4.2) + activesupport (>= 4.2) + railties (>= 4.2) + rspec-core (~> 3.10) + rspec-expectations (~> 3.10) + rspec-mocks (~> 3.10) + rspec-support (~> 3.10) + rspec-support (3.13.1) ruby2_keywords (0.0.5) schema_monkey (2.1.6) activerecord (>= 4.2) modware (~> 0.1.0) - schema_plus_core (1.0.2) - activerecord (~> 4.2) + schema_plus_core (2.2.3) + activerecord (~> 5.0) its-it (~> 1.2) schema_monkey (~> 2.1) schema_plus_indexes (0.3.1) activerecord (>= 4.2, < 5.3) its-it (~> 1.2) schema_plus_core - schema_plus_pg_indexes (0.1.12) - activerecord (~> 4.2) + schema_plus_pg_indexes (0.2.1) + activerecord (~> 5.0, >= 5.0.1) its-it (~> 1.2) - schema_plus_core (~> 1.0) - schema_plus_indexes (~> 0.1, >= 0.1.3) + schema_plus_core (~> 2.0) + schema_plus_indexes (~> 0.2, >= 0.2.4) shellany (0.0.1) - sidekiq (5.2.8) + sidekiq (5.2.9) connection_pool (~> 2.2, >= 2.2.2) - rack (< 2.1.0) + rack (~> 2.0) rack-protection (>= 1.5.0) - redis (>= 3.3.5, < 5) + redis (>= 3.3.5, < 4.2) sidekiq-congestion (0.1.1) congestion (~> 0.1) sidekiq (>= 3.0) @@ -322,12 +322,13 @@ GEM json (~> 1.8) simplecov-html (~> 0.10.0) simplecov-html (0.10.2) - spring (1.7.2) + spring (2.0.2) + activesupport (>= 4.2) spring-commands-rspec (1.0.4) spring (>= 0.9.1) - sprockets (4.1.1) + sprockets (4.2.1) concurrent-ruby (~> 1.0) - rack (> 1, < 3) + rack (>= 2.2.4, < 4) sprockets-rails (3.2.2) actionpack (>= 4.0) activesupport (>= 4.0) @@ -338,10 +339,10 @@ GEM activesupport colorize (>= 0.8.1) rest-client (>= 2.0.2) - thor (1.2.2) + thor (1.3.1) thread_safe (0.3.6) timecop (0.9.8) - timeout (0.4.0) + timeout (0.4.1) timers (4.3.5) tzinfo (1.2.11) thread_safe (~> 0.1) @@ -352,6 +353,9 @@ GEM addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) + websocket-driver (0.6.5) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) zoo_stream (1.0.1) aws-sdk @@ -377,17 +381,17 @@ DEPENDENCIES puma pundit (~> 1.1.0) rack-cors (~> 1.0.5) - rails (~> 4.2) + rails (= 5.0.7.2) redis (~> 3.3.0) restpack_serializer! rspec-its (~> 1.2.0) - rspec-rails (~> 3.4.2) - schema_plus_pg_indexes (~> 0.1.12) + rspec-rails (~> 4.1.2) + schema_plus_pg_indexes (~> 0.2.1) sidekiq (< 6) sidekiq-congestion (~> 0.1.0) sidetiq (~> 0.7.2) simplecov (~> 0.11.2) - spring (~> 1.7.1) + spring (~> 2.0.2) spring-commands-rspec (~> 1.0.4) ten_years_rails timecop @@ -395,4 +399,4 @@ DEPENDENCIES zoo_stream (~> 1.0) BUNDLED WITH - 1.17.3 + 1.17.2 diff --git a/README.md b/README.md index cf9b1c04..cb9680db 100644 --- a/README.md +++ b/README.md @@ -28,8 +28,6 @@ Alternatively use docker to run a testing environment bash shell and run test co 5. `RAILS_ENV=test bundle exec rake panoptes:db:setup` 4. `bundle exec rspec` -** See *.travis.yml* for more details on how to setup the talk database. - ## Layout The app is built to conform to the [JSON API spec](http://jsonapi.org/) @@ -71,6 +69,25 @@ Authentication is provided by signing your requests with a Bearer-Token Some resources ([User](app/models/user.rb), [Subject](app/models/subject.rb)) are proxied from Panoptes +## Setting Up Rails-next +Using the gem https://github.com/clio/ten_years_rails to help with the upgrade path https://www.youtube.com/watch?v=6aCfc0DkSFo + +### Using docker-compose for env setup + +``` +docker-compose -f docker-compose-rails-next.yml build + +docker-compose -f docker-compose-rails-next.yml run --service-ports --rm talkapi bash +``` + +### Install the gems via next + +`BUNDLE_GEMFILE=Gemfile.next bundle install` + +OR + +`next bundle install` + ## To-Do From 31346191e319fd4e6b37c3accfac28f8250a2cda Mon Sep 17 00:00:00 2001 From: yuenmichelle1 Date: Tue, 21 May 2024 12:53:23 -0500 Subject: [PATCH 3/5] update ruby version for Gemfile --- .github/workflows/run_tests_CI.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/run_tests_CI.yml b/.github/workflows/run_tests_CI.yml index 04f7c9cf..b34e5cb9 100644 --- a/.github/workflows/run_tests_CI.yml +++ b/.github/workflows/run_tests_CI.yml @@ -28,6 +28,7 @@ jobs: - Gemfile - Gemfile.next ruby: + - 2.5 - 2.6 steps: - uses: actions/checkout@v3 From dd973ec6dae630b54dacb11c34ef784ea61c0ff6 Mon Sep 17 00:00:00 2001 From: yuenmichelle1 Date: Tue, 21 May 2024 12:57:33 -0500 Subject: [PATCH 4/5] update ci tests so excludes running 2.6 for current and excludes 2.5 run for next --- .github/workflows/run_tests_CI.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/run_tests_CI.yml b/.github/workflows/run_tests_CI.yml index b34e5cb9..aa75f1c6 100644 --- a/.github/workflows/run_tests_CI.yml +++ b/.github/workflows/run_tests_CI.yml @@ -30,6 +30,12 @@ jobs: ruby: - 2.5 - 2.6 + exclude: + - gemfile: Gemfile + ruby: 2.6 + - gemfile: Gemfile.next + ruby: 2.5 + steps: - uses: actions/checkout@v3 - name: Setup Ruby From 90f3a11c8f9ef2c24f25c7e79ef58f4546f4824d Mon Sep 17 00:00:00 2001 From: yuenmichelle1 Date: Tue, 21 May 2024 21:48:02 -0500 Subject: [PATCH 5/5] update gemfile accidental duplicates --- Gemfile | 14 ++------------ Gemfile.lock | 2 +- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/Gemfile b/Gemfile index cc853e4b..cc1348e6 100644 --- a/Gemfile +++ b/Gemfile @@ -16,28 +16,17 @@ end gem 'aws-sdk', '~> 2.3.7' gem 'faraday' gem 'faraday_middleware' -gem 'json-schema', '~> 2.8' -gem 'json-schema_builder', '~> 0.0.8' -gem 'pg', '~> 0.21' -gem 'pundit', '~> 1.1.0' -gem 'rack-cors', '~> 1.0.5' -gem 'redis', '~> 3.3.0' -gem 'restpack_serializer', git: 'https://github.com/zooniverse/restpack_serializer.git', branch: 'talk-api-version', ref: '637aaaf85e' -gem 'sidekiq', '< 6' -gem 'sidekiq-congestion', '~> 0.1.0' -gem 'sidetiq', '~> 0.7.2' gem 'honeybadger', '~> 4.5.0' gem 'json-schema', '~> 2.8' gem 'json-schema_builder', '~> 0.0.8' gem 'logstasher', '~> 0.9.0' gem 'newrelic_rpm' -gem 'zoo_stream', '~> 1.0' +gem 'pg', '~> 0.21' gem 'puma' gem 'pundit', '~> 1.1.0' gem 'rack-cors', '~> 1.0.5' gem 'redis', '~> 3.3.0' gem 'restpack_serializer', git: 'https://github.com/zooniverse/restpack_serializer.git', branch: 'talk-api-version', ref: '637aaaf85e' -gem 'schema_plus_pg_indexes', '~> 0.1.12' gem 'sidekiq', '< 6' gem 'sidekiq-congestion', '~> 0.1.0' gem 'sidetiq', '~> 0.7.2' @@ -57,6 +46,7 @@ group :test, :development do gem 'rspec-its', '~> 1.2.0' gem 'spring-commands-rspec', '~> 1.0.4' gem 'ten_years_rails' + gem 'timecop' end group :test do diff --git a/Gemfile.lock b/Gemfile.lock index 2608d4ed..9f26b453 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -313,7 +313,7 @@ GEM rest-client (>= 2.0.2) thor (1.1.0) thread_safe (0.3.6) - timecop (0.8.1) + timecop (0.9.8) timers (4.1.2) hitimes tzinfo (1.2.10)