Skip to content

Development dependencies bumped for Ruby 3.4#232

Merged
pda merged 3 commits intomainfrom
bump-dev-dependencies
Feb 3, 2025
Merged

Development dependencies bumped for Ruby 3.4#232
pda merged 3 commits intomainfrom
bump-dev-dependencies

Conversation

@pda
Copy link
Member

@pda pda commented Feb 3, 2025

Local development / testing was broken on latest Ruby 3.4 for a couple of reasons:

  • Gemfile.lock specified activesupport (7.0.7.2) which does require "mutex_m", and that has moved from stdlib to a bundled gem. Newer activesupport declares mutex_m as a dependency.
  • Ruby 3.4 is stricter about Hash.new(…) being passed unrecognised keyword arguments, which we were mistakenly doing in spec/support/rspec_example_trace_helpers.rb.

I've done a bundle update which moved the Gemfile.lock (development/testing only) dependency to activesupport (8.0.1). This doesn't affect the runtime dependencies; we're still aiming to support older Ruby / Rails etc.

pda added 2 commits February 3, 2025 16:15
Previously, `example.metadata` would return a Hash which, for any
unknown key, would return _another_ hash. I think this was not the
intention, but it didn't lead to any errors, probably because both Hash
and Array implement `#empty?`.

In Ruby 3.4, the syntax resulted in an error:

        unknown keyword: :shared_group_inclusion_backtrace

I believe the intention was for `example.metadata` to return the Hash
that contains the `shared_group_inclusion_backtrace` key, beginning as
an empty array.

The usage looks like this:

        lib/buildkite/test_collector/rspec_plugin/trace.rb
        63:      !example.metadata[:shared_group_inclusion_backtrace].empty?
        67:      example.metadata[:shared_group_inclusion_backtrace].last.inclusion_location
The previous version of activesupport was not compatible with Ruby 3.4
because `mutex_m` has moved from stdlib to a bundled gem, and that old
version of activesupport was depending on it but not explicitly
declaring that.

I don't believe this bump has any impact on usage of this test
collector, only of development/testing thereof.
@pda pda requested a review from a team as a code owner February 3, 2025 06:01
@pda pda changed the title Development dependencies bumped Development dependencies bumped for Ruby 3.4 Feb 3, 2025
@gchan
Copy link
Contributor

gchan commented Feb 3, 2025

It appears that requiring securerandom 0.4.1 is breaking the Ruby 2.7 and 3.0 builds

securerandom-0.4.1 requires ruby version >= 3.1.0

securerandom 0.3.2 works in Ruby 2.6 and above. Maybe we could give that a go?

@pda pda merged commit c78294b into main Feb 3, 2025
1 check passed
@pda pda deleted the bump-dev-dependencies branch February 3, 2025 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants