diff --git a/Dockerfile.rails-next b/Dockerfile.rails-next new file mode 100644 index 000000000..ef77e3f01 --- /dev/null +++ b/Dockerfile.rails-next @@ -0,0 +1,40 @@ +FROM ruby:2.7-slim +WORKDIR /app + +RUN apt-get update && \ + apt-get install --no-install-recommends -y \ + build-essential \ + libpq-dev \ + nodejs \ + libjemalloc2 && \ + apt-get clean && rm -rf /var/lib/apt/lists/* + +# configure jemalloc v5 with v3 behaviours (trade ram usage over performance) +# https://twitter.com/nateberkopec/status/1442894624935137288 +# https://github.com/code-dot-org/code-dot-org/blob/5c8b24674d1c2f7e51e85dd32124e113dc423d84/cookbooks/cdo-jemalloc/attributes/default.rb#L10 +ENV MALLOC_CONF="narenas:2,background_thread:true,thp:never,dirty_decay_ms:1000,muzzy_decay_ms:0" +ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2 + +ADD ./Gemfile.next /app/ +ADD ./Gemfile.next.lock /app/ + +# ensure we use the rails-next gemfile setup to ensure we boot the upgraded libaries +ENV BUNDLE_GEMFILE=Gemfile.next + +ENV PORT=80 +ARG RAILS_ENV=production +ENV RAILS_ENV=$RAILS_ENV + +RUN bundle config --global jobs `cat /proc/cpuinfo | grep processor | wc -l | xargs -I % expr % - 1` && \ + if echo "development test" | grep -w "$RAILS_ENV"; then \ + bundle install; \ + else bundle install --without development test; fi + +ADD ./ /app + +RUN (cd /app && mkdir -p tmp/pids) +RUN (cd /app && SECRET_KEY_BASE=1 bundle exec rails assets:precompile) + +EXPOSE 80 + +CMD ["/app/docker/start-puma.sh"] diff --git a/Gemfile b/Gemfile index 121ad8ace..6e7776629 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,6 @@ +def next? + File.basename(__FILE__) == "Gemfile.next" +end source 'https://rubygems.org' git_source(:github) do |repo_name| @@ -8,7 +11,11 @@ end gem 'active_record_extended' gem 'httparty' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' -gem 'rails', '~> 5.2' +if next? + gem "rails", '~> 6.0' +else + gem 'rails', '~> 5.2' +end # Use postgresql as the database for Active Record gem 'pg', '~> 1.3' # Use Puma as the app server @@ -42,6 +49,8 @@ gem 'logstash-event' gem "sentry-raven" gem 'omniauth' gem 'omniauth-zooniverse' +# for omniauth-zooniverse +gem 'omniauth-oauth2' gem 'responders' gem 'listen', '>= 3.0.5', '< 3.8' gem 'rest-client', '> 2.0' @@ -71,13 +80,15 @@ group :development, :test do # Call 'byebug' anywhere in the code to stop execution and get a debugger console gem 'byebug', platform: [:mri, :mingw, :x64_mingw] gem 'pry-byebug' - gem 'rspec-rails', '~> 3.8' + # gem 'rspec-rails', '~> 3.8' + gem 'rspec-rails' gem 'pry-rails' gem 'webmock' gem 'spring-commands-rspec' gem 'rubocop' gem 'factory_bot_rails' gem 'rails-controller-testing' + gem 'ten_years_rails' end group :development do diff --git a/Gemfile.lock b/Gemfile.lock index aa60840de..40f491c07 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,343 +1,428 @@ GEM remote: https://rubygems.org/ specs: - actioncable (5.2.8.1) - actionpack (= 5.2.8.1) + actioncable (6.0.0) + actionpack (= 6.0.0) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailer (5.2.8.1) - actionpack (= 5.2.8.1) - actionview (= 5.2.8.1) - activejob (= 5.2.8.1) + actionmailbox (6.0.0) + actionpack (= 6.0.0) + activejob (= 6.0.0) + activerecord (= 6.0.0) + activestorage (= 6.0.0) + activesupport (= 6.0.0) + mail (>= 2.7.1) + actionmailer (6.0.0) + actionpack (= 6.0.0) + actionview (= 6.0.0) + activejob (= 6.0.0) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (5.2.8.1) - actionview (= 5.2.8.1) - activesupport (= 5.2.8.1) - rack (~> 2.0, >= 2.0.8) + actionpack (6.0.0) + actionview (= 6.0.0) + activesupport (= 6.0.0) + rack (~> 2.0) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.2.8.1) - activesupport (= 5.2.8.1) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actiontext (6.0.0) + actionpack (= 6.0.0) + activerecord (= 6.0.0) + activestorage (= 6.0.0) + activesupport (= 6.0.0) + nokogiri (>= 1.8.5) + actionview (6.0.0) + activesupport (= 6.0.0) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.3) - active_record_extended (3.1.0) - activerecord (>= 5.2, < 7.1.0) + rails-html-sanitizer (~> 1.1, >= 1.2.0) + active_record_extended (3.2.1) + activerecord (>= 5.2, < 7.2.0) pg (< 3.0) - activejob (5.2.8.1) - activesupport (= 5.2.8.1) + activejob (6.0.0) + activesupport (= 6.0.0) globalid (>= 0.3.6) - activemodel (5.2.8.1) - activesupport (= 5.2.8.1) - activerecord (5.2.8.1) - activemodel (= 5.2.8.1) - activesupport (= 5.2.8.1) - arel (>= 9.0) - activestorage (5.2.8.1) - actionpack (= 5.2.8.1) - activerecord (= 5.2.8.1) - marcel (~> 1.0.0) - activesupport (5.2.8.1) + activemodel (6.0.0) + activesupport (= 6.0.0) + activerecord (6.0.0) + activemodel (= 6.0.0) + activesupport (= 6.0.0) + activestorage (6.0.0) + actionpack (= 6.0.0) + activejob (= 6.0.0) + activerecord (= 6.0.0) + marcel (~> 0.3.1) + activesupport (6.0.0) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) - addressable (2.8.0) - public_suffix (>= 2.0.2, < 5.0) - arel (9.0.0) - ast (2.4.0) - autoprefixer-rails (9.4.7) - execjs - aws-eventstream (1.0.3) - aws-partitions (1.193.0) - aws-sdk-core (3.61.1) - aws-eventstream (~> 1.0, >= 1.0.2) - aws-partitions (~> 1.0) - aws-sigv4 (~> 1.1) - jmespath (~> 1.0) - aws-sdk-kms (1.24.0) - aws-sdk-core (~> 3, >= 3.61.1) - aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.46.0) - aws-sdk-core (~> 3, >= 3.61.1) + zeitwerk (~> 2.1, >= 2.1.8) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) + ast (2.4.3) + autoprefixer-rails (10.4.19.0) + execjs (~> 2) + aws-eventstream (1.3.2) + aws-partitions (1.1084.0) + aws-sdk-core (3.222.1) + aws-eventstream (~> 1, >= 1.3.0) + aws-partitions (~> 1, >= 1.992.0) + aws-sigv4 (~> 1.9) + base64 + jmespath (~> 1, >= 1.6.1) + logger + aws-sdk-kms (1.99.0) + aws-sdk-core (~> 3, >= 3.216.0) + aws-sigv4 (~> 1.5) + aws-sdk-s3 (1.183.0) + aws-sdk-core (~> 3, >= 3.216.0) aws-sdk-kms (~> 1) - aws-sigv4 (~> 1.1) - aws-sdk-sqs (1.20.0) - aws-sdk-core (~> 3, >= 3.61.1) - aws-sigv4 (~> 1.1) - aws-sigv4 (1.1.0) - aws-eventstream (~> 1.0, >= 1.0.2) - bindex (0.5.0) - bootsnap (1.11.1) + aws-sigv4 (~> 1.5) + aws-sdk-sqs (1.93.0) + aws-sdk-core (~> 3, >= 3.216.0) + aws-sigv4 (~> 1.5) + aws-sigv4 (1.11.0) + aws-eventstream (~> 1, >= 1.0.2) + base64 (0.2.0) + bigdecimal (3.1.9) + bindex (0.8.1) + bootsnap (1.18.4) msgpack (~> 1.2) bootstrap-sass (3.4.1) autoprefixer-rails (>= 5.2.1) sassc (>= 2.0.0) - brpoplpush-redis_script (0.1.2) + brpoplpush-redis_script (0.1.3) concurrent-ruby (~> 1.0, >= 1.0.5) - redis (>= 1.0, <= 5.0) - builder (3.2.4) + redis (>= 1.0, < 6) + builder (3.3.0) byebug (11.1.3) coderay (1.1.3) - concurrent-ruby (1.1.10) + concurrent-ruby (1.3.5) congestion (0.1.0) connection_pool (>= 2.0) redis (>= 3.1) - connection_pool (2.2.5) - crack (0.4.5) + connection_pool (2.5.0) + crack (1.0.0) + bigdecimal rexml crass (1.0.6) + csv (3.3.3) + date (3.4.1) deferred_associations (0.6.5) activerecord deprecate (0.0.0) - diff-lcs (1.3) - domain_name (0.5.20190701) - unf (>= 0.0.5, < 1.0.0) - erubi (1.11.0) - erubis (2.7.0) - execjs (2.8.1) - factory_bot (6.2.1) + diff-lcs (1.6.1) + domain_name (0.6.20240107) + erubi (1.13.1) + execjs (2.10.0) + factory_bot (6.4.5) activesupport (>= 5.0.0) - factory_bot_rails (6.2.0) - factory_bot (~> 6.2.0) + factory_bot_rails (6.4.3) + factory_bot (~> 6.4) railties (>= 5.0.0) - faraday (0.12.2) - multipart-post (>= 1.2, < 3) - faraday-panoptes (0.3.0) - faraday (~> 0.9) - faraday_middleware (~> 0.10) - faraday_middleware (0.14.0) - faraday (>= 0.7.4, < 1.0) - ffi (1.9.25) - flipper (0.16.2) - flipper-active_record (0.16.2) - activerecord (>= 3.2, < 6) - flipper (~> 0.16.2) - flipper-ui (0.16.2) - erubis (~> 2.7.0) - flipper (~> 0.16.2) - rack (>= 1.4, < 3) - rack-protection (>= 1.5.3, < 2.1.0) - globalid (1.0.1) + faraday (1.10.4) + 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.1.0) + multipart-post (~> 2.0) + faraday-net_http (1.0.2) + faraday-net_http_persistent (1.2.0) + faraday-panoptes (0.4.0) + faraday (~> 1.0) + faraday_middleware (~> 1.0) + faraday-patron (1.0.0) + faraday-rack (1.0.0) + faraday-retry (1.0.3) + faraday_middleware (1.2.1) + faraday (~> 1.0) + ffi (1.17.1-aarch64-linux-gnu) + fiber-storage (1.0.0) + flipper (1.3.4) + concurrent-ruby (< 2) + flipper-active_record (1.3.4) + activerecord (>= 4.2, < 9) + flipper (~> 1.3.4) + flipper-ui (1.3.4) + erubi (>= 1.0.0, < 2.0.0) + flipper (~> 1.3.4) + rack (>= 1.4, < 4) + rack-protection (>= 1.5.3, < 5.0.0) + rack-session (>= 1.0.2, < 3.0.0) + sanitize (< 8) + globalid (1.1.0) activesupport (>= 5.0) - graphiql-rails (1.5.0) + graphiql-rails (1.10.4) railties - sprockets-rails - graphql (1.9.9) - hashdiff (1.0.1) + graphql (2.5.2) + base64 + fiber-storage + logger + hashdiff (1.1.2) hashie (5.0.0) http-accept (1.7.0) - http-cookie (1.0.5) + http-cookie (1.0.8) domain_name (~> 0.5) - httparty (0.21.0) + httparty (0.23.1) + csv mini_mime (>= 1.0.0) multi_xml (>= 0.5.2) - i18n (1.12.0) + i18n (1.14.7) concurrent-ruby (~> 1.0) - jaro_winkler (1.5.4) - jmespath (1.6.1) - jquery-rails (4.5.0) + jmespath (1.6.2) + jquery-rails (4.6.0) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) - jsonpath (1.0.4) + json (2.10.2) + jsonpath (1.1.5) multi_json - to_regexp (~> 0.2.1) jwt (1.5.6) + language_server-protocol (3.17.0.4) + lint_roller (1.1.0) listen (3.7.1) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - lograge (0.11.2) + logger (1.7.0) + lograge (0.14.0) actionpack (>= 4) activesupport (>= 4) railties (>= 4) request_store (~> 1.0) logstash-event (1.2.02) - loofah (2.19.1) + loofah (2.24.0) crass (~> 1.0.2) - nokogiri (>= 1.5.9) - mail (2.7.1) + nokogiri (>= 1.12.0) + mail (2.8.1) mini_mime (>= 0.1.1) - marcel (1.0.2) - method_source (1.0.0) - mime-types (3.4.1) + net-imap + net-pop + net-smtp + marcel (0.3.3) + mimemagic (~> 0.3.2) + method_source (1.1.0) + mime-types (3.6.2) + logger mime-types-data (~> 3.2015) - mime-types-data (3.2022.0105) - mini_mime (1.1.2) - mini_portile2 (2.8.2) - minitest (5.17.0) - msgpack (1.5.1) - multi_json (1.13.1) + mime-types-data (3.2025.0408) + mimemagic (0.3.10) + nokogiri (~> 1) + rake + mini_mime (1.1.5) + minitest (5.25.5) + msgpack (1.8.0) + multi_json (1.15.0) multi_xml (0.6.0) - multipart-post (2.2.0) + multipart-post (2.4.1) + net-imap (0.4.19) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.2) + timeout + net-smtp (0.5.1) + net-protocol netrc (0.11.0) - newrelic_rpm (8.8.0) - nio4r (2.7.0) - nokogiri (1.15.2) - mini_portile2 (~> 2.8.2) + newrelic_rpm (9.18.0) + nio4r (2.7.4) + nokogiri (1.15.7-aarch64-linux) racc (~> 1.4) - oauth2 (1.4.0) - faraday (>= 0.8, < 0.13) - jwt (~> 1.0) - multi_json (~> 1.3) + oauth2 (2.0.9) + faraday (>= 0.17.3, < 3.0) + jwt (>= 1.0, < 3.0) multi_xml (~> 0.5) - rack (>= 1.2, < 3) - omniauth (1.9.2) + rack (>= 1.2, < 4) + snaky_hash (~> 2.0) + version_gem (~> 1.1) + omniauth (2.1.3) hashie (>= 3.4.6) - rack (>= 1.6.2, < 3) - omniauth-oauth2 (1.3.1) - oauth2 (~> 1.0) - omniauth (~> 1.2) - omniauth-zooniverse (0.0.4) - omniauth-oauth2 (= 1.3.1) + rack (>= 2.2.3) + rack-protection + omniauth-oauth2 (1.8.0) + oauth2 (>= 1.4, < 3) + omniauth (~> 2.0) + omniauth-zooniverse (0.0.3) panoptes-client (1.2.1) deprecate faraday faraday-panoptes (~> 0.3) jwt (~> 1.5.0) - parallel (1.19.1) - parser (2.7.1.2) - ast (~> 2.4.0) - pg (1.3.5) - pry (0.13.1) + parallel (1.26.3) + parser (3.3.7.4) + ast (~> 2.4.1) + racc + pg (1.5.9) + prism (1.4.0) + pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) - pry-byebug (3.9.0) + pry-byebug (3.10.1) byebug (~> 11.0) - pry (~> 0.13.0) - pry-rails (0.3.9) - pry (>= 0.10.4) - public_suffix (4.0.7) - puma (5.6.8) + pry (>= 0.13, < 0.15) + pry-rails (0.3.11) + pry (>= 0.13.0) + public_suffix (5.1.1) + puma (5.6.9) nio4r (~> 2.0) pundit (2.2.0) activesupport (>= 3.0.0) - racc (1.6.2) - rack (2.2.6.4) - rack-cors (1.1.1) + racc (1.8.1) + rack (2.2.13) + rack-cors (2.0.2) rack (>= 2.0.0) - rack-protection (2.0.8.1) - rack - rack-test (2.0.2) + rack-protection (3.2.0) + base64 (>= 0.1.0) + rack (~> 2.2, >= 2.2.4) + rack-session (1.0.2) + rack (< 3) + rack-test (2.2.0) rack (>= 1.3) - rails (5.2.8.1) - actioncable (= 5.2.8.1) - actionmailer (= 5.2.8.1) - actionpack (= 5.2.8.1) - actionview (= 5.2.8.1) - activejob (= 5.2.8.1) - activemodel (= 5.2.8.1) - activerecord (= 5.2.8.1) - activestorage (= 5.2.8.1) - activesupport (= 5.2.8.1) + rails (6.0.0) + actioncable (= 6.0.0) + actionmailbox (= 6.0.0) + actionmailer (= 6.0.0) + actionpack (= 6.0.0) + actiontext (= 6.0.0) + actionview (= 6.0.0) + activejob (= 6.0.0) + activemodel (= 6.0.0) + activerecord (= 6.0.0) + activestorage (= 6.0.0) + activesupport (= 6.0.0) bundler (>= 1.3.0) - railties (= 5.2.8.1) + railties (= 6.0.0) sprockets-rails (>= 2.0.0) - rails-controller-testing (1.0.4) - actionpack (>= 5.0.1.x) - actionview (>= 5.0.1.x) - activesupport (>= 5.0.1.x) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.4.4) - loofah (~> 2.19, >= 2.19.1) - railties (5.2.8.1) - actionpack (= 5.2.8.1) - activesupport (= 5.2.8.1) + rails-html-sanitizer (1.6.2) + loofah (~> 2.21) + nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) + railties (6.0.0) + actionpack (= 6.0.0) + activesupport (= 6.0.0) method_source rake (>= 0.8.7) - thor (>= 0.19.0, < 2.0) - rainbow (3.0.0) - rake (13.0.6) - ranked-model (0.4.8) - activerecord (>= 4.2) - rb-fsevent (0.11.0) - rb-inotify (0.10.1) + thor (>= 0.20.3, < 2.0) + rainbow (3.1.1) + rake (13.2.1) + ranked-model (0.4.11) + activerecord (>= 5.2) + rb-fsevent (0.11.2) + rb-inotify (0.11.1) ffi (~> 1.0) - redis (4.5.1) - request_store (1.4.1) + redis (4.8.1) + redlock (1.3.2) + redis (>= 3.0.0, < 6.0) + regexp_parser (2.10.0) + request_store (1.7.0) rack (>= 1.4) - responders (3.0.1) - actionpack (>= 5.0) - railties (>= 5.0) + responders (3.1.1) + actionpack (>= 5.2) + railties (>= 5.2) 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.5) - rspec-core (3.8.0) - rspec-support (~> 3.8.0) - rspec-expectations (3.8.2) + rexml (3.4.1) + rspec-core (3.13.3) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.3) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.8.0) - rspec-mocks (3.8.0) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.2) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.8.0) - rspec-rails (3.8.2) - actionpack (>= 3.0) - activesupport (>= 3.0) - railties (>= 3.0) - rspec-core (~> 3.8.0) - rspec-expectations (~> 3.8.0) - rspec-mocks (~> 3.8.0) - rspec-support (~> 3.8.0) - rspec-support (3.8.0) - rubocop (0.82.0) - jaro_winkler (~> 1.5.1) + rspec-support (~> 3.13.0) + rspec-rails (5.1.2) + actionpack (>= 5.2) + activesupport (>= 5.2) + railties (>= 5.2) + rspec-core (~> 3.10) + rspec-expectations (~> 3.10) + rspec-mocks (~> 3.10) + rspec-support (~> 3.10) + rspec-support (3.13.2) + rubocop (1.75.2) + json (~> 2.3) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.1.0) parallel (~> 1.10) - parser (>= 2.7.0.1) + parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) - rexml + regexp_parser (>= 2.9.3, < 3.0) + rubocop-ast (>= 1.44.0, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 2.0) - ruby-progressbar (1.10.1) - sass (3.7.2) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.44.0) + parser (>= 3.3.7.2) + prism (~> 1.4) + ruby-progressbar (1.13.0) + ruby2_keywords (0.0.5) + sanitize (6.1.3) + crass (~> 1.0.2) + nokogiri (>= 1.12.0) + sass (3.7.4) sass-listen (~> 4.0.0) sass-listen (4.0.0) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) - sass-rails (5.0.7) - railties (>= 4.0.0, < 6) + sass-rails (5.1.0) + railties (>= 5.2.0) sass (~> 3.1) sprockets (>= 2.8, < 4.0) sprockets-rails (>= 2.0, < 4.0) tilt (>= 1.1, < 3) - sassc (2.0.0) - ffi (~> 1.9.6) - rake - sentry-raven (2.13.0) - faraday (>= 0.7.6, < 1.0) - sidekiq (5.2.10) - connection_pool (~> 2.2, >= 2.2.2) + sassc (2.4.0) + ffi (~> 1.9) + sentry-raven (3.1.2) + faraday (>= 1.0) + sidekiq (6.5.12) + connection_pool (>= 2.2.5, < 3) rack (~> 2.0) - rack-protection (>= 1.5.0) - redis (~> 4.5, < 4.6.0) + redis (>= 4.5.0, < 5) sidekiq-congestion (0.1.1) congestion (~> 0.1) sidekiq (>= 3.0) - sidekiq-logstash (1.2.0) + sidekiq-logstash (2.0.3) logstash-event (~> 1.2) - sidekiq (>= 3.0, < 6) - sidekiq-unique-jobs (7.1.5) + sidekiq (>= 6.0, < 7) + sidekiq-unique-jobs (7.1.33) brpoplpush-redis_script (> 0.1.1, <= 2.0.0) concurrent-ruby (~> 1.0, >= 1.0.5) + redis (< 5.0) sidekiq (>= 5.0, < 7.0) - thor (>= 0.20, < 2.0) - simple_form (5.0.0) - actionpack (>= 5.0) - activemodel (>= 5.0) - spring (2.1.0) + thor (>= 0.20, < 3.0) + simple_form (5.3.1) + actionpack (>= 5.2) + activemodel (>= 5.2) + snaky_hash (2.0.1) + hashie + version_gem (~> 1.1, >= 1.1.1) + spring (2.1.1) spring-commands-rspec (1.0.4) spring (>= 0.9.1) spring-watcher-listen (2.0.1) listen (>= 2.7, < 4.0) spring (>= 1.2, < 3.0) - sprockets (3.7.2) + sprockets (3.7.5) + base64 concurrent-ruby (~> 1.0) rack (> 1, < 3) sprockets-rails (3.4.2) @@ -347,33 +432,38 @@ GEM stoplight (2.2.1) strong_migrations (0.4.1) activerecord (>= 5) + ten_years_rails (1.0.2) + actionview (~> 5.2.3) + rainbow (~> 3.0.0) thor (1.2.1) thread_safe (0.3.6) - tilt (2.0.8) - to_regexp (0.2.1) - tzinfo (1.2.10) + tilt (2.6.0) + timeout (0.4.3) + tzinfo (1.2.11) thread_safe (~> 0.1) - uglifier (4.2.0) + uglifier (4.2.1) execjs (>= 0.3.0, < 3) - unf (0.1.4) - unf_ext - unf_ext (0.0.8.2) - unicode-display_width (1.7.0) - web-console (3.7.0) - actionview (>= 5.0) - activemodel (>= 5.0) + unicode-display_width (3.1.4) + unicode-emoji (~> 4.0, >= 4.0.4) + unicode-emoji (4.0.4) + version_gem (1.1.6) + web-console (4.2.1) + actionview (>= 6.0.0) + activemodel (>= 6.0.0) bindex (>= 0.4.0) - railties (>= 5.0) - webmock (3.14.0) + railties (>= 6.0.0) + webmock (3.25.1) addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) - websocket-driver (0.7.5) + websocket-driver (0.7.7) + base64 websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) + zeitwerk (2.6.18) PLATFORMS - ruby + aarch64-linux DEPENDENCIES active_record_extended @@ -397,6 +487,7 @@ DEPENDENCIES logstash-event newrelic_rpm omniauth + omniauth-oauth2 omniauth-zooniverse panoptes-client (~> 1.2) pg (~> 1.3) @@ -405,12 +496,11 @@ DEPENDENCIES puma (~> 5.6) pundit (~> 2.2.0) rack-cors - rails (~> 5.2) - rails-controller-testing + rails (= 6.0) ranked-model responders rest-client (> 2.0) - rspec-rails (~> 3.8) + rspec-rails rubocop sass-rails (~> 5.0) sentry-raven @@ -424,6 +514,7 @@ DEPENDENCIES spring-watcher-listen (~> 2.0.0) stoplight strong_migrations + ten_years_rails tzinfo-data uglifier (>= 1.3.0) web-console (>= 3.3.0) diff --git a/Gemfile.next b/Gemfile.next new file mode 120000 index 000000000..6ab79009c --- /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 000000000..cf3c81605 --- /dev/null +++ b/Gemfile.next.lock @@ -0,0 +1,527 @@ +GEM + remote: https://rubygems.org/ + specs: + actioncable (6.1.7.10) + actionpack (= 6.1.7.10) + activesupport (= 6.1.7.10) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + actionmailbox (6.1.7.10) + actionpack (= 6.1.7.10) + activejob (= 6.1.7.10) + activerecord (= 6.1.7.10) + activestorage (= 6.1.7.10) + activesupport (= 6.1.7.10) + mail (>= 2.7.1) + actionmailer (6.1.7.10) + actionpack (= 6.1.7.10) + actionview (= 6.1.7.10) + activejob (= 6.1.7.10) + activesupport (= 6.1.7.10) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 2.0) + actionpack (6.1.7.10) + actionview (= 6.1.7.10) + activesupport (= 6.1.7.10) + rack (~> 2.0, >= 2.0.9) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actiontext (6.1.7.10) + actionpack (= 6.1.7.10) + activerecord (= 6.1.7.10) + activestorage (= 6.1.7.10) + activesupport (= 6.1.7.10) + nokogiri (>= 1.8.5) + actionview (6.1.7.10) + activesupport (= 6.1.7.10) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.1, >= 1.2.0) + active_record_extended (3.2.1) + activerecord (>= 5.2, < 7.2.0) + pg (< 3.0) + activejob (6.1.7.10) + activesupport (= 6.1.7.10) + globalid (>= 0.3.6) + activemodel (6.1.7.10) + activesupport (= 6.1.7.10) + activerecord (6.1.7.10) + activemodel (= 6.1.7.10) + activesupport (= 6.1.7.10) + activestorage (6.1.7.10) + actionpack (= 6.1.7.10) + activejob (= 6.1.7.10) + activerecord (= 6.1.7.10) + activesupport (= 6.1.7.10) + marcel (~> 1.0) + mini_mime (>= 1.1.0) + activesupport (6.1.7.10) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + zeitwerk (~> 2.3) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) + ast (2.4.3) + autoprefixer-rails (10.4.21.0) + execjs (~> 2) + aws-eventstream (1.3.2) + aws-partitions (1.1086.0) + aws-sdk-core (3.222.1) + aws-eventstream (~> 1, >= 1.3.0) + aws-partitions (~> 1, >= 1.992.0) + aws-sigv4 (~> 1.9) + base64 + jmespath (~> 1, >= 1.6.1) + logger + aws-sdk-kms (1.99.0) + aws-sdk-core (~> 3, >= 3.216.0) + aws-sigv4 (~> 1.5) + aws-sdk-s3 (1.183.0) + aws-sdk-core (~> 3, >= 3.216.0) + aws-sdk-kms (~> 1) + aws-sigv4 (~> 1.5) + aws-sdk-sqs (1.93.0) + aws-sdk-core (~> 3, >= 3.216.0) + aws-sigv4 (~> 1.5) + aws-sigv4 (1.11.0) + aws-eventstream (~> 1, >= 1.0.2) + base64 (0.2.0) + bigdecimal (3.1.9) + bindex (0.8.1) + bootsnap (1.18.4) + msgpack (~> 1.2) + bootstrap-sass (3.4.1) + autoprefixer-rails (>= 5.2.1) + sassc (>= 2.0.0) + brpoplpush-redis_script (0.1.3) + concurrent-ruby (~> 1.0, >= 1.0.5) + redis (>= 1.0, < 6) + builder (3.3.0) + byebug (11.1.3) + coderay (1.1.3) + colorize (1.1.0) + concurrent-ruby (1.3.5) + congestion (0.1.0) + connection_pool (>= 2.0) + redis (>= 3.1) + connection_pool (2.5.0) + crack (1.0.0) + bigdecimal + rexml + crass (1.0.6) + csv (3.3.4) + date (3.4.1) + deferred_associations (0.6.5) + activerecord + deprecate (0.0.0) + diff-lcs (1.6.1) + domain_name (0.6.20240107) + erubi (1.13.1) + execjs (2.10.0) + factory_bot (6.4.5) + activesupport (>= 5.0.0) + factory_bot_rails (6.4.3) + factory_bot (~> 6.4) + railties (>= 5.0.0) + faraday (1.10.4) + 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.1.0) + multipart-post (~> 2.0) + faraday-net_http (1.0.2) + faraday-net_http_persistent (1.2.0) + faraday-panoptes (0.4.0) + faraday (~> 1.0) + faraday_middleware (~> 1.0) + faraday-patron (1.0.0) + faraday-rack (1.0.0) + faraday-retry (1.0.3) + faraday_middleware (1.2.1) + faraday (~> 1.0) + ffi (1.17.1-aarch64-linux-gnu) + fiber-storage (1.0.0) + flipper (1.3.4) + concurrent-ruby (< 2) + flipper-active_record (1.3.4) + activerecord (>= 4.2, < 9) + flipper (~> 1.3.4) + flipper-ui (1.3.4) + erubi (>= 1.0.0, < 2.0.0) + flipper (~> 1.3.4) + rack (>= 1.4, < 4) + rack-protection (>= 1.5.3, < 5.0.0) + rack-session (>= 1.0.2, < 3.0.0) + sanitize (< 8) + globalid (1.2.1) + activesupport (>= 6.1) + graphiql-rails (1.10.4) + railties + graphql (2.5.2) + base64 + fiber-storage + logger + hashdiff (1.1.2) + hashie (5.0.0) + http-accept (1.7.0) + http-cookie (1.0.8) + domain_name (~> 0.5) + httparty (0.23.1) + csv + mini_mime (>= 1.0.0) + multi_xml (>= 0.5.2) + i18n (1.14.7) + concurrent-ruby (~> 1.0) + jmespath (1.6.2) + jquery-rails (4.6.0) + rails-dom-testing (>= 1, < 3) + railties (>= 4.2.0) + thor (>= 0.14, < 2.0) + json (2.10.2) + jsonpath (1.1.5) + multi_json + jwt (1.5.6) + language_server-protocol (3.17.0.4) + lint_roller (1.1.0) + listen (3.7.1) + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) + logger (1.7.0) + lograge (0.14.0) + actionpack (>= 4) + activesupport (>= 4) + railties (>= 4) + request_store (~> 1.0) + logstash-event (1.2.02) + loofah (2.24.0) + crass (~> 1.0.2) + nokogiri (>= 1.12.0) + mail (2.8.1) + mini_mime (>= 0.1.1) + net-imap + net-pop + net-smtp + marcel (1.0.4) + method_source (1.1.0) + mime-types (3.6.2) + logger + mime-types-data (~> 3.2015) + mime-types-data (3.2025.0408) + mini_mime (1.1.5) + minitest (5.25.5) + msgpack (1.8.0) + multi_json (1.15.0) + multi_xml (0.6.0) + multipart-post (2.4.1) + net-imap (0.4.19) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.2) + timeout + net-smtp (0.5.1) + net-protocol + netrc (0.11.0) + newrelic_rpm (9.18.0) + nio4r (2.7.4) + nokogiri (1.15.7-aarch64-linux) + racc (~> 1.4) + oauth2 (1.4.11) + faraday (>= 0.17.3, < 3.0) + jwt (>= 1.0, < 3.0) + multi_json (~> 1.3) + multi_xml (~> 0.5) + rack (>= 1.2, < 4) + omniauth (1.9.2) + hashie (>= 3.4.6) + rack (>= 1.6.2, < 3) + omniauth-oauth2 (1.3.1) + oauth2 (~> 1.0) + omniauth (~> 1.2) + omniauth-zooniverse (0.0.4) + omniauth-oauth2 (= 1.3.1) + panoptes-client (1.2.1) + deprecate + faraday + faraday-panoptes (~> 0.3) + jwt (~> 1.5.0) + parallel (1.26.3) + parser (3.3.7.4) + ast (~> 2.4.1) + racc + pg (1.5.9) + prism (1.4.0) + pry (0.14.2) + coderay (~> 1.1) + method_source (~> 1.0) + pry-byebug (3.10.1) + byebug (~> 11.0) + pry (>= 0.13, < 0.15) + pry-rails (0.3.11) + pry (>= 0.13.0) + public_suffix (5.1.1) + puma (5.6.9) + nio4r (~> 2.0) + pundit (2.2.0) + activesupport (>= 3.0.0) + racc (1.8.1) + rack (2.2.13) + rack-cors (2.0.2) + rack (>= 2.0.0) + rack-protection (3.2.0) + base64 (>= 0.1.0) + rack (~> 2.2, >= 2.2.4) + rack-session (1.0.2) + rack (< 3) + rack-test (2.2.0) + rack (>= 1.3) + rails (6.1.7.10) + actioncable (= 6.1.7.10) + actionmailbox (= 6.1.7.10) + actionmailer (= 6.1.7.10) + actionpack (= 6.1.7.10) + actiontext (= 6.1.7.10) + actionview (= 6.1.7.10) + activejob (= 6.1.7.10) + activemodel (= 6.1.7.10) + activerecord (= 6.1.7.10) + activestorage (= 6.1.7.10) + activesupport (= 6.1.7.10) + bundler (>= 1.15.0) + railties (= 6.1.7.10) + sprockets-rails (>= 2.0.0) + rails-controller-testing (1.0.5) + actionpack (>= 5.0.1.rc1) + actionview (>= 5.0.1.rc1) + activesupport (>= 5.0.1.rc1) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest + nokogiri (>= 1.6) + rails-html-sanitizer (1.6.2) + loofah (~> 2.21) + nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) + railties (6.1.7.10) + actionpack (= 6.1.7.10) + activesupport (= 6.1.7.10) + method_source + rake (>= 12.2) + thor (~> 1.0) + rainbow (3.1.1) + rake (13.2.1) + ranked-model (0.4.11) + activerecord (>= 5.2) + rb-fsevent (0.11.2) + rb-inotify (0.11.1) + ffi (~> 1.0) + redis (4.8.1) + redlock (1.3.2) + redis (>= 3.0.0, < 6.0) + regexp_parser (2.10.0) + request_store (1.7.0) + rack (>= 1.4) + responders (3.1.1) + actionpack (>= 5.2) + railties (>= 5.2) + 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.4.1) + rspec-core (3.9.3) + rspec-support (~> 3.9.3) + rspec-expectations (3.9.4) + 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 (3.9.1) + actionpack (>= 3.0) + activesupport (>= 3.0) + railties (>= 3.0) + rspec-core (~> 3.9.0) + rspec-expectations (~> 3.9.0) + rspec-mocks (~> 3.9.0) + rspec-support (~> 3.9.0) + rspec-support (3.9.4) + rubocop (1.75.2) + json (~> 2.3) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.1.0) + parallel (~> 1.10) + parser (>= 3.3.0.2) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 2.9.3, < 3.0) + rubocop-ast (>= 1.44.0, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.44.1) + parser (>= 3.3.7.2) + prism (~> 1.4) + ruby-progressbar (1.13.0) + ruby2_keywords (0.0.5) + sanitize (6.1.3) + crass (~> 1.0.2) + nokogiri (>= 1.12.0) + sass (3.7.4) + sass-listen (~> 4.0.0) + sass-listen (4.0.0) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + sass-rails (5.1.0) + railties (>= 5.2.0) + sass (~> 3.1) + sprockets (>= 2.8, < 4.0) + sprockets-rails (>= 2.0, < 4.0) + tilt (>= 1.1, < 3) + sassc (2.4.0) + ffi (~> 1.9) + sentry-raven (3.1.2) + faraday (>= 1.0) + sidekiq (6.5.12) + connection_pool (>= 2.2.5, < 3) + rack (~> 2.0) + redis (>= 4.5.0, < 5) + sidekiq-congestion (0.1.1) + congestion (~> 0.1) + sidekiq (>= 3.0) + sidekiq-logstash (2.0.3) + logstash-event (~> 1.2) + sidekiq (>= 6.0, < 7) + sidekiq-unique-jobs (7.1.33) + brpoplpush-redis_script (> 0.1.1, <= 2.0.0) + concurrent-ruby (~> 1.0, >= 1.0.5) + redis (< 5.0) + sidekiq (>= 5.0, < 7.0) + thor (>= 0.20, < 3.0) + simple_form (5.3.1) + actionpack (>= 5.2) + activemodel (>= 5.2) + spring (2.1.1) + spring-commands-rspec (1.0.4) + spring (>= 0.9.1) + spring-watcher-listen (2.0.1) + listen (>= 2.7, < 4.0) + spring (>= 1.2, < 3.0) + sprockets (3.7.5) + base64 + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.5.2) + actionpack (>= 6.1) + activesupport (>= 6.1) + sprockets (>= 3.0.0) + stoplight (3.0.2) + redlock (~> 1.0) + strong_migrations (1.8.0) + activerecord (>= 5.2) + ten_years_rails (0.2.0) + actionview + activesupport + colorize (>= 0.8.1) + rest-client (>= 2.0.2) + thor (1.3.2) + tilt (2.6.0) + timeout (0.4.3) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + uglifier (4.2.1) + execjs (>= 0.3.0, < 3) + unicode-display_width (3.1.4) + unicode-emoji (~> 4.0, >= 4.0.4) + unicode-emoji (4.0.4) + web-console (4.2.1) + actionview (>= 6.0.0) + activemodel (>= 6.0.0) + bindex (>= 0.4.0) + railties (>= 6.0.0) + webmock (3.25.1) + addressable (>= 2.8.0) + crack (>= 0.3.2) + hashdiff (>= 0.4.0, < 2.0.0) + websocket-driver (0.7.7) + base64 + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) + zeitwerk (2.6.18) + +PLATFORMS + aarch64-linux + +DEPENDENCIES + active_record_extended + aws-sdk-s3 + aws-sdk-sqs + bootsnap (>= 1.1.0) + bootstrap-sass (~> 3.4.1) + byebug + deferred_associations + factory_bot_rails + flipper + flipper-active_record + flipper-ui + graphiql-rails + graphql + httparty + jquery-rails + jsonpath + listen (>= 3.0.5, < 3.8) + lograge + logstash-event + newrelic_rpm + omniauth + omniauth-oauth2 + omniauth-zooniverse + panoptes-client (~> 1.2) + pg (~> 1.3) + pry-byebug + pry-rails + puma (~> 5.6) + pundit (~> 2.2.0) + rack-cors + rails (~> 6.0) + rails-controller-testing + ranked-model + responders + rest-client (> 2.0) + rspec-rails + rubocop + sass-rails (~> 5.0) + sentry-raven + sidekiq + sidekiq-congestion (~> 0.1.0) + sidekiq-logstash + sidekiq-unique-jobs (~> 7.1.0) + simple_form + spring + spring-commands-rspec + spring-watcher-listen (~> 2.0.0) + stoplight + strong_migrations + ten_years_rails + tzinfo-data + uglifier (>= 1.3.0) + web-console (>= 3.3.0) + webmock + +BUNDLED WITH + 2.3.22 diff --git a/app/graphql/caesar_schema.rb b/app/graphql/caesar_schema.rb index 7f7f8db93..3a6cae7e8 100644 --- a/app/graphql/caesar_schema.rb +++ b/app/graphql/caesar_schema.rb @@ -1,4 +1,4 @@ -CaesarSchema = GraphQL::Schema.define do - query(QueryRoot) - mutation(MutationRoot) -end +class CaesarSchema < GraphQL::Schema + query(Types::QueryRoot) + mutation(Types::MutationRoot) +end \ No newline at end of file diff --git a/app/graphql/types/action_status.rb b/app/graphql/types/action_status.rb new file mode 100644 index 000000000..33c107ce8 --- /dev/null +++ b/app/graphql/types/action_status.rb @@ -0,0 +1,11 @@ +# app/graphql/types/action_status.rb +module Types + class ActionStatus < GraphQL::Schema::Enum + graphql_name 'ActionStatus' + description 'Status of a pending or performed action' + + value 'pending', 'Action is not performed yet' + value 'completed', 'Action has been performed successfully' + value 'failed', 'Action failed even after retries' + end +end diff --git a/app/graphql/types/action_status_type.rb b/app/graphql/types/action_status_type.rb index 74a7a4778..33c107ce8 100644 --- a/app/graphql/types/action_status_type.rb +++ b/app/graphql/types/action_status_type.rb @@ -1,8 +1,11 @@ -Types::ActionStatusType = GraphQL::EnumType.define do - name "ActionStatus" - description "Status of a pending or performed action" +# app/graphql/types/action_status.rb +module Types + class ActionStatus < GraphQL::Schema::Enum + graphql_name 'ActionStatus' + description 'Status of a pending or performed action' - value("pending", "Action is not performed yet") - value("completed", "Action has been performed successfully") - value("failed", "Action failed even after retries") + value 'pending', 'Action is not performed yet' + value 'completed', 'Action has been performed successfully' + value 'failed', 'Action failed even after retries' + end end diff --git a/app/graphql/types/credential.rb b/app/graphql/types/credential.rb new file mode 100644 index 000000000..48220adec --- /dev/null +++ b/app/graphql/types/credential.rb @@ -0,0 +1,9 @@ +# app/graphql/types/credential_type.rb +module Types + class Credential < GraphQL::Schema::Object + graphql_name 'Credential' + + field 'isLoggedIn', Boolean, null: false, method: :logged_in? + field 'isAdmin', Boolean, null: false, method: :admin? + end +end diff --git a/app/graphql/types/data_request.rb b/app/graphql/types/data_request.rb new file mode 100644 index 000000000..25c1577f3 --- /dev/null +++ b/app/graphql/types/data_request.rb @@ -0,0 +1,12 @@ +# app/graphql/types/data_request.rb +module Types + class DataRequest < GraphQL::Schema::Object + graphql_name 'DataRequest' + + field 'id', ID, null: false + field 'subgroup', String, null: true + field 'requestedData', Enums::DataRequestRequestedData, null: true, method: :requested_data + field 'url', String, null: true + field 'status', Enums::DataRequestStatus, null: false + end + end diff --git a/app/graphql/types/enums/data_request_requested_data.rb b/app/graphql/types/enums/data_request_requested_data.rb new file mode 100644 index 000000000..1f7c97335 --- /dev/null +++ b/app/graphql/types/enums/data_request_requested_data.rb @@ -0,0 +1,14 @@ +# app/graphql/types/enums/data_request_requested_data.rb +module Types + module Enums + class DataRequestRequestedData < GraphQL::Schema::Enum + graphql_name 'RequestedData' + description 'What type of data is requested' + + value 'extracts', 'Extracts' + value 'reductions', 'Reductions' + value 'subject_reductions', 'Subject Reductions' + value 'user_reductions', 'User Reductions' + end + end +end diff --git a/app/graphql/types/enums/data_request_status.rb b/app/graphql/types/enums/data_request_status.rb new file mode 100644 index 000000000..59a7f6248 --- /dev/null +++ b/app/graphql/types/enums/data_request_status.rb @@ -0,0 +1,17 @@ +# app/graphql/types/enums/data_request_status_enum.rb +module Types + module Enums + class DataRequestStatus < GraphQL::Schema::Enum + graphql_name 'Status' + description 'What is the status of this request' + + value 'empty', 'Nothing to export' + value 'pending', 'Request is in the queue to be processed' + value 'processing', 'Servers are currently exporting this data' + value 'failed', 'Something went wrong while exporting' + value 'complete', 'This export is ready to download' + value 'canceling', 'This export is being canceled' + value 'canceled', 'This export has been canceled' + end + end +end diff --git a/app/graphql/types/extract.rb b/app/graphql/types/extract.rb new file mode 100644 index 000000000..c0092f2e0 --- /dev/null +++ b/app/graphql/types/extract.rb @@ -0,0 +1,19 @@ +# app/graphql/types/extract_type.rb +module Types + class Extract < GraphQL::Schema::Object + graphql_name 'Extract' + + field 'classificationId', String, null: true, method: :classification_id + field 'classificationAt', Types::TimeType, null: true, method: :classification_at + + field 'workflowId', ID, null: false, method: :workflow_id + field 'subjectId', ID, null: false, method: :subject_id + field 'extractorKey', String, null: false, method: :extractor_key + field 'userId', ID, null: true, method: :user_id + + field 'data', Types::JsonType, null: true + + field 'createdAt', Types::TimeType, null: false, method: :created_at + field 'updatedAt', Types::TimeType, null: false, method: :updated_at + end + end diff --git a/app/graphql/types/json_type.rb b/app/graphql/types/json_type.rb index 8a947454f..24d1f0f80 100644 --- a/app/graphql/types/json_type.rb +++ b/app/graphql/types/json_type.rb @@ -1,9 +1,16 @@ require 'json' -Types::JsonType = GraphQL::ScalarType.define do - name "JsonType" - description "Arbitrary JSON object" +# app/graphql/types/json_type.rb +module Types + class JsonType < GraphQL::Schema::Scalar + description 'Arbitrary JSON object' - coerce_input ->(value, ctx) { value } - coerce_result ->(value, ctx) { value } + def self.coerce_input(value, _context) + value + end + + def self.coerce_result(value, _context) + value + end + end end diff --git a/app/graphql/types/mutation_root.rb b/app/graphql/types/mutation_root.rb new file mode 100644 index 000000000..0c5f2964b --- /dev/null +++ b/app/graphql/types/mutation_root.rb @@ -0,0 +1,91 @@ +# # app/graphql/types/mutation_root.rb +module Types + class MutationRoot < GraphQL::Schema::Object + graphql_name 'MutationRoot' + + field :create_data_request, Types::DataRequest, null: false, + description: 'Creates a new DataRequest with the specified filters. Poll for new state and when marked COMPLETE, the url property will have a link to the downloadable export file.' do + argument :exportable_id, ID, required: true + argument :exportable_type, ID, required: true + argument :requested_data, Enums::DataRequestRequestedData, required: false + argument :subgroup, String, required: false + argument :user_id, Integer, required: false + end + + def create_data_request(exportable_id:, exportable_type:, requested_data: nil, subgroup: nil, user_id: nil) + CreatesDataRequests.graphql.call(object, { + exportableId: exportable_id, + exportableType: exportable_type, + requestedData: requested_data, + subgroup: subgroup, + userId: user_id + }, context) + end + + field :upsert_extract, Types::Extract, null: false, + description: 'Creates/updates the data for an extract. Triggers evaluation of reductions and then rules afterwards (asynchronously).' do + argument :workflow_id, ID, required: true + argument :subject_id, ID, required: true + argument :classification_id, ID, required: true + argument :extractor_key, String, required: true + argument :data, Types::JsonType, required: false + end + + def upsert_extract(workflow_id:, subject_id:, classification_id:, extractor_key:, data: nil) + workflow = Workflow.accessible_by(context[:credential]).find(workflow_id) + subject = Subject.find(subject_id) + extractor = workflow.extractors[extractor_key] + extract = Extract.find_or_initialize_by( + workflow_id: workflow.id, + extractor_id: extractor.id, + classificationId: classification_id, + subject_id: subject.id + ) + extract.update!(data: data) + extract + end + + field :upsert_reduction, Types::SubjectReduction, null: false, + description: 'Creates/updates the data for a reduction. Triggers evaluation of the workflow rules afterwards (asynchronously).' do + argument :workflow_id, ID, required: true + argument :subject_id, ID, required: true + argument :reducer_key, String, required: true + argument :data, Types::JsonType, required: false + end + + def upsert_reduction(workflow_id:, subject_id:, reducer_key:, data: nil) + workflow = Workflow.accessible_by(context[:credential]).find(workflow_id) + subject = Subject.find(subject_id) + reducer = workflow.reducers[reducer_key] + reduction = SubjectReduction.find_or_initialize_by( + workflow_id: workflow.id, + reducer_id: reducer.id, + subject_id: subject.id + ) + reduction.update!(data: data) + reduction + end + + field :extract_subject, Boolean, null: false, + description: 'Forces a re-evaluation of extracts (and subsequently reducers and rules) for a subject. + This works by fetching a complete list of classifications for the specified subject, + and then extracting, reducing and applying the rules on it. This means that any data + inconsistencies should get cleared up by running this, and that it should be idempotent. + + This runs asynchronously. Returns true if a job was enqueued. Returns false if no job + was enqueued, typically this happens when one was already pending.' do + argument :workflow_id, ID, required: true + argument :subject_id, ID, required: true + end + + def extract_subject(workflow_id:, subject_id:) + workflow = Workflow.accessible_by(context[:credential]).find(workflow_id) + subject = Subject.find(subject_id) + !!FetchClassificationsWorker.perform_async( + workflow.id, + subject.id, + FetchClassificationsWorker.fetch_for_subject + ) + end + end +end diff --git a/app/graphql/types/query_root.rb b/app/graphql/types/query_root.rb new file mode 100644 index 000000000..673af9f82 --- /dev/null +++ b/app/graphql/types/query_root.rb @@ -0,0 +1,26 @@ +# app/graphql/types/query_root.rb +module Types + class QueryRoot < GraphQL::Schema::Object + graphql_name 'QueryRoot' + + field :me, Types::Credential, null: true do + description 'Returns the current credential.' + end + + def me + context[:credential] + end + + field :workflow, Types::Workflow, null: true, + description: 'Find a Workflow by ID' do + argument :id, ID, required: true + end + + def workflow(id:) + Workflow.accessible_by(context[:credential]) + .or(Workflow.where(public_extracts: true)) + .or(Workflow.where(public_reductions: true)) + .find(id) + end + end + end diff --git a/app/graphql/types/subject_action.rb b/app/graphql/types/subject_action.rb new file mode 100644 index 000000000..4bef82edf --- /dev/null +++ b/app/graphql/types/subject_action.rb @@ -0,0 +1,23 @@ +# app/graphql/types/subject_action.rb +module Types + class SubjectAction < GraphQL::Schema::Object + graphql_name 'SubjectAction' + + field 'id', ID, null: false + + field 'classificationId', String, null: true, method: :classification_id + field 'classificationAt', Types::TimeType, null: true, method: :classification_at + + field 'workflowId', ID, null: false, method: :workflow_id + field 'subjectId', ID, null: false, method: :subject_id + field 'effectType', String, null: false, method: :effect_type + field 'status', Types::ActionStatusType, null: false + + field 'config', Types::JsonType, null: true + + field 'createdAt', Types::TimeType, null: false, method: :created_at + field 'updatedAt', Types::TimeType, null: false, method: :updated_at + field 'attemptedAt', Types::TimeType, null: true, method: :attempted_at + field 'completedAt', Types::TimeType, null: true, method: :completed_at + end +end diff --git a/app/graphql/types/subject_reduction.rb b/app/graphql/types/subject_reduction.rb new file mode 100644 index 000000000..4912fb946 --- /dev/null +++ b/app/graphql/types/subject_reduction.rb @@ -0,0 +1,14 @@ +# app/graphql/types/subject_reduction_type.rb +module Types + class SubjectReduction < GraphQL::Schema::Object + graphql_name 'SubjectReduction' + + field 'projectId', ID, null: true, method: :project_id + field 'workflowId', ID, null: false, method: :workflow_id + field 'subjectId', ID, null: false, method: :subject_id + field 'reducerKey', String, null: true, method: :reducer_key + field 'data', Types::JsonType, null: true + field 'createdAt', Types::TimeType, null: false, method: :created_at + field 'updatedAt', Types::TimeType, null: false, method: :updated_at + end + end diff --git a/app/graphql/types/time_type.rb b/app/graphql/types/time_type.rb index fa3e0b304..332a1c9cd 100644 --- a/app/graphql/types/time_type.rb +++ b/app/graphql/types/time_type.rb @@ -1,7 +1,13 @@ -Types::TimeType = GraphQL::ScalarType.define do - name "Time" - description "Time since epoch in seconds (aka UNIX timestamp)." +module Types + class TimeType < GraphQL::Schema::Scalar + description 'Time since epoch in seconds (aka UNIX timestamp).' - coerce_input ->(value, ctx) { Time.at(Float(value)) } - coerce_result ->(value, ctx) { value.to_f } + def self.coerce_input(value, _context) + Time.at(Float(value)) + end + + def self.coerce_result(value, _context) + value.to_f + end + end end diff --git a/app/graphql/types/user_action.rb b/app/graphql/types/user_action.rb new file mode 100644 index 000000000..91a46e1bc --- /dev/null +++ b/app/graphql/types/user_action.rb @@ -0,0 +1,23 @@ +# app/graphql/types/user_action_type.rb +module Types + class UserAction < GraphQL::Schema::Object + graphql_name 'UserAction' + + field 'id', ID, null: false + + field 'classificationId', String, null: true, method: :classification_id + field 'classificationAt', Types::TimeType, null: true, method: :classification_at + + field 'workflowId', ID, null: false, method: :workflow_id + field 'userId', ID, null: false, method: :subject_id + field 'effectType', String, null: false, method: :effect_type + field 'status', Types::ActionStatus, null: false + + field 'config', Types::JsonType, null: true + + field 'createdAt', Types::TimeType, null: false, method: :created_at + field 'updatedAt', Types::TimeType, null: false, method: :updated_at + field 'attemptedAt', Types::TimeType, null: true, method: :attempted_at + field 'completedAt', Types::TimeType, null: true, method: :completed_at + end + end diff --git a/app/graphql/types/user_reduction.rb b/app/graphql/types/user_reduction.rb new file mode 100644 index 000000000..da873c9df --- /dev/null +++ b/app/graphql/types/user_reduction.rb @@ -0,0 +1,16 @@ +# app/graphql/types/user_reduction_type.rb +module Types + class UserReduction < GraphQL::Schema::Object + graphql_name 'UserReduction' + + field 'projectId', ID, null: true, method: :project_id + field 'workflowId', ID, null: false, method: :workflow_id + field 'userId', ID, null: false, method: :user_id + field 'reducerKey', String, null: true, method: :reducer_key + + field 'data', Types::JsonType, null: true + + field 'createdAt', Types::TimeType, null: false, method: :created_at + field 'updatedAt', Types::TimeType, null: false, method: :updated_at + end + end diff --git a/app/graphql/types/workflow.rb b/app/graphql/types/workflow.rb new file mode 100644 index 000000000..acfbbf2f8 --- /dev/null +++ b/app/graphql/types/workflow.rb @@ -0,0 +1,83 @@ +# app/graphql/types/workflow.rb +module Types + class Workflow < GraphQL::Schema::Object + graphql_name 'Workflow' + + field :id, ID, null: false + field :createdAt, Types::TimeType, null: false, + description: 'Timestamp when this workflow was created', method: :created_at + field :updatedAt, Types::TimeType, null: false, + description: 'Timestamp when this workflow was updated', method: :updated_at + + field :extracts, [Types::Extract], null: true do + argument :subjectId, ID, required: true, description: 'Filter by specific subject' + argument :extractorKey, String, required: false, description: 'Filter by specific extractor' + end + def extracts(subjectId:, extractorKey: nil) + scope = Pundit.policy_scope!(context[:credential], Extract) + scope = scope.where(workflow_id: object.id) + scope = scope.where(subject_id: subjectId) + scope = scope.where(extractor_key: extractorKey) if extractorKey + scope + end + + field :reductions, [Types::SubjectReduction], null: true do + argument :subjectId, ID, required: true, description: 'Filter by specific subject' + argument :reducerKey, String, required: false, description: 'Filter by specific reducer' + end + def reductions(subjectId:, reducerKey: nil) + scope = Pundit.policy_scope!(context[:credential], SubjectReduction) + scope = scope.where(workflow_id: object.id) + scope = scope.where(subject_id: subjectId) + scope = scope.where(reducer_key: reducerKey) if reducerKey + scope + end + + field :subject_reductions, [Types::SubjectReduction], null: true do + argument :subjectId, ID, required: true, description: 'Filter by specific subject' + argument :reducerKey, String, required: false, description: 'Filter by specific reducer' + end + def subject_reductions(subjectId:, reducerKey: nil) + reductions(subjectId: subjectId, reducerKey: reducerKey) + end + + field :subject_actions, [Types::SubjectReduction], null: true do + argument :subjectId, ID, required: true, description: 'Filter by specific subject' + end + def subject_actions(subjectId:) + scope = Pundit.policy_scope!(context[:credential], SubjectAction) + scope = scope.where(workflow_id: object.id) + scope = scope.where(subject_id: subjectId) + scope + end + + field :user_reductions, [Types::UserReduction], null: true do + argument :userId, ID, required: true, description: 'Filter by specific user' + argument :reducerKey, String, required: false, description: 'Filter by specific reducer' + end + def user_reductions(userId:, reducerKey: nil) + scope = Pundit.policy_scope!(context[:credential], UserReduction) + scope = scope.where(workflow_id: object.id) + scope = scope.where(user_id: userId) + scope = scope.where(reducer_key: reducerKey) if reducerKey + scope + end + + field :user_actions, [Types::UserAction], null: true do + argument :userId, ID, required: true, description: 'Filter by specific user' + end + def user_actions(userId:) + scope = Pundit.policy_scope!(context[:credential], UserAction) + scope = scope.where(workflow_id: object.id) + scope = scope.where(user_id: userId) + scope + end + + field :dataRequests, [Types::DataRequest], null: true do + end + def dataRequests + scope = Pundit.policy_scope!(context[:credential], DataRequest) + scope.where(workflow_id: object.id) + end + end + end diff --git a/app/models/credential.rb b/app/models/credential.rb index db4c50d39..4ca224117 100644 --- a/app/models/credential.rb +++ b/app/models/credential.rb @@ -1,10 +1,4 @@ class Credential < ApplicationRecord - Type = GraphQL::ObjectType.define do - name "Credential" - field :isLoggedIn, !types.Boolean, property: :logged_in? - field :isAdmin, !types.Boolean, property: :admin? - end - before_create :set_expires_at def admin? diff --git a/app/models/data_request.rb b/app/models/data_request.rb index 9f79de3c4..a023da7d2 100644 --- a/app/models/data_request.rb +++ b/app/models/data_request.rb @@ -1,37 +1,5 @@ class DataRequest < ApplicationRecord class DataRequestCanceled < StandardError; end - RequestedData = GraphQL::EnumType.define do - name "RequestedData" - description "What type of data is requested" - - value("extracts", "Extracts") - value("reductions", "Reductions") - value("subject_reductions", "Subject Reductions") - value("user_reductions", "User Reductions") - end - - Status = GraphQL::EnumType.define do - name "Status" - description "What is the status of this request" - - value("empty", "Nothing to export") - value("pending", "Request is in the queue to be processed") - value("processing", "Servers are currently exporting this data") - value("failed", "Something went wrong while exporting") - value("complete", "This export is ready to download") - value("canceling", "This export is being canceled") - value("canceled", "This export has been canceled") - end - - Type = GraphQL::ObjectType.define do - name "DataRequest" - - field :id, !types.ID - field :subgroup, types.String - field :requestedData, RequestedData, property: :requested_data - field :url, types.String - field :status, !Status - end enum status: { empty: 0, diff --git a/app/models/extract.rb b/app/models/extract.rb index df6f6a1ca..ce2ea8c80 100644 --- a/app/models/extract.rb +++ b/app/models/extract.rb @@ -1,21 +1,4 @@ class Extract < ApplicationRecord - Type = GraphQL::ObjectType.define do - name "Extract" - - field :classificationId, types.String, property: :classification_id - field :classificationAt, Types::TimeType, property: :classification_at - - field :workflowId, !types.ID, property: :workflow_id - field :subjectId, !types.ID, property: :subject_id - field :extractorKey, !types.String, property: :extractor_key - field :userId, types.ID, property: :user_id - - field :data, Types::JsonType - - field :createdAt, !Types::TimeType, property: :created_at - field :updatedAt, !Types::TimeType, property: :updated_at - end - attr_accessor :relevant_reduction belongs_to :workflow, counter_cache: true diff --git a/app/models/subject_action.rb b/app/models/subject_action.rb index 99452d6b6..2ffa759b6 100644 --- a/app/models/subject_action.rb +++ b/app/models/subject_action.rb @@ -1,25 +1,4 @@ class SubjectAction < ApplicationRecord - Type = GraphQL::ObjectType.define do - name "SubjectAction" - - field :id, !types.ID - - field :classificationId, types.String, property: :classification_id - field :classificationAt, Types::TimeType, property: :classification_at - - field :workflowId, !types.ID, property: :workflow_id - field :subjectId, !types.ID, property: :subject_id - field :effectType, !types.String, property: :effect_type - field :status, !Types::ActionStatusType - - field :config, Types::JsonType - - field :createdAt, !Types::TimeType, property: :created_at - field :updatedAt, !Types::TimeType, property: :updated_at - field :attemptedAt, Types::TimeType, property: :attempted_at - field :completedAt, Types::TimeType, property: :completed_at - end - enum status: [:pending, :completed, :failed] belongs_to :workflow, counter_cache: true diff --git a/app/models/subject_reduction.rb b/app/models/subject_reduction.rb index c923d1372..1de4790c1 100644 --- a/app/models/subject_reduction.rb +++ b/app/models/subject_reduction.rb @@ -1,20 +1,6 @@ class SubjectReduction < ApplicationRecord include BelongsToReducibleCached - Type = GraphQL::ObjectType.define do - name "SubjectReduction" - - field :projectId, types.ID, property: :project_id - field :workflowId, !types.ID, property: :workflow_id - field :subjectId, !types.ID, property: :subject_id - field :reducerKey, types.String, property: :reducer_key - - field :data, Types::JsonType - - field :createdAt, !Types::TimeType, property: :created_at - field :updatedAt, !Types::TimeType, property: :updated_at - end - belongs_to :subject has_and_belongs_to_many_with_deferred_save :extracts diff --git a/app/models/user_action.rb b/app/models/user_action.rb index 9d8e6999f..f95cf9d60 100644 --- a/app/models/user_action.rb +++ b/app/models/user_action.rb @@ -1,25 +1,4 @@ class UserAction < ApplicationRecord - Type = GraphQL::ObjectType.define do - name "UserAction" - - field :id, !types.ID - - field :classificationId, types.String, property: :classification_id - field :classificationAt, Types::TimeType, property: :classification_at - - field :workflowId, !types.ID, property: :workflow_id - field :userId, !types.ID, property: :subject_id - field :effectType, !types.String, property: :effect_type - field :status, !Types::ActionStatusType - - field :config, Types::JsonType - - field :createdAt, !Types::TimeType, property: :created_at - field :updatedAt, !Types::TimeType, property: :updated_at - field :attemptedAt, Types::TimeType, property: :attempted_at - field :completedAt, Types::TimeType, property: :completed_at - end - enum status: [:pending, :completed, :failed] belongs_to :workflow, counter_cache: true diff --git a/app/models/user_reduction.rb b/app/models/user_reduction.rb index f5d06b027..cc19278b8 100644 --- a/app/models/user_reduction.rb +++ b/app/models/user_reduction.rb @@ -1,19 +1,5 @@ class UserReduction < ApplicationRecord include BelongsToReducibleCached - Type = GraphQL::ObjectType.define do - name "UserReduction" - - field :projectId, types.ID, property: :project_id - field :workflowId, !types.ID, property: :workflow_id - field :userId, !types.ID, property: :user_id - field :reducerKey, types.String, property: :reducer_key - - field :data, Types::JsonType - - field :createdAt, !Types::TimeType, property: :created_at - field :updatedAt, !Types::TimeType, property: :updated_at - end - has_and_belongs_to_many_with_deferred_save :extracts end diff --git a/app/models/workflow.rb b/app/models/workflow.rb index b599b06ae..70b7a461b 100644 --- a/app/models/workflow.rb +++ b/app/models/workflow.rb @@ -1,96 +1,6 @@ class Workflow < ApplicationRecord include IsReducible - Type = GraphQL::ObjectType.define do - name "Workflow" - - field :id, !types.ID - field :createdAt, !Types::TimeType, "Timestamp when this workflow was created", property: :created_at - field :updatedAt, !Types::TimeType, "Timestamp when this workflow was updated", property: :updated_at - - field :extracts, types[Extract::Type] do - argument :subjectId, !types.ID, "Filter by specific subject" - argument :extractorKey, types.String, "Filter by specific extractor" - - resolve -> (workflow, args, ctx) { - scope = Pundit.policy_scope!(ctx[:credential], Extract) - scope = scope.where(workflow_id: workflow.id) - scope = scope.where(subject_id: args[:subjectId]) - scope = scope.where(extractor_key: args[:extractorKey]) if args[:extractorKey] - scope - } - end - - field :reductions, types[SubjectReduction::Type] do - argument :subjectId, !types.ID, "Filter by specific subject" - argument :reducerKey, types.String, "Filter by specific reducer" - - resolve -> (workflow, args, ctx) { - scope = Pundit.policy_scope!(ctx[:credential], SubjectReduction) - scope = scope.where(workflow_id: workflow.id) - scope = scope.where(subject_id: args[:subjectId]) - scope = scope.where(reducer_key: args[:reducerKey]) if args[:reducerKey] - scope - } - end - - field :subject_reductions, types[SubjectReduction::Type] do - argument :subjectId, !types.ID, "Filter by specific subject" - argument :reducerKey, types.String, "Filter by specific reducer" - - resolve -> (workflow, args, ctx) { - scope = Pundit.policy_scope!(ctx[:credential], SubjectReduction) - scope = scope.where(workflow_id: workflow.id) - scope = scope.where(subject_id: args[:subjectId]) - scope = scope.where(reducer_key: args[:reducerKey]) if args[:reducerKey] - scope - } - end - - field :subject_actions, types[SubjectAction::Type] do - argument :subjectId, !types.ID, "Filter by specific subject" - - resolve -> (workflow, args, ctx) { - scope = Pundit.policy_scope!(ctx[:credential], SubjectAction) - scope = scope.where(workflow_id: workflow.id) - scope = scope.where(subject_id: args[:subjectId]) - scope - } - end - - field :user_reductions, types[UserReduction::Type] do - argument :userId, !types.ID, "Filter by specific user" - argument :reducerKey, types.String, "Filter by specific reducer" - - resolve -> (workflow, args, ctx) { - scope = Pundit.policy_scope!(ctx[:credential], UserReduction) - scope = scope.where(workflow_id: workflow.id) - scope = scope.where(user_id: args[:userId]) - scope = scope.where(reducer_key: args[:reducerKey]) if args[:reducerKey] - scope - } - end - - field :user_actions, types[UserAction::Type] do - argument :userId, !types.ID, "Filter by specific subject" - - resolve -> (workflow, args, ctx) { - scope = Pundit.policy_scope!(ctx[:credential], UserAction) - scope = scope.where(workflow_id: workflow.id) - scope = scope.where(user_id: args[:userId]) - scope - } - end - - field :dataRequests, types[DataRequest::Type] do - resolve -> (workflow, args, ctx) { - scope = Pundit.policy_scope!(ctx[:credential], DataRequest) - scope = scope.where(workflow_id: workflow.id) - scope - } - end - end - has_many :extractors has_many :reducers, as: :reducible has_many :subject_rules diff --git a/docker-compose-rails-next.yml b/docker-compose-rails-next.yml new file mode 100644 index 000000000..ab2bda70c --- /dev/null +++ b/docker-compose-rails-next.yml @@ -0,0 +1,47 @@ +version: '2' +services: + postgres: + image: postgres:11 + environment: + - "POSTGRES_USER=caesar" + - "POSTGRES_PASSWORD=caesar" + ports: + - "5432:5432" + + redis: + image: redis + command: redis-server --appendonly yes + + app: + image: caesar:rails-next-local + build: + context: . + args: + RAILS_ENV: development + volumes: + - ./:/app + ports: + - "3000:80" + environment: + - "RAILS_ENV=development" + - "REDIS_URL=redis://redis:6379" + - "DATABASE_URL=postgresql://caesar:caesar@postgres/caesar_development" + - "DATABASE_URL_TEST=postgresql://caesar:caesar@postgres/caesar_test" + links: + - redis:redis + - postgres:postgres + + sidekiq: + image: caesar:rails-next-local + command: ["/app/docker/start-sidekiq.sh"] + volumes: + - ./:/app + environment: + - "RAILS_ENV=development" + - "REDIS_URL=redis://redis:6379" + - "DATABASE_URL=postgresql://caesar:caesar@postgres/caesar_development" + - "DATABASE_URL_TEST=postgresql://caesar:caesar@postgres/caesar_test" + - "SIDEKIQ_VERBOSE=true" + links: + - redis:redis + - postgres:postgres \ No newline at end of file diff --git a/public/commit_id.txt b/public/commit_id.txt new file mode 100644 index 000000000..2b2e685eb --- /dev/null +++ b/public/commit_id.txt @@ -0,0 +1 @@ +asdf123 diff --git a/spec/graphql/mutation_root_spec.rb b/spec/graphql/mutation_root_spec.rb index 633c80911..60dac891c 100644 --- a/spec/graphql/mutation_root_spec.rb +++ b/spec/graphql/mutation_root_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe MutationRoot do +describe Types::MutationRoot do let(:credential) { fake_credential admin: true } let(:context) { {credential: credential} } let(:variables) { {} }