Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Ruby 3.0 and Ubuntu 22.04 #24

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -12,7 +12,8 @@ runs:
shell: bash
run: |
gem install bundler -v 2.3.27
bundle install --jobs 4 --retry 3 --path vendor/bundle
bundle config set --local path 'vendor/bundle'
bundle install --jobs 4 --retry 3

- name: Setup database
shell: bash
96 changes: 48 additions & 48 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ on:

jobs:
bundle-audit:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

services:
postgres:
@@ -32,15 +32,15 @@ jobs:
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: "3.0"

- name: Setup gem cache
uses: actions/cache@v4
with:
path: vendor/bundle
key: ubuntu-20.04-gems-${{ hashFiles('/Gemfile.lock') }}
key: ubuntu-22.04-gems-${{ hashFiles('/Gemfile.lock') }}
restore-keys: |
ubuntu-20.04-gems-
ubuntu-22.04-gems-

- name: Setup
uses: ./.github/actions/setup
@@ -50,7 +50,7 @@ jobs:
bundle exec rake bundle:audit

brakeman:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

services:
postgres:
@@ -74,15 +74,15 @@ jobs:
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: "3.0"

- name: Setup gem cache
uses: actions/cache@v4
with:
path: vendor/bundle
key: ubuntu-20.04-gems-${{ hashFiles('/Gemfile.lock') }}
key: ubuntu-22.04-gems-${{ hashFiles('/Gemfile.lock') }}
restore-keys: |
ubuntu-20.04-gems-
ubuntu-22.04-gems-

- name: Setup
uses: ./.github/actions/setup
@@ -92,7 +92,7 @@ jobs:
bundle exec rake brakeman:check

spec-admin-controllers:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

services:
postgres:
@@ -116,15 +116,15 @@ jobs:
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: "3.0"

- name: Setup gem cache
uses: actions/cache@v4
with:
path: vendor/bundle
key: ubuntu-20.04-gems-${{ hashFiles('/Gemfile.lock') }}
key: ubuntu-22.04-gems-${{ hashFiles('/Gemfile.lock') }}
restore-keys: |
ubuntu-20.04-gems-
ubuntu-22.04-gems-

- name: Setup
uses: ./.github/actions/setup
@@ -138,7 +138,7 @@ jobs:
bundle exec rake spec:controllers

spec-public-controllers:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

services:
postgres:
@@ -162,15 +162,15 @@ jobs:
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: "3.0"

- name: Setup gem cache
uses: actions/cache@v4
with:
path: vendor/bundle
key: ubuntu-20.04-gems-${{ hashFiles('/Gemfile.lock') }}
key: ubuntu-22.04-gems-${{ hashFiles('/Gemfile.lock') }}
restore-keys: |
ubuntu-20.04-gems-
ubuntu-22.04-gems-

- name: Setup
uses: ./.github/actions/setup
@@ -184,7 +184,7 @@ jobs:
bundle exec rake spec:controllers

spec-jobs:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

services:
postgres:
@@ -208,15 +208,15 @@ jobs:
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: "3.0"

- name: Setup gem cache
uses: actions/cache@v4
with:
path: vendor/bundle
key: ubuntu-20.04-gems-${{ hashFiles('/Gemfile.lock') }}
key: ubuntu-22.04-gems-${{ hashFiles('/Gemfile.lock') }}
restore-keys: |
ubuntu-20.04-gems-
ubuntu-22.04-gems-

- name: Setup
uses: ./.github/actions/setup
@@ -230,7 +230,7 @@ jobs:
bundle exec rake spec:jobs

spec-mailers:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

services:
postgres:
@@ -254,15 +254,15 @@ jobs:
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: "3.0"

- name: Setup gem cache
uses: actions/cache@v4
with:
path: vendor/bundle
key: ubuntu-20.04-gems-${{ hashFiles('/Gemfile.lock') }}
key: ubuntu-22.04-gems-${{ hashFiles('/Gemfile.lock') }}
restore-keys: |
ubuntu-20.04-gems-
ubuntu-22.04-gems-

- name: Setup
uses: ./.github/actions/setup
@@ -276,7 +276,7 @@ jobs:
bundle exec rake spec

spec-models:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

services:
postgres:
@@ -300,15 +300,15 @@ jobs:
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: "3.0"

- name: Setup gem cache
uses: actions/cache@v4
with:
path: vendor/bundle
key: ubuntu-20.04-gems-${{ hashFiles('/Gemfile.lock') }}
key: ubuntu-22.04-gems-${{ hashFiles('/Gemfile.lock') }}
restore-keys: |
ubuntu-20.04-gems-
ubuntu-22.04-gems-

- name: Setup
uses: ./.github/actions/setup
@@ -322,7 +322,7 @@ jobs:
bundle exec rake spec

spec-requests:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

services:
postgres:
@@ -346,15 +346,15 @@ jobs:
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: "3.0"

- name: Setup gem cache
uses: actions/cache@v4
with:
path: vendor/bundle
key: ubuntu-20.04-gems-${{ hashFiles('/Gemfile.lock') }}
key: ubuntu-22.04-gems-${{ hashFiles('/Gemfile.lock') }}
restore-keys: |
ubuntu-20.04-gems-
ubuntu-22.04-gems-

- name: Setup
uses: ./.github/actions/setup
@@ -368,7 +368,7 @@ jobs:
bundle exec rake spec

spec-other:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

services:
postgres:
@@ -392,15 +392,15 @@ jobs:
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: "3.0"

- name: Setup gem cache
uses: actions/cache@v4
with:
path: vendor/bundle
key: ubuntu-20.04-gems-${{ hashFiles('/Gemfile.lock') }}
key: ubuntu-22.04-gems-${{ hashFiles('/Gemfile.lock') }}
restore-keys: |
ubuntu-20.04-gems-
ubuntu-22.04-gems-

- name: Setup
uses: ./.github/actions/setup
@@ -414,7 +414,7 @@ jobs:
bundle exec rake spec

javascript:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

services:
postgres:
@@ -438,15 +438,15 @@ jobs:
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: "3.0"

- name: Setup gem cache
uses: actions/cache@v4
with:
path: vendor/bundle
key: ubuntu-20.04-gems-${{ hashFiles('/Gemfile.lock') }}
key: ubuntu-22.04-gems-${{ hashFiles('/Gemfile.lock') }}
restore-keys: |
ubuntu-20.04-gems-
ubuntu-22.04-gems-

- name: Setup
uses: ./.github/actions/setup
@@ -459,7 +459,7 @@ jobs:
bundle exec rake jasmine:ci

cucumber-admin:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

services:
postgres:
@@ -483,15 +483,15 @@ jobs:
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: "3.0"

- name: Setup gem cache
uses: actions/cache@v4
with:
path: vendor/bundle
key: ubuntu-20.04-gems-${{ hashFiles('/Gemfile.lock') }}
key: ubuntu-22.04-gems-${{ hashFiles('/Gemfile.lock') }}
restore-keys: |
ubuntu-20.04-gems-
ubuntu-22.04-gems-

- name: Setup
uses: ./.github/actions/setup
@@ -506,7 +506,7 @@ jobs:
bundle exec rake cucumber

cucumber-public:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

services:
postgres:
@@ -530,15 +530,15 @@ jobs:
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: "3.0"

- name: Setup gem cache
uses: actions/cache@v4
with:
path: vendor/bundle
key: ubuntu-20.04-gems-${{ hashFiles('/Gemfile.lock') }}
key: ubuntu-22.04-gems-${{ hashFiles('/Gemfile.lock') }}
restore-keys: |
ubuntu-20.04-gems-
ubuntu-22.04-gems-

- name: Setup
uses: ./.github/actions/setup
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ gem 'dotenv-rails', require: 'dotenv/rails-now'
gem 'rails', '6.1.7.7'

gem 'rake'
gem 'pg'
gem 'pg', '< 1.5'
gem 'authlogic'
gem 'will_paginate'
gem 'json'
@@ -34,6 +34,7 @@ gem 'image_processing'
gem 'maxminddb'
gem 'redcarpet'
gem 'scrypt'
gem 'webrick'

gem 'aws-sdk-codedeploy'
gem 'aws-sdk-cloudwatchlogs'
154 changes: 89 additions & 65 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -60,7 +60,7 @@ GEM
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
addressable (2.8.5)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
appsignal (3.4.13)
rack
@@ -69,29 +69,30 @@ GEM
activerecord (>= 5.2, < 7.2)
activesupport (>= 5.2, < 7.2)
request_store (~> 1.0)
aws-eventstream (1.1.1)
aws-partitions (1.441.0)
aws-sdk-cloudwatchlogs (1.6.0)
aws-sdk-core (~> 3)
aws-sigv4 (~> 1.0)
aws-sdk-codedeploy (1.18.0)
aws-sdk-core (~> 3, >= 3.48.2)
aws-eventstream (1.3.0)
aws-partitions (1.888.0)
aws-sdk-cloudwatchlogs (1.79.0)
aws-sdk-core (~> 3, >= 3.191.0)
aws-sigv4 (~> 1.1)
aws-sdk-core (3.113.1)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.239.0)
aws-sdk-codedeploy (1.64.0)
aws-sdk-core (~> 3, >= 3.191.0)
aws-sigv4 (~> 1.1)
jmespath (~> 1.0)
aws-sdk-kms (1.43.0)
aws-sdk-core (~> 3, >= 3.112.0)
aws-sdk-core (3.191.1)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.8)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.77.0)
aws-sdk-core (~> 3, >= 3.191.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.93.0)
aws-sdk-core (~> 3, >= 3.112.0)
aws-sdk-s3 (1.143.0)
aws-sdk-core (~> 3, >= 3.191.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.1)
aws-sigv4 (1.2.3)
aws-sigv4 (~> 1.8)
aws-sigv4 (1.8.0)
aws-eventstream (~> 1, >= 1.0.2)
bcrypt (3.1.16)
bigdecimal (3.1.6)
brakeman (5.1.1)
builder (3.2.4)
bundler-audit (0.8.0)
@@ -107,10 +108,11 @@ GEM
regexp_parser (>= 1.5, < 3.0)
xpath (~> 3.2)
chronic (0.10.2)
coderay (1.1.2)
concurrent-ruby (1.2.2)
connection_pool (2.2.1)
crack (0.4.5)
coderay (1.1.3)
concurrent-ruby (1.2.3)
connection_pool (2.4.1)
crack (0.4.6)
bigdecimal
rexml
crass (1.0.6)
cucumber (2.4.0)
@@ -140,7 +142,7 @@ GEM
delayed_job_active_record (4.1.8)
activerecord (>= 3.0, < 8.0)
delayed_job (>= 3.0, < 5)
diff-lcs (1.4.4)
diff-lcs (1.5.1)
docile (1.3.1)
dotenv (2.7.6)
dotenv-rails (2.7.6)
@@ -159,18 +161,39 @@ GEM
railties (>= 5.0.0)
faker (3.1.1)
i18n (>= 1.8.11, < 2)
faraday (0.17.6)
multipart-post (>= 1.2, < 3)
faraday_middleware (0.12.2)
faraday (>= 0.7.4, < 1.0)
faraday (1.10.3)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
faraday-excon (~> 1.1)
faraday-httpclient (~> 1.0)
faraday-multipart (~> 1.0)
faraday-net_http (~> 1.0)
faraday-net_http_persistent (~> 1.0)
faraday-patron (~> 1.0)
faraday-rack (~> 1.0)
faraday-retry (~> 1.0)
ruby2_keywords (>= 0.0.4)
faraday-em_http (1.0.0)
faraday-em_synchrony (1.0.0)
faraday-excon (1.1.0)
faraday-httpclient (1.0.1)
faraday-multipart (1.0.4)
multipart-post (~> 2)
faraday-net_http (1.0.1)
faraday-net_http_persistent (1.2.0)
faraday-patron (1.0.0)
faraday-rack (1.0.0)
faraday-retry (1.0.3)
faraday_middleware (1.2.0)
faraday (~> 1.0)
ffi (1.15.5)
ffi-compiler (1.0.1)
ffi (>= 1.0.0)
rake
gherkin (4.1.3)
globalid (1.2.1)
activesupport (>= 6.1)
hashdiff (1.0.1)
hashdiff (1.1.0)
htmlentities (4.3.4)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
@@ -180,7 +203,7 @@ GEM
jbuilder (2.11.5)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
jmespath (1.6.1)
jmespath (1.6.2)
jquery-rails (4.4.0)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
@@ -196,7 +219,7 @@ GEM
logstash-event (1.2.02)
logstash-logger (0.26.1)
logstash-event (~> 1.2)
loofah (2.21.4)
loofah (2.22.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
mail (2.8.1)
@@ -210,12 +233,11 @@ GEM
method_source (1.0.0)
mini_magick (4.11.0)
mini_mime (1.1.5)
mini_portile2 (2.8.4)
minitest (5.20.0)
minitest (5.22.2)
multi_json (1.14.1)
multi_test (0.1.2)
multipart-post (2.3.0)
net-http-persistent (3.0.0)
multipart-post (2.4.0)
net-http-persistent (4.0.2)
connection_pool (~> 2.2)
net-imap (0.4.1)
date
@@ -227,23 +249,22 @@ GEM
net-smtp (0.4.0)
net-protocol
nio4r (2.7.0)
nokogiri (1.15.4)
mini_portile2 (~> 2.8.2)
nokogiri (1.16.2-aarch64-linux)
racc (~> 1.4)
nokogiri (1.15.4-arm64-darwin)
nokogiri (1.16.2-arm64-darwin)
racc (~> 1.4)
nokogiri (1.15.4-x86_64-darwin)
nokogiri (1.16.2-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.15.4-x86_64-linux)
nokogiri (1.16.2-x86_64-linux)
racc (~> 1.4)
pg (1.2.3)
pry (0.13.1)
pg (1.4.6)
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (5.0.3)
public_suffix (5.0.4)
puma (5.6.8)
nio4r (~> 2.0)
racc (1.7.1)
racc (1.7.3)
rack (2.2.8)
rack-test (2.1.0)
rack (>= 1.3)
@@ -279,7 +300,7 @@ GEM
method_source
rake (>= 12.2)
thor (~> 1.0)
rake (13.0.6)
rake (13.1.0)
rb-fsevent (0.10.4)
rb-inotify (0.10.1)
ffi (~> 1.0)
@@ -288,25 +309,26 @@ GEM
request_store (1.5.0)
rack (>= 1.4)
rexml (3.2.6)
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.0)
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.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.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.10.2)
rspec-support (~> 3.13.0)
rspec-rails (6.1.1)
actionpack (>= 6.1)
activesupport (>= 6.1)
railties (>= 6.1)
rspec-core (~> 3.12)
rspec-expectations (~> 3.12)
rspec-mocks (~> 3.12)
rspec-support (~> 3.12)
rspec-support (3.13.0)
ruby-vips (2.1.4)
ffi (~> 1.12)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
sass (3.7.4)
sass-listen (~> 4.0.0)
@@ -325,14 +347,14 @@ GEM
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
shoulda-matchers (5.3.0)
shoulda-matchers (6.1.0)
activesupport (>= 5.2.0)
simplecov (0.16.1)
docile (~> 1.1)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
slack-notifier (2.3.2)
slack-notifier (2.4.0)
sprockets (3.7.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
@@ -349,10 +371,11 @@ GEM
concurrent-ruby (~> 1.0)
uglifier (4.1.8)
execjs (>= 0.3.0, < 3)
webmock (3.18.1)
webmock (3.20.0)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
webrick (1.8.1)
websocket (1.2.10)
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
@@ -362,11 +385,11 @@ GEM
will_paginate (3.3.1)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.6.12)
zeitwerk (2.6.13)

PLATFORMS
aarch64-linux
arm64-darwin
ruby
x86_64-darwin
x86_64-linux

@@ -404,7 +427,7 @@ DEPENDENCIES
maxminddb
net-http-persistent
nokogiri
pg
pg (< 1.5)
pry
puma (< 6)
rails (= 6.1.7.7)
@@ -421,6 +444,7 @@ DEPENDENCIES
textacular
uglifier
webmock
webrick
whenever
will_paginate

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ This is the code base for the [UK Government and Parliament's petitions service]

## Setup

We recommend using [Docker Desktop][2] to get setup quickly. If you'd prefer not to use Docker then you'll need Ruby (2.7+), Node (12+), PostgreSQL (10+) and Memcached (1.5+) installed.
We recommend using [Docker Desktop][2] to get setup quickly. If you'd prefer not to use Docker then you'll need Ruby (3.0+), Node (20+), PostgreSQL (12+) and Memcached (1.5+) installed.

### Create the databases

2 changes: 1 addition & 1 deletion app/jobs/archived/deliver_petition_email_job.rb
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ class DeliverPetitionEmailJob < ApplicationJob

attr_reader :email

def perform(**args)
def perform(args)
@email = args[:email]
super
end
2 changes: 1 addition & 1 deletion app/jobs/archived/deliver_petition_mailshot_job.rb
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ class DeliverPetitionMailshotJob < ApplicationJob

attr_reader :mailshot

def perform(**args)
def perform(args)
@mailshot = args[:mailshot]
super
end
2 changes: 1 addition & 1 deletion app/jobs/archived/email_constituency_job.rb
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ class EmailConstituencyJob < ApplicationJob
log_exception(exception)
end

def perform(**args)
def perform(args)
@mailshot = args[:mailshot]
super
end
2 changes: 1 addition & 1 deletion app/jobs/archived/email_petitioners_job.rb
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ class EmailPetitionersJob < ApplicationJob
)
end

def perform(**args)
def perform(args)
@email = args[:email]
super
end
2 changes: 1 addition & 1 deletion app/jobs/concerns/email_all_petition_signatories.rb
Original file line number Diff line number Diff line change
@@ -58,7 +58,7 @@ def random_interval
end
end

def perform(**args)
def perform(args)
@petition = args[:petition]
@requested_at = args[:requested_at]
@scope = args[:scope]
2 changes: 1 addition & 1 deletion app/jobs/concerns/email_delivery.rb
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ module EmailDelivery
end
end

def perform(**args)
def perform(args)
@signature = args[:signature]
@petition = args[:petition]
@requested_at = args[:requested_at].in_time_zone
2 changes: 1 addition & 1 deletion app/jobs/deliver_petition_email_job.rb
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ class DeliverPetitionEmailJob < ApplicationJob

attr_reader :email

def perform(**args)
def perform(args)
@email = args[:email]
super
end
2 changes: 1 addition & 1 deletion app/jobs/deliver_petition_mailshot_job.rb
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ class DeliverPetitionMailshotJob < ApplicationJob

attr_reader :mailshot

def perform(**args)
def perform(args)
@mailshot = args[:mailshot]
super
end
2 changes: 1 addition & 1 deletion app/jobs/email_constituency_job.rb
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ class EmailConstituencyJob < ApplicationJob
log_exception(exception)
end

def perform(**args)
def perform(args)
@mailshot = args[:mailshot]
super
end
2 changes: 1 addition & 1 deletion app/jobs/email_petitioners_job.rb
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ class EmailPetitionersJob < ApplicationJob
)
end

def perform(**args)
def perform(args)
@email = args[:email]
super
end
2 changes: 1 addition & 1 deletion app/mailers/archived/petition_mailer.rb
Original file line number Diff line number Diff line change
@@ -106,7 +106,7 @@ def notify_creator_of_debate_outcome(petition, signature)
private

def subject_for(key, options = {})
I18n.t key, i18n_options.merge(options)
I18n.t key, **(i18n_options.merge(options))
end

def signature_belongs_to_creator?
7 changes: 3 additions & 4 deletions docker/mailcatcher/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
FROM ruby:2.7
FROM ruby:3.0-bullseye

ARG VERSION=0.8.2
ARG VERSION=0.9.0

RUN gem install sqlite3 -v 1.6.9 && \
gem install mailcatcher -v $VERSION
RUN gem install mailcatcher -v $VERSION

EXPOSE 1025 1080

44 changes: 21 additions & 23 deletions docker/ruby/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,35 +1,33 @@
FROM ruby:2.7
FROM ruby:3.0-bullseye

ENV BUNDLE_PATH=/bundle

# Install PostgreSQL client
RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main' \
> /etc/apt/sources.list.d/pgdg.list && \
wget -q -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc \
| apt-key add - && apt-get update && \
apt-get install -y postgresql-client-12

# Install NodeJS
ENV PATH=/usr/local/node/bin:$PATH
RUN curl -sL https://github.com/nodenv/node-build/archive/master.tar.gz | tar xz -C /tmp/ && \
/tmp/node-build-master/bin/node-build "18.16.0" /usr/local/node && \
npm install -g yarn@1.22.19 && \
rm -rf /tmp/node-build-master

# Install Bundler
RUN gem install bundler -v 2.3.27
# Install apt signing keys
RUN wget --quiet -O - https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | \
gpg --dearmor -o /usr/share/keyrings/nodesource.gpg && \
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | \
gpg --dearmor -o /usr/share/keyrings/pgdg.gpg

# Install Chromium and Chromium-Driver
RUN apt-get install -y chromium chromium-driver
# Add apt repositories
RUN echo 'deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main' \
> /etc/apt/sources.list.d/nodesource.list && \
echo 'deb [signed-by=/usr/share/keyrings/pgdg.gpg] http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main' \
> /etc/apt/sources.list.d/pgdg.list && \
apt-get update

# Link chromedriver so the webdrivers gem finds it
RUN mkdir -p /root/.webdrivers && \
ln -nfs /usr/bin/chromedriver /root/.webdrivers/chromedriver && \
/usr/bin/chromedriver --version | cut -d ' ' -f 2 | cat > /root/.webdrivers/chromedriver.version
# Install packages
RUN apt-get install -y --no-install-recommends \
chromium chromium-driver nodejs postgresql-client-12

# Create the crash reports directory - without it Chromium complains on startup
RUN mkdir -p "/root/.config/chromium/Crash Reports/pending/"

# Install NPM
RUN npm install -g npm@10

# Install Bundler
RUN gem install bundler -v 2.3.27

WORKDIR /app

COPY ./docker-entrypoint.sh /docker-entrypoint.sh
2 changes: 1 addition & 1 deletion docker/ruby/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ echo 'Connected to postgres...'
if [ "$1" = "bash" ]; then
exec "$@"
else
yarn install
npm install --no-fund --no-audit
bundle check || bundle install

exec bundle exec "$@"
3 changes: 2 additions & 1 deletion features/support/custom_env.rb
Original file line number Diff line number Diff line change
@@ -60,7 +60,8 @@

pid = Process.spawn('bin/local_proxy', out: 'log/proxy.log', err: 'log/proxy.log')
Process.detach(pid)
at_exit { Process.kill('INT', pid) }

at_exit { Process.kill('INT', pid) rescue nil }

module CucumberI18n
def t(*args)
4 changes: 3 additions & 1 deletion lib/package_builder/scripts/after_install.sh
Original file line number Diff line number Diff line change
@@ -11,7 +11,9 @@ ln -nfs /home/deploy/epetitions/shared/bundle /home/deploy/epetitions/releases/<
ln -nfs /home/deploy/epetitions/shared/assets /home/deploy/epetitions/releases/<%= release %>/public/assets
ln -s /home/deploy/epetitions/releases/<%= release %> /home/deploy/epetitions/current_<%= release %>
mv -Tf /home/deploy/epetitions/current_<%= release %> /home/deploy/epetitions/current
cd /home/deploy/epetitions/current && bundle install --without development test --deployment --quiet
cd /home/deploy/epetitions/current && bundle config set --local deployment 'true'
cd /home/deploy/epetitions/current && bundle config set --local without 'development test'
cd /home/deploy/epetitions/current && bundle install --quiet
cd /home/deploy/epetitions/current && bundle exec rake db:migrate
cd /home/deploy/epetitions/current && bundle exec rake assets:precompile
if [ ${SERVER_TYPE} = "worker" ] ; then cd /home/deploy/epetitions/current && bundle exec whenever -w ; else echo not running whenever ; fi
2 changes: 1 addition & 1 deletion lib/tasks/bundle.rake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace :bundle do
desc "Audit bundle for any known vulnerabilities"
task :audit do
unless system "bundle-audit check --update -i GHSA-xc9x-jj77-9p9j"
unless system "bundle-audit check"
exit 1
end
end
1,366 changes: 1,366 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

878 changes: 0 additions & 878 deletions yarn.lock

This file was deleted.