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

Code maintenance/60655 bump ruby to 341 #17651

Merged
merged 7 commits into from
Jan 27, 2025
Merged
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 .github/workflows/danger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3.4'
ruby-version: '3.4.1'
- uses: MeilCli/danger-action@v6
with:
danger_file: 'Dangerfile'
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.3.4
3.4.1
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,6 @@ group :development, :test do
gem "byebug"

gem "pry-byebug", "~> 3.10.0", platforms: [:mri]
gem "pry-doc"
gem "pry-rails", "~> 0.3.6"
gem "pry-rescue", "~> 1.6.0"

Expand Down
8 changes: 2 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ GEM
concurrent-ruby (~> 1.0)
dry-core (~> 1.1)
zeitwerk (~> 2.6)
dry-monads (1.7.0)
dry-monads (1.7.1)
concurrent-ruby (~> 1.0)
dry-core (~> 1.1)
zeitwerk (~> 2.6)
Expand Down Expand Up @@ -867,9 +867,6 @@ GEM
pry-byebug (3.10.1)
byebug (~> 11.0)
pry (>= 0.13, < 0.15)
pry-doc (1.5.0)
pry (~> 0.11)
yard (~> 0.9.11)
pry-rails (0.3.11)
pry (>= 0.13.0)
pry-rescue (1.6.0)
Expand Down Expand Up @@ -1342,7 +1339,6 @@ DEPENDENCIES
plaintext (~> 0.3.2)
prawn (~> 2.4)
pry-byebug (~> 3.10.0)
pry-doc
pry-rails (~> 0.3.6)
pry-rescue (~> 1.6.0)
puffing-billy (~> 4.0.0)
Expand Down Expand Up @@ -1421,7 +1417,7 @@ DEPENDENCIES
with_advisory_lock (~> 5.1.0)

RUBY VERSION
ruby 3.3.4p94
ruby 3.4.1p0

BUNDLED WITH
2.5.13
9 changes: 7 additions & 2 deletions app/models/users/scopes/having_reminder_mail_to_send.rb
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,13 @@ def quarters_between_earliest_and_latest(earliest_time, latest_time) # rubocop:d
# The last quarter is the one smaller than the latest time. But needs to be at least equal to the first quarter.
last_quarter = [first_quarter, latest_time.change(min: latest_time.min / 15 * 15)].max

(first_quarter.to_i..last_quarter.to_i)
.step(15.minutes)
quarters = if first_quarter == last_quarter
[first_quarter]
else
(first_quarter.to_i..last_quarter.to_i).step(15.minutes)
end

quarters
.map do |time|
Time.zone.at(time)
end
Expand Down
4 changes: 3 additions & 1 deletion app/services/duration_converter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ def output(duration_in_hours, format: default_format)

def parseable?(duration_string)
if number = Integer(duration_string, 10, exception: false) || Float(duration_string, exception: false)
number >= 0
# ruby 3.4 started being able to parse strings like "1." as 1.0.
# However, that does not work with ChronicDuration.
number >= 0 && !duration_string.ends_with?(".")
else
begin
do_parse(duration_string)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class ScheduleDateAlertsNotificationsJob < ApplicationJob
def perform
return unless EnterpriseToken.allows_to?(:date_alerts)

Service.new(every_quater_hour_between_predecessor_cron_at_and_own_cron_at).call
Service.new(every_quarter_hour_between_predecessor_cron_at_and_own_cron_at).call
end

# What cannot be controlled is the time at which a job is actually performed.
Expand Down Expand Up @@ -70,9 +70,14 @@ def perform
# for 1:00 am local time are covered. The sole exception would be the case where previously finished jobs
# have been removed from the database and the current job took longer to start executing. This is for now
# an accepted shortcoming as the likelihood of this happening is considered to be very low.
def every_quater_hour_between_predecessor_cron_at_and_own_cron_at
(lower_boundary.to_i..upper_boundary.to_i)
.step(15.minutes)
def every_quarter_hour_between_predecessor_cron_at_and_own_cron_at
quarters = (lower_boundary.to_i..upper_boundary.to_i).step(15.minutes).to_a

if quarters.empty? && lower_boundary.present?
quarters = [lower_boundary]
end

quarters
.map do |time|
Time.zone.at(time)
end
Expand Down
2 changes: 1 addition & 1 deletion docker/dev/backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ruby:3.3.4-bullseye AS develop
FROM ruby:3.4.1-bullseye AS develop
MAINTAINER [email protected]

ARG DEV_UID=1000
Expand Down
2 changes: 1 addition & 1 deletion docker/prod/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG RUBY_VERSION="3.3.4"
ARG RUBY_VERSION="3.4.1"
FROM ruby:${RUBY_VERSION}-bookworm AS base
LABEL maintainer="[email protected]"

Expand Down
12 changes: 6 additions & 6 deletions docs/development/development-environment/linux/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ sudo apt-get install git curl build-essential zlib1g-dev libyaml-dev libssl-dev
Use [rbenv](https://github.com/rbenv/rbenv) and [ruby-build](https://github.com/rbenv/ruby-build#readme) to install
Ruby.
You can check available ruby versions with `rbenv install --list`.
At the time of this writing, the latest stable version is `3.3.4`, which we also require.
At the time of this writing, the latest stable version is `3.4.1`, which we also require.

We suggest you install the version we require in [.ruby-version](https://github.com/opf/openproject/blob/dev/.ruby-version).
Read the first line e.g. `3.3.4` and install that version.
Read the first line e.g. `3.4.1` and install that version.

#### Install rbenv and ruby-build

Expand Down Expand Up @@ -80,18 +80,18 @@ With both installed, we can now install ruby.
You can check available ruby versions with `rbenv install --list`.

We suggest you install the version we require in [.ruby-version](https://github.com/opf/openproject/blob/dev/.ruby-version).
Read the first line e.g. `3.3.4` and install that version.
Read the first line e.g. `3.4.1` and install that version.

```shell
# Install the required version as read from the .ruby-version file
rbenv install 3.3.4
rbenv install 3.4.1
```

This might take a while depending on whether ruby is built from source. After it is complete, you need to tell rbenv to
globally activate this version

```shell
rbenv global 3.3.4
rbenv global 3.4.1
rbenv rehash
```

Expand Down Expand Up @@ -181,7 +181,7 @@ You should now have an active ruby and node installation. Verify that it works w

```shell
ruby --version
ruby 3.3.4 (2024-07-09 revision be1089c8ec) [arm64-darwin23]
ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [arm64-darwin23]

bundler --version
Bundler version 2.5.13
Expand Down
10 changes: 5 additions & 5 deletions docs/development/development-environment/macos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ their homepage.
Use [rbenv](https://github.com/rbenv/rbenv) and [ruby-build](https://github.com/rbenv/ruby-build#readme) to install
Ruby. We always require the latest ruby versions, and you can check which version is required
by [checking the Gemfile](https://github.com/opf/openproject/blob/dev/Gemfile#L31) for the `ruby "~> X.Y"` statement. At
the time of writing, this version is "3.3.4"
the time of writing, this version is "3.4.1"

#### Install rbenv and ruby-build

Expand All @@ -48,18 +48,18 @@ With both installed, we can now install the actual ruby version.
You can check available ruby versions with `rbenv install --list`.

We suggest you install the version we require in [.ruby-version](https://github.com/opf/openproject/blob/dev/.ruby-version).
Read the first line e.g. `3.3.4` and install that version.
Read the first line e.g. `3.4.1` and install that version.

```shell
# Install the required version as read from the .ruby-version file
rbenv install 3.3.4
rbenv install 3.4.1
```

This might take a while depending on whether ruby is built from source. After it is complete, you need to tell rbenv to
globally activate this version

```shell
rbenv global 3.3.4
rbenv global 3.4.1
```

You also need to install [bundler](https://github.com/bundler/bundler/), the ruby gem bundler.
Expand Down Expand Up @@ -134,7 +134,7 @@ You should now have an active ruby and node installation. Verify that it works w

```shell
$ ruby --version
ruby 3.3.4 (2024-07-09 revision be1089c8ec) [arm64-darwin23]
ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [arm64-darwin23]

$ bundler --version
Bundler version 2.5.13
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,19 +110,19 @@ Please be aware that the actual installation of a specific Ruby version takes so
```

We suggest you install the version we require in [.ruby-version](https://github.com/opf/openproject/blob/dev/.ruby-version).
Read the first line e.g. `3.3.4` and install that version.
Read the first line e.g. `3.4.1` and install that version.

```shell
[openproject@host] rbenv install 3.3.4
[openproject@host] rbenv install 3.4.1
[openproject@host] rbenv rehash
[openproject@host] rbenv global 3.3.4
[openproject@host] rbenv global 3.4.1
```

To check our Ruby installation we run `ruby --version`. It should output
something very similar to:

```text
ruby 3.3.4 (2024-07-09 revision be1089c8ec) [arm64-darwin23]
ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [arm64-darwin23]
```

## Installation of Node
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
describe ".new" do
it "discourages direct instantiation" do
expect { described_class.new(file_id: "file_id", user_permissions: []) }
.to raise_error(NoMethodError, /private method `new'/)
.to raise_error(NoMethodError, /private method 'new'/)
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def current_remote_permissions
.with(
error_code: :error,
message: nil,
data: %r{/lib/httpx/response.rb:262:in `full_message': timed out while waiting on select \(HTTPX::ConnectTimeoutError\)\n$}
data: %r{/lib/httpx/response.rb:262:in 'full_message': timed out while waiting on select \(HTTPX::ConnectTimeoutError\)\n$}
).once
# rubocop:enable Layout/LineLength
end
Expand Down
4 changes: 2 additions & 2 deletions spec/models/users/scopes/having_reminder_mail_to_send_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@
)
end
let(:scope_upper_boundary_time) { ActiveSupport::TimeZone["Europe/Paris"].parse("2021-09-30T08:09").utc }
let(:scope_lower_boundary_time) { ActiveSupport::TimeZone["Europe/Paris"].parse("2021-09-30T08:00") }
let(:scope_lower_boundary_time) { ActiveSupport::TimeZone["Europe/Paris"].parse("2021-09-30T08:00").utc }

it "contains the user" do
expect(scope)
Expand All @@ -399,7 +399,7 @@
)
end
let(:scope_upper_boundary_time) { ActiveSupport::TimeZone["Europe/Paris"].parse("2021-09-30T10:00").utc }
let(:scope_lower_boundary_time) { ActiveSupport::TimeZone["Europe/Paris"].parse("2021-09-30T10:00") }
let(:scope_lower_boundary_time) { ActiveSupport::TimeZone["Europe/Paris"].parse("2021-09-30T10:00").utc }

it "is empty" do
expect(scope)
Expand Down
2 changes: 1 addition & 1 deletion spec/support/schedule_helpers/schedule_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def create_work_package(name)

def create_follows_relations(follower)
chart.predecessors_by_follower(follower).each do |predecessor|
follows_relations[from: follower, to: predecessor] =
follows_relations[{ from: follower, to: predecessor }] =
FactoryBot.create(:follows_relation,
from: create_work_package(follower),
to: create_work_package(predecessor),
Expand Down
Loading