diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index fde032a69..b4d4f697d 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -38,7 +38,6 @@ jobs: env: RAILS_ENV: test - GEMFILE_RUBY_VERSION: 3.1.1 DB_HOST: localhost DB_DATABASE: data_collector DB_USERNAME: postgres @@ -59,7 +58,7 @@ jobs: uses: actions/setup-node@v4 with: cache: yarn - node-version: 20 + node-version: 24 # This is temporary to fix flaky parallel tests due to `secret_key_base` being read before it's set - name: Create local secret @@ -102,7 +101,6 @@ jobs: env: RAILS_ENV: test - GEMFILE_RUBY_VERSION: 3.1.1 DB_HOST: localhost DB_DATABASE: data_collector DB_USERNAME: postgres @@ -122,7 +120,7 @@ jobs: uses: actions/setup-node@v4 with: cache: yarn - node-version: 20 + node-version: 24 - name: Create database run: | @@ -160,7 +158,6 @@ jobs: env: RAILS_ENV: test - GEMFILE_RUBY_VERSION: 3.1.1 DB_HOST: localhost DB_DATABASE: data_collector DB_USERNAME: postgres @@ -180,7 +177,7 @@ jobs: uses: actions/setup-node@v4 with: cache: yarn - node-version: 20 + node-version: 24 - name: Create database run: | @@ -218,7 +215,6 @@ jobs: env: RAILS_ENV: test - GEMFILE_RUBY_VERSION: 3.1.1 DB_HOST: localhost DB_DATABASE: data_collector DB_USERNAME: postgres @@ -239,7 +235,7 @@ jobs: uses: actions/setup-node@v4 with: cache: yarn - node-version: 20 + node-version: 24 - name: Create local secret run: | @@ -281,7 +277,6 @@ jobs: env: RAILS_ENV: test - GEMFILE_RUBY_VERSION: 3.1.1 DB_HOST: localhost DB_DATABASE: data_collector DB_USERNAME: postgres @@ -302,7 +297,7 @@ jobs: uses: actions/setup-node@v4 with: cache: yarn - node-version: 20 + node-version: 24 - name: Create local secret run: | @@ -344,7 +339,6 @@ jobs: env: RAILS_ENV: test - GEMFILE_RUBY_VERSION: 3.1.1 DB_HOST: localhost DB_DATABASE: data_collector DB_USERNAME: postgres @@ -365,7 +359,7 @@ jobs: uses: actions/setup-node@v4 with: cache: yarn - node-version: 20 + node-version: 24 - name: Create database run: | @@ -396,7 +390,7 @@ jobs: uses: actions/setup-node@v4 with: cache: yarn - node-version: 20 + node-version: 24 - name: Install packages and symlink local dependencies run: | diff --git a/.nvmrc b/.nvmrc index 209e3ef4b..a45fd52cc 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -20 +24 diff --git a/.ruby-version b/.ruby-version index f9892605c..7bcbb3808 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.4.4 +3.4.9 diff --git a/Dockerfile b/Dockerfile index 88a7e6a79..ce24943c2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,10 @@ -FROM ruby:3.4.4-alpine3.20 as base +FROM ruby:3.4.9-alpine3.23 as base WORKDIR /app +# Upgrade base packages to pick up latest security patches +RUN apk upgrade --no-cache + # Add the timezone as it's not configured by default in Alpine RUN apk add --update --no-cache tzdata && \ cp /usr/share/zoneinfo/Europe/London /etc/localtime && \ @@ -10,7 +13,7 @@ RUN apk add --update --no-cache tzdata && \ # build-base: compilation tools for bundle # yarn: node package manager # postgresql-dev: postgres driver and libraries -RUN apk add --no-cache build-base=0.5-r3 busybox=1.36.1-r29 nodejs=20.15.1-r0 yarn=1.22.22-r0 bash=5.2.26-r0 libpq-dev yaml-dev linux-headers +RUN apk add --no-cache build-base busybox nodejs yarn bash libpq-dev yaml-dev linux-headers # Bundler version should be the same version as what the Gemfile.lock was bundled with RUN gem install bundler:2.6.4 --no-document @@ -40,14 +43,14 @@ RUN bundle config set without "" RUN bundle install --jobs=4 --no-binstubs --no-cache # Install gecko driver for Capybara tests -RUN apk add firefox +RUN apk add firefox=145.0-r0 RUN wget https://github.com/mozilla/geckodriver/releases/download/v0.31.0/geckodriver-v0.31.0-linux64.tar.gz \ && tar -xvzf geckodriver-v0.31.0-linux64.tar.gz \ && rm geckodriver-v0.31.0-linux64.tar.gz \ && chmod +x geckodriver \ && mv geckodriver /usr/local/bin/ -CMD bundle exec rake parallel:setup && bundle exec rake parallel:spec +CMD ["sh", "-c", "bundle exec rake parallel:setup && bundle exec rake parallel:spec"] FROM base as development @@ -61,7 +64,7 @@ RUN bundle install --jobs=4 --no-binstubs --no-cache USER nonroot -CMD bundle exec rails s -e ${RAILS_ENV} -p ${PORT} --binding=0.0.0.0 +CMD ["sh", "-c", "bundle exec rails s -e ${RAILS_ENV} -p ${PORT} --binding=0.0.0.0"] FROM base as production @@ -75,4 +78,4 @@ RUN chown -R nonroot performance_test USER nonroot -CMD bundle exec rails s -e ${RAILS_ENV} -p ${PORT} --binding=0.0.0.0 +CMD ["sh", "-c", "bundle exec rails s -e ${RAILS_ENV} -p ${PORT} --binding=0.0.0.0"] diff --git a/Gemfile b/Gemfile index 91ed6c8a8..c76a48bec 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,7 @@ source "https://rubygems.org" git_source(:github) { |repo| "https://github.com/#{repo}.git" } -ruby "3.4.4" +ruby "3.4.9" # Bundle edge Rails instead: gem 'rails', github: 'rails/rails', branch: 'main' gem "rails", "~> 7.2.2" diff --git a/Gemfile.lock b/Gemfile.lock index 85aa27b6d..c83c95414 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -648,7 +648,7 @@ DEPENDENCIES webmock RUBY VERSION - ruby 3.4.4p0 + ruby 3.4.9p82 BUNDLED WITH 2.6.4 diff --git a/docs/setup.md b/docs/setup.md index 8bf9c635f..9f66e234c 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -70,21 +70,19 @@ We recommend using [nvm](https://github.com/nvm-sh/nvm) to manage NodeJS version 4. Install Ruby and Bundler ```bash - rbenv install 3.4.4 - rbenv global 3.4.4 + rbenv install 3.4.9 + rbenv global 3.4.9 source ~/.bashrc gem install bundler ``` 5. Install JavaScript dependencies - Note that we currently use node v16, which is no longer the latest LTS version so you will need to specify the version number when installing - macOS (using nvm): ```bash - nvm install 20 - nvm use 20 + nvm install 24 + nvm use 24 brew install yarn ``` diff --git a/package.json b/package.json index c2efb5da1..837240f58 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "data-collector", "private": true, "engines": { - "node": "^20.0.0" + "node": "^24.0.0" }, "dependencies": { "@babel/core": "^7.17.7",