diff --git a/.gitpod.dockerfile b/.gitpod.dockerfile index ea7b4b646..1e849a046 100644 --- a/.gitpod.dockerfile +++ b/.gitpod.dockerfile @@ -1,7 +1,7 @@ FROM gitpod/workspace-postgres # Install Ruby -ENV RUBY_VERSION=3.0.6 +ENV RUBY_VERSION=3.1.4 # Install the GitHub CLI RUN brew install gh diff --git a/.ruby-version b/.ruby-version index 818bd47ab..0aec50e6e 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.0.6 +3.1.4 diff --git a/Containerfile b/Containerfile index 6db832193..1cd2fd9db 100644 --- a/Containerfile +++ b/Containerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/forem/ruby:3.0.6@sha256:287260a9c729fcd4f7952c551f8320cfe484db9d1e3ac77986b175b959aba715 as base +FROM ghcr.io/forem/ruby:3.1.4@sha256:d072fde5b0bb0f1374e308f7fcf1283e379e2a28a61f6e56df87b25a7dfdd5bf as base FROM base as builder diff --git a/Containerfile.base b/Containerfile.base index 591001291..706897588 100644 --- a/Containerfile.base +++ b/Containerfile.base @@ -1,4 +1,4 @@ -ARG RUBY_VERSION=3.0.6 +ARG RUBY_VERSION=3.1.4 ARG DEBIAN_VERSION=bullseye FROM public.ecr.aws/docker/library/ruby:${RUBY_VERSION}-slim-${DEBIAN_VERSION} AS ruby-upstream diff --git a/Gemfile.lock b/Gemfile.lock index abe9c23ae..e44f10318 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1127,7 +1127,7 @@ DEPENDENCIES zonebie (~> 0.6.1) RUBY VERSION - ruby 3.0.6p216 + ruby 3.1.4p223 BUNDLED WITH 2.4.17 diff --git a/app/models/settings/base.rb b/app/models/settings/base.rb index 39468e74a..c2699f369 100644 --- a/app/models/settings/base.rb +++ b/app/models/settings/base.rb @@ -153,7 +153,7 @@ module Settings # get the setting's value, YAML decoded def value - YAML.load(self[:value]) if self[:value].present? # rubocop:disable Security/YAMLLoad + YAML.unsafe_load(self[:value]) if self[:value].present? end # set the settings's value, YAML encoded diff --git a/db/migrate/20171229192205_change_last_moderation_notification_default_on_user.rb b/db/migrate/20171229192205_change_last_moderation_notification_default_on_user.rb index 57e67f79f..642a1c206 100644 --- a/db/migrate/20171229192205_change_last_moderation_notification_default_on_user.rb +++ b/db/migrate/20171229192205_change_last_moderation_notification_default_on_user.rb @@ -1,9 +1,9 @@ class ChangeLastModerationNotificationDefaultOnUser < ActiveRecord::Migration[5.1] def up - change_column_default :users, :last_moderation_notification, Time.new("2017-01-01") + change_column_default :users, :last_moderation_notification, Time.new(2017,1,1) end def down - change_column_default :users, :last_moderation_notification, Time.new("2017-01-01") + change_column_default :users, :last_moderation_notification, Time.new(2017,1,1) end end diff --git a/spec/models/ab_experiment_spec.rb b/spec/models/ab_experiment_spec.rb index c9818b562..1165856ee 100644 --- a/spec/models/ab_experiment_spec.rb +++ b/spec/models/ab_experiment_spec.rb @@ -16,7 +16,7 @@ RSpec.describe AbExperiment do describe "validate field test experiment configuration" do it "only allow at most one active feed_strategy (e.g. an experiment without a winner)" do - field_tests = Psych.load(Rails.root.join("config/field_test.yml").read) + field_tests = Psych.load(Rails.root.join("config/field_test.yml").read, permitted_classes: [Date]) active_field_tests = field_tests.fetch("experiments", {}) .select { |key, values| key.start_with?("feed_strategy") && !values["winner"] } diff --git a/spec/models/article_spec.rb b/spec/models/article_spec.rb index 6e1405d41..daa876659 100644 --- a/spec/models/article_spec.rb +++ b/spec/models/article_spec.rb @@ -776,7 +776,7 @@ RSpec.describe Article do end it "returns true if parser raises a Psych::DisallowedClass error" do - allow(FrontMatterParser::Parser).to receive(:new).and_raise(Psych::DisallowedClass.new("msg")) + allow(FrontMatterParser::Parser).to receive(:new).and_raise(Psych::DisallowedClass.new("msg", Date)) expect(article.has_frontmatter?).to be(true) end diff --git a/uffizzi/Dockerfile b/uffizzi/Dockerfile index 1752a2248..74dddae0f 100644 --- a/uffizzi/Dockerfile +++ b/uffizzi/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/forem/ruby:3.0.6@sha256:287260a9c729fcd4f7952c551f8320cfe484db9d1e3ac77986b175b959aba715 as base +FROM ghcr.io/forem/ruby:3.1.4@sha256:d072fde5b0bb0f1374e308f7fcf1283e379e2a28a61f6e56df87b25a7dfdd5bf as base FROM base as builder