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

Bump Ruby to 3.3.0 and Alpine to 3.19 #561

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.16.0
20.10.0
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.2.2
3.3.0
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM ruby:3.2.2-alpine3.18@sha256:198e97ccb12cd0297c274d10e504138f412f90bed50c36ebde0a466ab89cf526 AS build
FROM ruby:3.3.0-alpine3.19@sha256:203b3087530e9cb117d8aab9b49bb766253fd8a6606a0d7520a591c7a3d992f7 AS build

WORKDIR /app

RUN apk update
RUN apk upgrade --available
RUN apk add libc6-compat openssl-dev build-base libpq-dev nodejs=~18 npm git
RUN apk add libc6-compat openssl-dev build-base libpq-dev nodejs=~20 npm git
RUN adduser -D ruby
RUN mkdir /node_modules && chown ruby:ruby -R /node_modules /app

Expand Down Expand Up @@ -38,7 +38,7 @@ RUN npm ci --ignore-scripts --only=production

CMD ["bash"]

FROM ruby:3.2.2-alpine3.18@sha256:198e97ccb12cd0297c274d10e504138f412f90bed50c36ebde0a466ab89cf526 AS app
FROM ruby:3.3.0-alpine3.19@sha256:203b3087530e9cb117d8aab9b49bb766253fd8a6606a0d7520a591c7a3d992f7 AS app

ENV RAILS_ENV="${RAILS_ENV:-production}" \
PATH="${PATH}:/home/ruby/.local/bin" \
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby "3.2.2"
ruby "3.3.0"

# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
gem "rails", "~> 7.1.2"
Expand Down
13 changes: 5 additions & 8 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ GEM
matrix (0.4.2)
method_source (1.0.0)
mini_mime (1.1.5)
mini_portile2 (2.8.5)
minitest (5.20.0)
msgpack (1.7.2)
mutex_m (0.2.0)
Expand All @@ -273,13 +274,8 @@ GEM
net-smtp (0.4.0)
net-protocol
nio4r (2.6.1)
nokogiri (1.15.5-aarch64-linux)
racc (~> 1.4)
nokogiri (1.15.5-arm64-darwin)
racc (~> 1.4)
nokogiri (1.15.5-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.15.5-x86_64-linux)
nokogiri (1.15.5)
mini_portile2 (~> 2.8.2)
Comment on lines -276 to +278
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you happen to know why this has changed? Is this something to do with Ruby 3.3?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if this change is related to the segmentation faults I'm seeing... it feels like this change could result in bundler not installing the native gems for Nokogiri...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the Nokogiri native gems for version 1.15.5 don't support Ruby 3.3.0:

% curl https://rubygems.org/api/v1/versions/nokogiri.json | jq '.[] | select(.number == "1.15.5") | {platform, ruby_version}'
{
  "platform": "ruby",
  "ruby_version": ">= 2.7.0"
}
{
  "platform": "x86_64-linux",
  "ruby_version": ">= 2.7, < 3.3.dev"
}
{
  "platform": "x86_64-darwin",
  "ruby_version": ">= 2.7, < 3.3.dev"
}
{
  "platform": "x86-mingw32",
  "ruby_version": ">= 2.7, < 3.3.dev"
}
{
  "platform": "x86-linux",
  "ruby_version": ">= 2.7, < 3.3.dev"
}
{
  "platform": "x64-mingw32",
  "ruby_version": ">= 2.7, < 3.1.dev"
}
{
  "platform": "x64-mingw-ucrt",
  "ruby_version": ">= 3.1, < 3.3.dev"
}
{
  "platform": "java",
  "ruby_version": ">= 2.7.0"
}
{
  "platform": "arm64-darwin",
  "ruby_version": ">= 2.7, < 3.3.dev"
}
{
  "platform": "arm-linux",
  "ruby_version": ">= 2.7, < 3.3.dev"
}
{
  "platform": "aarch64-linux",
  "ruby_version": ">= 2.7, < 3.3.dev"
}

We might want to update Nokogiri to the latest version?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build docker image is passing in this PR but I didn't try to build it on my machine. Let me try running docker build . on my machine and see if I'm seeing the same errors

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm getting the same error as you when i try build the images.

racc (~> 1.4)
notifications-ruby-client (5.4.0)
jwt (>= 1.5, < 3)
Expand Down Expand Up @@ -465,6 +461,7 @@ PLATFORMS
aarch64-linux
arm64-darwin-21
arm64-darwin-22
arm64-darwin-23
x86_64-darwin-20
x86_64-darwin-21
x86_64-darwin-22
Expand Down Expand Up @@ -505,7 +502,7 @@ DEPENDENCIES
vite_rails

RUBY VERSION
ruby 3.2.2p53
ruby 3.3.0p0

BUNDLED WITH
2.4.10
6 changes: 1 addition & 5 deletions spec/integration/sentry_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,8 @@
expect(filtered_event.to_hash.to_s).not_to include "submission-email@test.example"
end

it "replaces the email address in the exception with a comment" do
expect(filtered_event.to_hash[:exception][:values].first[:value]).to include "[Filtered (client-side)]"
end

it "keeps the rest of the exception message" do
expect(filtered_event.to_hash[:exception][:values].first[:value]).to include "undefined method"
expect(filtered_event.to_hash[:exception][:values].first[:value]).to eq "undefined method `not_a_method' for an instance of Form (NoMethodError)"
end
end

Expand Down