diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 266225a66..8777124c0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,11 +18,11 @@ jobs: sed -i 's/git@github.com:/https:\/\/github.com\//' .gitmodules git submodule update --init --recursive - name: Docker compose build - run: docker-compose build + run: docker compose build - name: Setup database & test env - run: docker-compose run web bin/rake db:create db:schema:load RAILS_ENV=test + run: docker compose run web bin/rake db:create db:schema:load RAILS_ENV=test - name: Run spec_v8 tests - run: docker-compose run web bin/spec_v8 + run: docker compose run web bin/spec_v8 spec_models: runs-on: ubuntu-latest @@ -36,11 +36,11 @@ jobs: sed -i 's/git@github.com:/https:\/\/github.com\//' .gitmodules git submodule update --init --recursive - name: Docker compose build - run: docker-compose build + run: docker compose build - name: Setup database & test env - run: docker-compose run web bin/rake db:create db:schema:load RAILS_ENV=test + run: docker compose run web bin/rake db:create db:schema:load RAILS_ENV=test - name: Run spec_models tests - run: docker-compose run web bin/spec_models + run: docker compose run web bin/spec_models spec_controllers: runs-on: ubuntu-latest @@ -54,11 +54,11 @@ jobs: sed -i 's/git@github.com:/https:\/\/github.com\//' .gitmodules git submodule update --init --recursive - name: Docker compose build - run: docker-compose build + run: docker compose build - name: Setup database & test env - run: docker-compose run web bin/rake db:create db:schema:load RAILS_ENV=test + run: docker compose run web bin/rake db:create db:schema:load RAILS_ENV=test - name: Run spec_controllers tests - run: docker-compose run web bin/spec_controllers + run: docker compose run web bin/spec_controllers spec_features: runs-on: ubuntu-latest @@ -72,11 +72,11 @@ jobs: sed -i 's/git@github.com:/https:\/\/github.com\//' .gitmodules git submodule update --init --recursive - name: Docker compose build - run: docker-compose build + run: docker compose build - name: Setup database & test env - run: docker-compose run web bin/rake db:create db:schema:load RAILS_ENV=test + run: docker compose run web bin/rake db:create db:schema:load RAILS_ENV=test - name: Run spec_features tests - run: docker-compose run web bin/spec_features + run: docker compose run web bin/spec_features spec_lib: runs-on: ubuntu-latest @@ -90,11 +90,11 @@ jobs: sed -i 's/git@github.com:/https:\/\/github.com\//' .gitmodules git submodule update --init --recursive - name: Docker compose build - run: docker-compose build + run: docker compose build - name: Setup database & test env - run: docker-compose run web bin/rake db:create db:schema:load RAILS_ENV=test + run: docker compose run web bin/rake db:create db:schema:load RAILS_ENV=test - name: Run spec_lib tests - run: docker-compose run web bin/spec_lib + run: docker compose run web bin/spec_lib spec_integration: runs-on: ubuntu-latest @@ -108,32 +108,8 @@ jobs: sed -i 's/git@github.com:/https:\/\/github.com\//' .gitmodules git submodule update --init --recursive - name: Docker compose build - run: docker-compose build + run: docker compose build - name: Setup database & test env - run: docker-compose run web bin/rake db:create db:schema:load RAILS_ENV=test + run: docker compose run web bin/rake db:create db:schema:load RAILS_ENV=test - name: Run spec_integration tests - run: docker-compose run web bin/spec_integration - - spec_usermanual: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v2 - with: - submodules: false - - name: Setup git submodules - run: | - sed -i 's/git@github.com:/https:\/\/github.com\//' .gitmodules - git submodule update --init --recursive - - name: Docker compose build - run: docker-compose build - - name: Setup database & test env - run: docker-compose run web bin/rake db:create db:schema:load RAILS_ENV=test - - name: Run spec_usermanual tests - run: docker-compose run web bin/spec_usermanual - - name: Update manual to testmycode-usermanual - uses: JamesIves/github-pages-deploy-action@4.1.3 - with: - branch: gh-pages - folder: doc/usermanual - target-folder: usermanual + run: docker compose run web bin/spec_integration \ No newline at end of file diff --git a/.github/workflows/rubocop.yml b/.github/workflows/rubocop.yml index 4e6967fde..b5be7a9d5 100644 --- a/.github/workflows/rubocop.yml +++ b/.github/workflows/rubocop.yml @@ -12,10 +12,10 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up Ruby 2.6 + - name: Set up Ruby 3.0 uses: ruby/setup-ruby@v1 with: - ruby-version: 2.6 + ruby-version: 3.0 - name: Cache gems uses: actions/cache@v1 with: diff --git a/Dockerfile b/Dockerfile index d1877ca97..8d88a267d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,13 @@ FROM eu.gcr.io/moocfi-public/tmc-server-base:latest -LABEL name tmc-server +LABEL name=tmc-server + +RUN apt-get update \ + && apt-get -y install curl gnupg nodejs chromium \ + && rm -rf /var/lib/apt/lists/* ADD Gemfile /app/Gemfile ADD Gemfile.lock /app/Gemfile.lock -RUN bundle install --system --gemfile /app/Gemfile -RUN apt-get update -RUN apt-get -y install curl gnupg -RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - -RUN apt-get -y install nodejs +RUN bundle config set path.system true \ + && bundle install --gemfile /app/Gemfile + ADD . /app diff --git a/DockerfileBase b/DockerfileBase index d1dc6d6c5..fabdc92f5 100644 --- a/DockerfileBase +++ b/DockerfileBase @@ -1,4 +1,4 @@ -FROM ruby:2.6 +FROM ruby:3.3 LABEL name tmc-server-base ENV PHANTOMJS_VERSION 2.1.1 diff --git a/Gemfile b/Gemfile index 7359a1684..ec82e9eb8 100644 --- a/Gemfile +++ b/Gemfile @@ -4,79 +4,81 @@ source 'https://rubygems.org' # An alternative when rubygems.org is down # source 'http://production.cf.rubygems.org/' -gem 'rails', '~> 6.1' +gem 'rails', '~> 7.1', '>= 7.1.3.4' -gem 'activerecord-import', '~> 1.2' -gem 'activerecord-session_store', '~> 2.0' -gem 'argon2', '~> 2.0' # Held back, higher requires Ruby 2.6 from tmc-server-base +gem 'activerecord-import', '~> 1.7' +gem 'activerecord-session_store', '~> 2.1' +gem 'argon2', '~> 2.3' gem 'bootstrap', '~> 4.6' # Held back to 4.6 -gem 'cancancan', '~> 3.3' -gem 'doorkeeper', '~> 5.5' -gem 'doorkeeper-openid_connect' -gem 'file_validators' # Used to validate organization logo -gem 'font-awesome-rails' -gem 'google_drive', '~> 3.0', require: false -gem 'gravtastic', '~> 3.2' # Used to display user avatars -gem 'image_processing' # Used by active_storage to make logo 100x100 on the fly -gem 'logstasher', '~> 2.1' -gem 'natcmp', '~> 1.4' -gem 'newrelic_rpm', '~> 8.0' -gem 'pdfkit', '~> 0.8', require: false -gem 'pg', '~> 1.2' -gem 'pghero', '~> 2.8' -gem 'rack-attack', '~> 6.5', require: false -gem 'rack-cors', '~> 1.1' -gem 'rack-mini-profiler', '~> 2.3' -gem 'rake' -gem 'responders', '~> 3.0' +gem 'cancancan', '~> 3.6', '>= 3.6.1' +gem 'doorkeeper', '~> 5.7', '>= 5.7.1' +gem 'doorkeeper-openid_connect', '~> 1.8', '>= 1.8.9' +gem 'file_validators', '~> 3.0' # Used to validate organization logo +gem 'font-awesome-rails', '~> 4.7', '>= 4.7.0.8' +gem 'google_drive', '~> 3.0', '>= 3.0.7', require: false +gem 'gravtastic', '~> 3.2', '>= 3.2.6' # Used to display user avatars +gem 'image_processing', '~> 1.12', '>= 1.12.2' # Used by active_storage to make logo 100x100 on the fly +gem 'logstasher', '~> 2.1', '>= 2.1.5' +gem 'natcmp', '~> 1.4', '>= 1.4.3' +gem 'newrelic_rpm', '~> 9.11' +gem 'pdfkit', '~> 0.8.7.3', require: false +gem 'pg', '~> 1.5', '>= 1.5.6' +gem 'pghero', '~> 3.5' +gem 'rack-attack', '~> 6.7', require: false +gem 'rack-cors', '~> 2.0', '>= 2.0.2' +gem 'rack-mini-profiler', '~> 3.3', '>= 3.3.1' +gem 'rake', '~> 13.2', '>= 13.2.1' +gem 'responders', '~> 3.1', '>= 3.1.1' gem 'rest-client', '~> 2.1', require: false gem 'swagger-blocks', '~> 3.0' -gem 'sassc-rails', '~> 2.1' -gem 'xml-simple', '~> 1.1', require: false +gem 'sassc-rails', '~> 2.1', '>= 2.1.2' +gem 'xml-simple', '~> 1.1', '>= 1.1.9', require: false +gem 'cgi', '~> 0.3.6' -gem 'hiredis', '~> 0.6' # Redis for caching +gem 'hiredis', '~> 0.6.3' # Redis for caching gem 'readthis', '~> 2.2' # Redis for caching gem 'redis', '~> 4.5' # Redis for caching (TODO: Remove and migrate to rails cache) group :assets do - gem 'jquery-rails', '~> 4.4' - gem 'sprockets-rails', require: 'sprockets/railtie' + gem 'jquery-rails', '~> 4.6' + gem 'sprockets-rails', '~> 3.5', '>= 3.5.1', require: 'sprockets/railtie' gem 'uglifier', '~> 4.2' end group :development, :test do - gem 'capybara', '~> 3.35' - gem 'factory_bot_rails', '~> 6.2' - gem 'puma', '~> 5.5' + gem 'capybara', '~> 3.40' + gem 'factory_bot_rails', '~> 6.4', '>= 6.4.3' + gem 'puma', '~> 6.4', '>= 6.4.2' + gem 'thin', '~> 1.8', '>= 1.8.2' # A transitive dependency, this forces the latest version # gem 'passenger', '~> 5.0', require: "phusion_passenger/rack_handler" - gem 'poltergeist', '~> 1.18' - gem 'rspec', '~> 3.10' - gem 'rspec-activemodel-mocks', '~> 1.1' - gem 'rspec-core', '~> 3.10' - gem 'rspec-rails', '~> 5.0' - gem 'rails-controller-testing' + gem 'poltergeist', '~> 1.18', '>= 1.18.1' + gem 'rspec', '~> 3.13' + gem 'rspec-activemodel-mocks', '~> 1.2' + gem 'rspec-core', '~> 3.13' + gem 'rspec-rails', '~> 6.1', '>= 6.1.3' + gem 'rails-controller-testing', '~> 1.0', '>= 1.0.5' # gem 'selenium-webdriver', '~> 2.44.0' - gem 'irb' - gem 'brakeman', require: false - gem 'bundler-audit' - gem 'pry' - gem 'pry-byebug' - gem 'pry-rails' + gem 'irb', '~> 1.14' + gem 'brakeman', '~> 6.1', '>= 6.1.2', require: false + gem 'bundler-audit', '~> 0.9.1' + gem 'pry', '~> 0.14.2' + gem 'pry-byebug', '~> 3.10', '>= 3.10.1' + gem 'pry-rails', '~> 0.3.11' - gem 'database_cleaner', '~> 2.0' - gem 'launchy' # for capybara's save_and_open_page - gem 'mimic', '~> 0.4' - gem 'railroady' # for doc/diagrams - gem 'rubocop', '~> 1.13', require: false # HoundCI requires 1.5.2 - gem 'rubocop-rails_config', '~> 1.5' # Rubocop locked - gem 'ruby-prof', '~> 1.4' # for performance tests - gem 'simplecov', require: false + gem 'database_cleaner', '~> 2.0', '>= 2.0.2' + gem 'launchy', '~> 3.0', '>= 3.0.1' # for capybara's save_and_open_page + gem 'mimic', '~> 0.4.4' + gem 'railroady', '~> 1.6' # for doc/diagrams + gem 'rubocop', '~> 1.65', require: false + gem 'rubocop-rails_config', '~> 1.16' # Rubocop locked + gem 'ruby-prof', '~> 1.7' # for performance tests + gem 'simplecov', '~> 0.22.0', require: false end group :development do - gem 'letter_opener', '~> 1.7' + gem 'letter_opener', '~> 1.10' end group :test do - gem 'json-schema', '~> 2.8' + gem 'json-schema', '~> 4.3' end diff --git a/Gemfile.lock b/Gemfile.lock index 786b22454..97ae0023b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,163 +1,197 @@ GEM remote: https://rubygems.org/ specs: - actioncable (6.1.4.1) - actionpack (= 6.1.4.1) - activesupport (= 6.1.4.1) + actioncable (7.1.3.4) + actionpack (= 7.1.3.4) + activesupport (= 7.1.3.4) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.1.4.1) - actionpack (= 6.1.4.1) - activejob (= 6.1.4.1) - activerecord (= 6.1.4.1) - activestorage (= 6.1.4.1) - activesupport (= 6.1.4.1) + zeitwerk (~> 2.6) + actionmailbox (7.1.3.4) + actionpack (= 7.1.3.4) + activejob (= 7.1.3.4) + activerecord (= 7.1.3.4) + activestorage (= 7.1.3.4) + activesupport (= 7.1.3.4) mail (>= 2.7.1) - actionmailer (6.1.4.1) - actionpack (= 6.1.4.1) - actionview (= 6.1.4.1) - activejob (= 6.1.4.1) - activesupport (= 6.1.4.1) + net-imap + net-pop + net-smtp + actionmailer (7.1.3.4) + actionpack (= 7.1.3.4) + actionview (= 7.1.3.4) + activejob (= 7.1.3.4) + activesupport (= 7.1.3.4) mail (~> 2.5, >= 2.5.4) - rails-dom-testing (~> 2.0) - actionpack (6.1.4.1) - actionview (= 6.1.4.1) - activesupport (= 6.1.4.1) - rack (~> 2.0, >= 2.0.9) + net-imap + net-pop + net-smtp + rails-dom-testing (~> 2.2) + actionpack (7.1.3.4) + actionview (= 7.1.3.4) + activesupport (= 7.1.3.4) + nokogiri (>= 1.8.5) + racc + rack (>= 2.2.4) + rack-session (>= 1.0.1) rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.1.4.1) - actionpack (= 6.1.4.1) - activerecord (= 6.1.4.1) - activestorage (= 6.1.4.1) - activesupport (= 6.1.4.1) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + actiontext (7.1.3.4) + actionpack (= 7.1.3.4) + activerecord (= 7.1.3.4) + activestorage (= 7.1.3.4) + activesupport (= 7.1.3.4) + globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (6.1.4.1) - activesupport (= 6.1.4.1) + actionview (7.1.3.4) + activesupport (= 7.1.3.4) builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (6.1.4.1) - activesupport (= 6.1.4.1) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (7.1.3.4) + activesupport (= 7.1.3.4) globalid (>= 0.3.6) - activemodel (6.1.4.1) - activesupport (= 6.1.4.1) - activerecord (6.1.4.1) - activemodel (= 6.1.4.1) - activesupport (= 6.1.4.1) - activerecord-import (1.2.0) - activerecord (>= 3.2) - activerecord-session_store (2.0.0) - actionpack (>= 5.2.4.1) - activerecord (>= 5.2.4.1) + activemodel (7.1.3.4) + activesupport (= 7.1.3.4) + activerecord (7.1.3.4) + activemodel (= 7.1.3.4) + activesupport (= 7.1.3.4) + timeout (>= 0.4.0) + activerecord-import (1.7.0) + activerecord (>= 4.2) + activerecord-session_store (2.1.0) + actionpack (>= 6.1) + activerecord (>= 6.1) + cgi (>= 0.3.6) multi_json (~> 1.11, >= 1.11.2) - rack (>= 2.0.8, < 3) - railties (>= 5.2.4.1) - activestorage (6.1.4.1) - actionpack (= 6.1.4.1) - activejob (= 6.1.4.1) - activerecord (= 6.1.4.1) - activesupport (= 6.1.4.1) - marcel (~> 1.0.0) - mini_mime (>= 1.1.0) - activesupport (6.1.4.1) + rack (>= 2.0.8, < 4) + railties (>= 6.1) + activestorage (7.1.3.4) + actionpack (= 7.1.3.4) + activejob (= 7.1.3.4) + activerecord (= 7.1.3.4) + activesupport (= 7.1.3.4) + marcel (~> 1.0) + activesupport (7.1.3.4) + base64 + bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb i18n (>= 1.6, < 2) minitest (>= 5.1) + mutex_m tzinfo (~> 2.0) - zeitwerk (~> 2.3) - addressable (2.8.0) - public_suffix (>= 2.0.2, < 5.0) - aes_key_wrap (1.1.0) - argon2 (2.0.3) - ffi (~> 1.14) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) + argon2 (2.3.0) + ffi (~> 1.15) ffi-compiler (~> 1.0) ast (2.4.2) - autoprefixer-rails (10.3.3.0) + autoprefixer-rails (10.4.16.0) execjs (~> 2) - bindata (2.4.15) - bootstrap (4.6.0) + base64 (0.2.0) + bigdecimal (3.1.8) + bootstrap (4.6.2) autoprefixer-rails (>= 9.1.0) - popper_js (>= 1.14.3, < 2) + popper_js (>= 1.16.1, < 2) sassc-rails (>= 2.0.0) - brakeman (5.1.1) - builder (3.2.4) - bundler-audit (0.9.0.1) + brakeman (6.1.2) + racc + builder (3.3.0) + bundler-audit (0.9.1) bundler (>= 1.2.0, < 3) thor (~> 1.0) byebug (11.1.3) - cancancan (3.3.0) - capybara (3.35.3) + cancancan (3.6.1) + capybara (3.40.0) addressable + matrix mini_mime (>= 0.1.3) - nokogiri (~> 1.8) + nokogiri (~> 1.11) rack (>= 1.6.0) rack-test (>= 0.6.3) regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) + cgi (0.3.6) + childprocess (5.0.0) cliver (0.3.2) coderay (1.1.3) - concurrent-ruby (1.1.9) - connection_pool (2.2.5) + concurrent-ruby (1.3.3) + connection_pool (2.4.1) crass (1.0.6) daemons (1.4.1) - database_cleaner (2.0.1) - database_cleaner-active_record (~> 2.0.0) - database_cleaner-active_record (2.0.1) + database_cleaner (2.0.2) + database_cleaner-active_record (>= 2, < 3) + database_cleaner-active_record (2.2.0) activerecord (>= 5.a) database_cleaner-core (~> 2.0.0) database_cleaner-core (2.0.1) + date (3.3.4) declarative (0.0.20) - diff-lcs (1.4.4) - docile (1.4.0) - domain_name (0.5.20190701) - unf (>= 0.0.5, < 1.0.0) - doorkeeper (5.5.4) + diff-lcs (1.5.1) + docile (1.4.1) + domain_name (0.6.20240107) + doorkeeper (5.7.1) railties (>= 5) - doorkeeper-openid_connect (1.8.3) - doorkeeper (>= 5.5, < 5.7) - json-jwt (>= 1.15.0) - erubi (1.10.0) + doorkeeper-openid_connect (1.8.9) + doorkeeper (>= 5.5, < 5.8) + jwt (>= 2.5) + drb (2.2.1) + erubi (1.13.0) eventmachine (1.2.7) - execjs (2.8.1) - factory_bot (6.2.0) + execjs (2.9.1) + factory_bot (6.4.6) 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 (1.8.0) + faraday (1.10.3) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) faraday-excon (~> 1.1) - faraday-httpclient (~> 1.0.1) + faraday-httpclient (~> 1.0) + faraday-multipart (~> 1.0) faraday-net_http (~> 1.0) - faraday-net_http_persistent (~> 1.1) + faraday-net_http_persistent (~> 1.0) faraday-patron (~> 1.0) faraday-rack (~> 1.0) - multipart-post (>= 1.2, < 3) + 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-net_http (1.0.1) + faraday-multipart (1.0.4) + multipart-post (~> 2) + faraday-net_http (1.0.2) faraday-net_http_persistent (1.2.0) faraday-patron (1.0.0) faraday-rack (1.0.0) - ffi (1.15.4) - ffi-compiler (1.0.1) - ffi (>= 1.0.0) + faraday-retry (1.0.3) + ffi (1.17.0-aarch64-linux-gnu) + ffi (1.17.0-aarch64-linux-musl) + ffi (1.17.0-arm-linux-gnu) + ffi (1.17.0-arm-linux-musl) + ffi (1.17.0-arm64-darwin) + ffi (1.17.0-x86-linux-gnu) + ffi (1.17.0-x86-linux-musl) + ffi (1.17.0-x86_64-darwin) + ffi (1.17.0-x86_64-linux-gnu) + ffi (1.17.0-x86_64-linux-musl) + ffi-compiler (1.3.2) + ffi (>= 1.15.5) rake file_validators (3.0.0) activemodel (>= 3.2) mime-types (>= 1.0) - font-awesome-rails (4.7.0.7) - railties (>= 3.2, < 7) - globalid (0.5.2) - activesupport (>= 5.0) - google-apis-core (0.4.1) + font-awesome-rails (4.7.0.8) + railties (>= 3.2, < 8.0) + globalid (1.2.1) + activesupport (>= 6.1) + google-apis-core (0.11.3) addressable (~> 2.5, >= 2.5.1) googleauth (>= 0.16.2, < 2.a) httpclient (>= 2.8.1, < 3.a) @@ -165,11 +199,10 @@ GEM representable (~> 3.0) retriable (>= 2.0, < 4.a) rexml - webrick - google-apis-drive_v3 (0.14.0) - google-apis-core (>= 0.4, < 2.a) - google-apis-sheets_v4 (0.9.0) - google-apis-core (>= 0.4, < 2.a) + google-apis-drive_v3 (0.46.0) + google-apis-core (>= 0.11.0, < 2.a) + google-apis-sheets_v4 (0.26.0) + google-apis-core (>= 0.11.0, < 2.a) google_drive (3.0.7) google-apis-drive_v3 (>= 0.5.0, < 1.0.0) google-apis-sheets_v4 (>= 0.4.0, < 1.0.0) @@ -185,221 +218,265 @@ GEM gravtastic (3.2.6) hiredis (0.6.3) http-accept (1.7.0) - http-cookie (1.0.4) + http-cookie (1.0.6) domain_name (~> 0.5) httpclient (2.8.3) - i18n (1.8.10) + i18n (1.14.5) concurrent-ruby (~> 1.0) - image_processing (1.12.1) + image_processing (1.13.0) mini_magick (>= 4.9.5, < 5) ruby-vips (>= 2.0.17, < 3) - io-console (0.5.9) - irb (1.3.7) - reline (>= 0.2.7) - jquery-rails (4.4.0) + io-console (0.7.2) + irb (1.14.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) + jquery-rails (4.6.0) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) - json (2.6.0) - json-jwt (1.15.3) - activesupport (>= 4.2) - aes_key_wrap - bindata - httpclient - json-schema (2.8.1) - addressable (>= 2.4) - jwt (2.3.0) - launchy (2.5.0) - addressable (~> 2.7) - letter_opener (1.7.0) - launchy (~> 2.2) + json (2.7.2) + json-schema (4.3.1) + addressable (>= 2.8) + jwt (2.8.2) + base64 + language_server-protocol (3.17.0.3) + launchy (3.0.1) + addressable (~> 2.8) + childprocess (~> 5.0) + letter_opener (1.10.0) + launchy (>= 2.2, < 4) + logger (1.6.0) logstasher (2.1.5) activesupport (>= 5.2) request_store - loofah (2.12.0) + loofah (2.22.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) + net-imap + net-pop + net-smtp + marcel (1.0.4) + matrix (0.4.2) memoist (0.16.2) - method_source (1.0.0) - mime-types (3.3.1) + method_source (1.1.0) + mime-types (3.5.2) mime-types-data (~> 3.2015) - mime-types-data (3.2021.0901) + mime-types-data (3.2024.0702) mimic (0.4.4) json plist (~> 3.1.0) rack sinatra thin - mini_magick (4.11.0) - mini_mime (1.1.2) - mini_portile2 (2.6.1) - minitest (5.14.4) + mini_magick (4.13.2) + mini_mime (1.1.5) + minitest (5.24.1) multi_json (1.15.0) - multipart-post (2.1.1) - mustermann (1.1.1) + multipart-post (2.4.1) + mustermann (3.0.0) ruby2_keywords (~> 0.0.1) - natcmp (1.4.1) + mutex_m (0.2.0) + natcmp (1.4.3) + net-imap (0.4.14) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.2) + timeout + net-smtp (0.5.0) + net-protocol netrc (0.11.0) - newrelic_rpm (8.0.0) - nio4r (2.5.8) - nokogiri (1.12.5) - mini_portile2 (~> 2.6.1) + newrelic_rpm (9.12.0) + nio4r (2.7.3) + nokogiri (1.16.7-aarch64-linux) + racc (~> 1.4) + nokogiri (1.16.7-arm-linux) + racc (~> 1.4) + nokogiri (1.16.7-arm64-darwin) racc (~> 1.4) - os (1.1.1) - parallel (1.21.0) - parser (3.0.2.0) + nokogiri (1.16.7-x86-linux) + racc (~> 1.4) + nokogiri (1.16.7-x86_64-darwin) + racc (~> 1.4) + nokogiri (1.16.7-x86_64-linux) + racc (~> 1.4) + os (1.1.4) + parallel (1.25.1) + parser (3.3.4.0) ast (~> 2.4.1) - pdfkit (0.8.5) - pg (1.2.3) - pghero (2.8.1) - activerecord (>= 5) + racc + pdfkit (0.8.7.3) + pg (1.5.7) + pghero (3.5.0) + activerecord (>= 6) plist (3.1.0) poltergeist (1.18.1) capybara (>= 2.1, < 4) cliver (~> 0.3.1) websocket-driver (>= 0.2.0) - popper_js (1.16.0) - pry (0.14.1) + popper_js (1.16.1) + pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) - pry-byebug (3.8.0) + pry-byebug (3.10.1) byebug (~> 11.0) - pry (~> 0.10) - pry-rails (0.3.9) - pry (>= 0.10.4) - public_suffix (4.0.6) - puma (5.5.2) + pry (>= 0.13, < 0.15) + pry-rails (0.3.11) + pry (>= 0.13.0) + psych (5.1.2) + stringio + public_suffix (6.0.1) + puma (6.4.2) nio4r (~> 2.0) - racc (1.5.2) - rack (2.2.3) - rack-attack (6.5.0) - rack (>= 1.0, < 3) - rack-cors (1.1.1) + racc (1.8.0) + rack (2.2.9) + rack-attack (6.7.0) + rack (>= 1.0, < 4) + rack-cors (2.0.2) rack (>= 2.0.0) - rack-mini-profiler (2.3.3) + rack-mini-profiler (3.3.1) rack (>= 1.2.0) - rack-protection (2.1.0) - rack - rack-test (1.1.0) - rack (>= 1.0, < 3) + 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.1.0) + rack (>= 1.3) + rackup (1.0.0) + rack (< 3) + webrick railroady (1.6.0) - rails (6.1.4.1) - actioncable (= 6.1.4.1) - actionmailbox (= 6.1.4.1) - actionmailer (= 6.1.4.1) - actionpack (= 6.1.4.1) - actiontext (= 6.1.4.1) - actionview (= 6.1.4.1) - activejob (= 6.1.4.1) - activemodel (= 6.1.4.1) - activerecord (= 6.1.4.1) - activestorage (= 6.1.4.1) - activesupport (= 6.1.4.1) + rails (7.1.3.4) + actioncable (= 7.1.3.4) + actionmailbox (= 7.1.3.4) + actionmailer (= 7.1.3.4) + actionpack (= 7.1.3.4) + actiontext (= 7.1.3.4) + actionview (= 7.1.3.4) + activejob (= 7.1.3.4) + activemodel (= 7.1.3.4) + activerecord (= 7.1.3.4) + activestorage (= 7.1.3.4) + activesupport (= 7.1.3.4) bundler (>= 1.15.0) - railties (= 6.1.4.1) - sprockets-rails (>= 2.0.0) + railties (= 7.1.3.4) 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.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.2) - loofah (~> 2.3) - railties (6.1.4.1) - actionpack (= 6.1.4.1) - activesupport (= 6.1.4.1) - method_source - rake (>= 0.13) - thor (~> 1.0) - rainbow (3.0.0) - rake (13.0.6) + rails-html-sanitizer (1.6.0) + loofah (~> 2.21) + nokogiri (~> 1.14) + railties (7.1.3.4) + actionpack (= 7.1.3.4) + activesupport (= 7.1.3.4) + irb + rackup (>= 1.0.0) + rake (>= 12.2) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) + rainbow (3.1.1) + rake (13.2.1) + rdoc (6.7.0) + psych (>= 4.0.0) readthis (2.2.0) connection_pool (~> 2.1) redis (>= 3.0, < 5.0) - redis (4.5.0) - regexp_parser (2.1.1) - reline (0.2.7) + redis (4.8.1) + regexp_parser (2.9.2) + reline (0.5.9) io-console (~> 0.5) - representable (3.1.1) + representable (3.2.0) declarative (< 0.1.0) trailblazer-option (>= 0.1.1, < 0.2.0) uber (< 0.2.0) - request_store (1.5.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) retriable (3.1.2) - rexml (3.2.5) - rspec (3.10.0) - rspec-core (~> 3.10.0) - rspec-expectations (~> 3.10.0) - rspec-mocks (~> 3.10.0) - rspec-activemodel-mocks (1.1.0) + rexml (3.3.2) + strscan + rspec (3.13.0) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-activemodel-mocks (1.2.0) activemodel (>= 3.0) activesupport (>= 3.0) rspec-mocks (>= 2.99, < 4.0) - rspec-core (3.10.1) - rspec-support (~> 3.10.0) - rspec-expectations (3.10.1) + rspec-core (3.13.0) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.1) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) - rspec-mocks (3.10.2) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.1) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) - rspec-rails (5.0.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.10.2) - rubocop (1.22.1) + rspec-support (~> 3.13.0) + rspec-rails (6.1.3) + actionpack (>= 6.1) + activesupport (>= 6.1) + railties (>= 6.1) + rspec-core (~> 3.13) + rspec-expectations (~> 3.13) + rspec-mocks (~> 3.13) + rspec-support (~> 3.13) + rspec-support (3.13.1) + rubocop (1.65.0) + json (~> 2.3) + language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.0.0.0) + parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml - rubocop-ast (>= 1.12.0, < 2.0) + regexp_parser (>= 2.4, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.12.0) - parser (>= 3.0.1.1) - rubocop-minitest (0.15.2) - rubocop (>= 0.90, < 2.0) - rubocop-packaging (0.5.1) - rubocop (>= 0.89, < 2.0) - rubocop-performance (1.11.5) - rubocop (>= 1.7.0, < 2.0) - rubocop-ast (>= 0.4.0) - rubocop-rails (2.12.3) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.31.3) + parser (>= 3.3.1.0) + rubocop-md (1.2.2) + rubocop (>= 1.0) + rubocop-minitest (0.35.1) + rubocop (>= 1.61, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-packaging (0.5.2) + rubocop (>= 1.33, < 2.0) + rubocop-performance (1.21.1) + rubocop (>= 1.48.1, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rails (2.25.1) activesupport (>= 4.2.0) rack (>= 1.1) - rubocop (>= 1.7.0, < 2.0) - rubocop-rails_config (1.7.4) - railties (>= 5.0) - rubocop (>= 1.19) - rubocop-ast (>= 1.0.1) - rubocop-minitest (~> 0.15) + rubocop (>= 1.33.0, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rails_config (1.16.0) + rubocop (>= 1.57.0) + rubocop-ast (>= 1.26.0) + rubocop-md + rubocop-minitest (~> 0.22) rubocop-packaging (~> 0.5) rubocop-performance (~> 1.11) rubocop-rails (~> 2.0) - ruby-prof (1.4.3) - ruby-progressbar (1.11.0) - ruby-vips (2.1.3) + ruby-prof (1.7.0) + ruby-progressbar (1.13.0) + ruby-vips (2.2.2) ffi (~> 1.12) + logger ruby2_keywords (0.0.5) sassc (2.4.0) ffi (~> 1.9) @@ -409,119 +486,133 @@ GEM sprockets (> 3.0) sprockets-rails tilt - signet (0.16.0) + signet (0.19.0) addressable (~> 2.8) - faraday (>= 0.17.3, < 2.0) + faraday (>= 0.17.5, < 3.a) jwt (>= 1.5, < 3.0) multi_json (~> 1.10) - simplecov (0.21.2) + simplecov (0.22.0) docile (~> 1.1) simplecov-html (~> 0.11) simplecov_json_formatter (~> 0.1) simplecov-html (0.12.3) - simplecov_json_formatter (0.1.3) - sinatra (2.1.0) - mustermann (~> 1.0) - rack (~> 2.2) - rack-protection (= 2.1.0) + simplecov_json_formatter (0.1.4) + sinatra (3.2.0) + mustermann (~> 3.0) + rack (~> 2.2, >= 2.2.4) + rack-protection (= 3.2.0) tilt (~> 2.0) - sprockets (4.0.2) + sprockets (4.2.1) concurrent-ruby (~> 1.0) - rack (> 1, < 3) - sprockets-rails (3.2.2) - actionpack (>= 4.0) - activesupport (>= 4.0) + rack (>= 2.2.4, < 4) + sprockets-rails (3.5.1) + actionpack (>= 6.1) + activesupport (>= 6.1) sprockets (>= 3.0.0) + stringio (3.1.1) + strscan (3.1.0) swagger-blocks (3.0.0) - thin (1.8.1) + thin (1.8.2) daemons (~> 1.0, >= 1.0.9) eventmachine (~> 1.0, >= 1.0.4) rack (>= 1, < 3) - thor (1.1.0) - tilt (2.0.10) - trailblazer-option (0.1.1) - tzinfo (2.0.4) + thor (1.3.1) + tilt (2.4.0) + timeout (0.4.1) + trailblazer-option (0.1.2) + tzinfo (2.0.6) concurrent-ruby (~> 1.0) uber (0.1.0) uglifier (4.2.0) execjs (>= 0.3.0, < 3) - unf (0.1.4) - unf_ext - unf_ext (0.0.8) - unicode-display_width (2.1.0) - webrick (1.7.0) - websocket-driver (0.7.5) + unicode-display_width (2.5.0) + webrick (1.8.1) + websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) xml-simple (1.1.9) rexml xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.4.2) + zeitwerk (2.6.16) PLATFORMS - ruby + aarch64-linux + aarch64-linux-gnu + aarch64-linux-musl + arm-linux + arm-linux-gnu + arm-linux-musl + arm64-darwin + x86-linux + x86-linux-gnu + x86-linux-musl + x86_64-darwin + x86_64-linux-gnu + x86_64-linux-musl DEPENDENCIES - activerecord-import (~> 1.2) - activerecord-session_store (~> 2.0) - argon2 (~> 2.0) + activerecord-import (~> 1.7) + activerecord-session_store (~> 2.1) + argon2 (~> 2.3) bootstrap (~> 4.6) - brakeman - bundler-audit - cancancan (~> 3.3) - capybara (~> 3.35) - database_cleaner (~> 2.0) - doorkeeper (~> 5.5) - doorkeeper-openid_connect - factory_bot_rails (~> 6.2) - file_validators - font-awesome-rails - google_drive (~> 3.0) - gravtastic (~> 3.2) - hiredis (~> 0.6) - image_processing - irb - jquery-rails (~> 4.4) - json-schema (~> 2.8) - launchy - letter_opener (~> 1.7) - logstasher (~> 2.1) - mimic (~> 0.4) - natcmp (~> 1.4) - newrelic_rpm (~> 8.0) - pdfkit (~> 0.8) - pg (~> 1.2) - pghero (~> 2.8) - poltergeist (~> 1.18) - pry - pry-byebug - pry-rails - puma (~> 5.5) - rack-attack (~> 6.5) - rack-cors (~> 1.1) - rack-mini-profiler (~> 2.3) - railroady - rails (~> 6.1) - rails-controller-testing - rake + brakeman (~> 6.1, >= 6.1.2) + bundler-audit (~> 0.9.1) + cancancan (~> 3.6, >= 3.6.1) + capybara (~> 3.40) + cgi (~> 0.3.6) + database_cleaner (~> 2.0, >= 2.0.2) + doorkeeper (~> 5.7, >= 5.7.1) + doorkeeper-openid_connect (~> 1.8, >= 1.8.9) + factory_bot_rails (~> 6.4, >= 6.4.3) + file_validators (~> 3.0) + font-awesome-rails (~> 4.7, >= 4.7.0.8) + google_drive (~> 3.0, >= 3.0.7) + gravtastic (~> 3.2, >= 3.2.6) + hiredis (~> 0.6.3) + image_processing (~> 1.12, >= 1.12.2) + irb (~> 1.14) + jquery-rails (~> 4.6) + json-schema (~> 4.3) + launchy (~> 3.0, >= 3.0.1) + letter_opener (~> 1.10) + logstasher (~> 2.1, >= 2.1.5) + mimic (~> 0.4.4) + natcmp (~> 1.4, >= 1.4.3) + newrelic_rpm (~> 9.11) + pdfkit (~> 0.8.7.3) + pg (~> 1.5, >= 1.5.6) + pghero (~> 3.5) + poltergeist (~> 1.18, >= 1.18.1) + pry (~> 0.14.2) + pry-byebug (~> 3.10, >= 3.10.1) + pry-rails (~> 0.3.11) + puma (~> 6.4, >= 6.4.2) + rack-attack (~> 6.7) + rack-cors (~> 2.0, >= 2.0.2) + rack-mini-profiler (~> 3.3, >= 3.3.1) + railroady (~> 1.6) + rails (~> 7.1, >= 7.1.3.4) + rails-controller-testing (~> 1.0, >= 1.0.5) + rake (~> 13.2, >= 13.2.1) readthis (~> 2.2) redis (~> 4.5) - responders (~> 3.0) + responders (~> 3.1, >= 3.1.1) rest-client (~> 2.1) - rspec (~> 3.10) - rspec-activemodel-mocks (~> 1.1) - rspec-core (~> 3.10) - rspec-rails (~> 5.0) - rubocop (~> 1.13) - rubocop-rails_config (~> 1.5) - ruby-prof (~> 1.4) - sassc-rails (~> 2.1) - simplecov - sprockets-rails + rspec (~> 3.13) + rspec-activemodel-mocks (~> 1.2) + rspec-core (~> 3.13) + rspec-rails (~> 6.1, >= 6.1.3) + rubocop (~> 1.65) + rubocop-rails_config (~> 1.16) + ruby-prof (~> 1.7) + sassc-rails (~> 2.1, >= 2.1.2) + simplecov (~> 0.22.0) + sprockets-rails (~> 3.5, >= 3.5.1) swagger-blocks (~> 3.0) + thin (~> 1.8, >= 1.8.2) uglifier (~> 4.2) - xml-simple (~> 1.1) + xml-simple (~> 1.1, >= 1.1.9) BUNDLED WITH - 1.17.3 + 2.5.16 diff --git a/Installation.md b/Installation.md index 2f2b864e1..2739c08b4 100644 --- a/Installation.md +++ b/Installation.md @@ -1,7 +1,7 @@ ## Setup ### Notices before installation -We assume you use [RVM](https://rvm.io/). If you don't, then replace `rvmsudo` with `sudo` during the installation process. +We assume you use [RVM](https://rvm.io/). If you don't, then replace `rvmsudo` with `sudo` during the installation process. > Note: Installation instructions works on WSL, but node needs to be installed according to [these](https://docs.microsoft.com/en-us/windows/nodejs/setup-on-wsl2) instructions. ### Installation instructions for Ubuntu We expect the user to be using account which name is tmc. @@ -24,7 +24,7 @@ RVM dependencies ```bash sudo apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev ``` -ext/sandbox dependencies see [rage/sandbox](https://github.com/rage/sandbox) for latest deps +ext/sandbox dependencies see [rage/sandbox](https://github.com/rage/sandbox) for latest deps Requires docker to be installed aswell, read instructions [here](https://docs.docker.com/engine/install/ubuntu/). ``` sudo apt-get install tar zstd moreutils nodejs @@ -115,8 +115,8 @@ bundle install git submodule update --init --recursive ``` -You can view the site settings from the file `config/site.defaults.yml`. If you want to change the settings for the site, create a new file `config/site.yml` and define the changes there. -> Note: You do not need to copy the entire file. Settings not in `site.yml` will be looked up from `site.defaults.yml`. +You can view the site settings from the file `config/site.defaults.yml`. If you want to change the settings for the site, create a new file `config/site.yml` and define the changes there. +> Note: You do not need to copy the entire file. Settings not in `site.yml` will be looked up from `site.defaults.yml`. :exclamation: For development environment you can run command `cp config/site.dev.yml config/site.yml` Initialize the database with `bin/rails db:create db:migrate` diff --git a/app/background_tasks/refresh_course_task.rb b/app/background_tasks/refresh_course_task.rb index 3d6888593..230194e1d 100644 --- a/app/background_tasks/refresh_course_task.rb +++ b/app/background_tasks/refresh_course_task.rb @@ -2,6 +2,7 @@ require 'rust_langs_cli_executor' require 'fileutils' +require 'course_refresh_database_updater' class RefreshCourseTask def initialize @@ -62,6 +63,7 @@ def wait_delay private def broadcast_to_channel(id, msg, percent, time, refresh_id = nil) + Rails.logger.info("Broadcasting message: #{msg} to channel CourseTemplateRefreshChannel-#{id}, Percent done: #{percent}, Time: #{time}, Course Template Refresh ID: #{refresh_id}") ActionCable.server.broadcast("CourseTemplateRefreshChannel-#{id}", { message: msg, percent_done: percent, diff --git a/app/background_tasks/sandbox_status_fetcher_task.rb b/app/background_tasks/sandbox_status_fetcher_task.rb index 90554a3ee..8332aa12f 100644 --- a/app/background_tasks/sandbox_status_fetcher_task.rb +++ b/app/background_tasks/sandbox_status_fetcher_task.rb @@ -2,7 +2,6 @@ require 'json' require 'benchmark' -require 'remote_sandbox' class SandboxStatusFetcherTask def initialize diff --git a/app/controllers/api/beta/participant_controller.rb b/app/controllers/api/beta/participant_controller.rb index 9dcd19c22..0fb47402f 100644 --- a/app/controllers/api/beta/participant_controller.rb +++ b/app/controllers/api/beta/participant_controller.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require 'course_list' + class Api::Beta::ParticipantController < Api::Beta::BaseController before_action :doorkeeper_authorize!, scopes: [:public] diff --git a/app/controllers/api/v8/base_controller.rb b/app/controllers/api/v8/base_controller.rb index f8e633da1..a83f1c1c8 100644 --- a/app/controllers/api/v8/base_controller.rb +++ b/app/controllers/api/v8/base_controller.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'json' +require 'version' module Api module V8 diff --git a/app/controllers/api/v8/core/courses/reviews_controller.rb b/app/controllers/api/v8/core/courses/reviews_controller.rb index b79fb2971..04e34df6a 100644 --- a/app/controllers/api/v8/core/courses/reviews_controller.rb +++ b/app/controllers/api/v8/core/courses/reviews_controller.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require 'natsort' + module Api module V8 module Core diff --git a/app/controllers/api/v8/core/exercises/submissions_controller.rb b/app/controllers/api/v8/core/exercises/submissions_controller.rb index ea5f5f113..d7f808e4b 100644 --- a/app/controllers/api/v8/core/exercises/submissions_controller.rb +++ b/app/controllers/api/v8/core/exercises/submissions_controller.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require 'submission_processor' + module Api module V8 module Core diff --git a/app/controllers/api/v8/core/exercises_controller.rb b/app/controllers/api/v8/core/exercises_controller.rb index 853b60ebe..dcc30ab66 100644 --- a/app/controllers/api/v8/core/exercises_controller.rb +++ b/app/controllers/api/v8/core/exercises_controller.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require 'submission_list' + module Api module V8 module Core diff --git a/app/controllers/api/v8/core/submissions/reviews_controller.rb b/app/controllers/api/v8/core/submissions/reviews_controller.rb index dc74c0db8..8ccf4ab9f 100644 --- a/app/controllers/api/v8/core/submissions/reviews_controller.rb +++ b/app/controllers/api/v8/core/submissions/reviews_controller.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require 'natsort' + module Api module V8 module Core diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 3acfbd90f..0e41547c4 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'version' -require 'twitter-bootstrap-breadcrumbs' +require 'twitter_bootstrap_breadcrumbs' # Base class for all controllers. # diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 406e15c0f..119aab198 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -1,9 +1,10 @@ # frozen_string_literal: true require 'natsort' -require 'course_list' require 'exercise_completion_status_generator' require 'json' +require 'course_list' +require 'course_info' class CoursesController < ApplicationController before_action :set_organization diff --git a/app/controllers/exercises_controller.rb b/app/controllers/exercises_controller.rb index b0d7d81c6..d9e634818 100644 --- a/app/controllers/exercises_controller.rb +++ b/app/controllers/exercises_controller.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require 'submission_list' + class ExercisesController < ApplicationController def show @exercise = Exercise.find(params[:id]) diff --git a/app/controllers/full_zip_controller.rb b/app/controllers/full_zip_controller.rb index 8927da7a2..8988a5861 100644 --- a/app/controllers/full_zip_controller.rb +++ b/app/controllers/full_zip_controller.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require 'submission_packager' + class FullZipController < ApplicationController def index submission = Submission.find(params[:submission_id]) diff --git a/app/controllers/migrate_to_other_course_controller.rb b/app/controllers/migrate_to_other_course_controller.rb index 29cce6f71..861b8bedd 100644 --- a/app/controllers/migrate_to_other_course_controller.rb +++ b/app/controllers/migrate_to_other_course_controller.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require 'student_submission_migrator' + class MigrateToOtherCourseController < ApplicationController def show @old_course = Course.find(params[:course_id]) @@ -11,7 +13,7 @@ def show @already_migrated = already_migrated @extra_alert_text = get_extra_text return respond_with_error('Please login to continue') if current_user.guest? - return respond_with_error('This migration is not allowed') unless StudentSubmissionMigrator.new(@old_course, @to_course, current_user).migration_is_allowed + respond_with_error('This migration is not allowed') unless StudentSubmissionMigrator.new(@old_course, @to_course, current_user).migration_is_allowed end def migrate diff --git a/app/controllers/setup/course_details_controller.rb b/app/controllers/setup/course_details_controller.rb index b1cd448e0..e46aa4c85 100644 --- a/app/controllers/setup/course_details_controller.rb +++ b/app/controllers/setup/course_details_controller.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require 'course_refresh_database_updater' + class Setup::CourseDetailsController < Setup::SetupController before_action :set_course, except: %i[new create] diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index f1c102983..acdc9ccef 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -80,7 +80,7 @@ def bs_labeled_field(label, field, options = {}) str << " #{field}#{label}" str << '' else - label_title = options[:label_title] ? options[:label_title] : nil + label_title = options[:label_title] || nil label = label_tag label, label_title, class: 'control-label' str += raw('