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 version of ruby from 3.3.0 => 3.3.7 #1449

Merged
merged 5 commits into from
Jan 23, 2025
Merged

Upgrade version of ruby from 3.3.0 => 3.3.7 #1449

merged 5 commits into from
Jan 23, 2025

Conversation

noahd1
Copy link
Member

@noahd1 noahd1 commented Jan 23, 2025

Currently the reek plugin is failing for customers. The stack trace for these customers looks like this:

2025-01-22T18:03:07Z INFO [T13] qlty_check::tool (47.8 MB): Setting up tool reek@Some("6.3.0"). Logging to /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3-install.log
2025-01-22T18:03:20Z ERROR [T13] qlty_check::tool (47.8 MB): Failed to get version for package "reek": Output { status: ExitStatus(unix_wait_status(256)), stdout: "", stderr: "<internal:/home/runner/.qlty/cache/tools/ruby/3.3.0-bbe397d161fc/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:127:in `require': \n/home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/dry-types-1.8.1/lib/dry/types/sum.rb:33: anonymous block parameter is also used within block (SyntaxError)\n\tfrom <internal:/home/runner/.qlty/cache/tools/ruby/3.3.0-bbe397d161fc/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:127:in `require'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/zeitwerk-2.7.1/lib/zeitwerk/core_ext/kernel.rb:26:in `require'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/dry-types-1.8.1/lib/dry/types/builder.rb:28:in `|'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/dry-types-1.8.1/lib/dry/types/builder.rb:53:in `optional'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/dry-types-1.8.1/lib/dry/types/core.rb:79:in `block in <module:Types>'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/dry-types-1.8.1/lib/dry/types/core.rb:78:in `each_key'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/dry-types-1.8.1/lib/dry/types/core.rb:78:in `<module:Types>'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/dry-types-1.8.1/lib/dry/types/core.rb:4:in `<module:Dry>'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/dry-types-1.8.1/lib/dry/types/core.rb:3:in `<top (required)>'\n\tfrom <internal:/home/runner/.qlty/cache/tools/ruby/3.3.0-bbe397d161fc/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:127:in `require'\n\tfrom <internal:/home/runner/.qlty/cache/tools/ruby/3.3.0-bbe397d161fc/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:127:in `require'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/zeitwerk-2.7.1/lib/zeitwerk/core_ext/kernel.rb:34:in `require'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/dry-types-1.8.1/lib/dry/types.rb:258:in `<top (required)>'\n\tfrom <internal:/home/runner/.qlty/cache/tools/ruby/3.3.0-bbe397d161fc/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:127:in `require'\n\tfrom <internal:/home/runner/.qlty/cache/tools/ruby/3.3.0-bbe397d161fc/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:127:in `require'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/zeitwerk-2.7.1/lib/zeitwerk/core_ext/kernel.rb:34:in `require'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/dry-schema-1.13.4/lib/dry/schema.rb:8:in `<top (required)>'\n\tfrom <internal:/home/runner/.qlty/cache/tools/ruby/3.3.0-bbe397d161fc/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:127:in `require'\n\tfrom <internal:/home/runner/.qlty/cache/tools/ruby/3.3.0-bbe397d161fc/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:127:in `require'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/reek-6.3.0/lib/reek/configuration/schema.rb:3:in `<top (required)>'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/reek-6.3.0/lib/reek/configuration/schema_validator.rb:4:in `require_relative'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/reek-6.3.0/lib/reek/configuration/schema_validator.rb:4:in `<top (required)>'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/reek-6.3.0/lib/reek/configuration/configuration_file_finder.rb:5:in `require_relative'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/reek-6.3.0/lib/reek/configuration/configuration_file_finder.rb:5:in `<top (required)>'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/reek-6.3.0/lib/reek/configuration/app_configuration.rb:4:in `require_relative'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/reek-6.3.0/lib/reek/configuration/app_configuration.rb:4:in `<top (required)>'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/reek-6.3.0/lib/reek/detector_repository.rb:5:in `require_relative'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/reek-6.3.0/lib/reek/detector_repository.rb:5:in `<top (required)>'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/reek-6.3.0/lib/reek/examiner.rb:4:in `require_relative'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/reek-6.3.0/lib/reek/examiner.rb:4:in `<top (required)>'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/reek-6.3.0/lib/reek.rb:7:in `require_relative'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/reek-6.3.0/lib/reek.rb:7:in `<top (required)>'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/reek-6.3.0/bin/reek:9:in `require_relative'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/gems/reek-6.3.0/bin/reek:9:in `<top (required)>'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/bin/reek:25:in `load'\n\tfrom /home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/bin/reek:25:in `<main>'\n" } {"LD_LIBRARY_PATH": "/home/runner/.qlty/cache/tools/ruby/3.3.0-bbe397d161fc/lib", "PKG_CONFIG_PATH": "/home/runner/.qlty/cache/tools/ruby/3.3.0-bbe397d161fc/lib/pkgconfig", "GEM_HOME": "/home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3", "HOME": "/home/runner", "PATH": "/home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3/bin:/home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3:/home/runner/.qlty/cache/tools/ruby/3.3.0-bbe397d161fc/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin", "GEM_PATH": "/home/runner/.qlty/cache/tools/reek/6.3.0-fb49277b68e3", "RUBYLIB": "/home/runner/.qlty/cache/tools/ruby/3.3.0-bbe397d161fc/lib/ruby/site_ruby/3.3.0:/home/runner/.qlty/cache/tools/ruby/3.3.0-bbe397d161fc/lib/ruby/site_ruby/3.3.0/x86_64-linux:/home/runner/.qlty/cache/tools/ruby/3.3.0-bbe397d161fc/lib/ruby/site_ruby:/home/runner/.qlty/cache/tools/ruby/3.3.0-bbe397d161fc/lib/ruby/vendor_ruby/3.3.0:/home/runner/.qlty/cache/tools/ruby/3.3.0-bbe397d161fc/lib/ruby/vendor_ruby/3.3.0/x86_64-linux:/home/runner/.qlty/cache/tools/ruby/3.3.0-bbe397d161fc/lib/ruby/vendor_ruby:/home/runner/.qlty/cache/tools/ruby/3.3.0-bbe397d161fc/lib/ruby/3.3.0:/home/runner/.qlty/cache/tools/ruby/3.3.0-bbe397d161fc/lib/ruby/3.3.0/x86_64-linux:/home/runner/.qlty/cache/tools/ruby/3.3.0-bbe397d161fc/lib/ruby/"}
2025-01-22T18:03:20Z ERROR [T13] qlty_check::tool (47.8 MB): Failed to set up reek@Some("6.3.0"): Failed to get version for package "reek": (command sh -c "reek --version" exited with code 1)
2025-01-22T18:03:20Z ERROR [T1] qlty (8.7 MB): Command failed: qlty build
❌ Error installing reek@6.3.0.

Initially this was very confusing since there were no CLI upgrades between when it was working and when it suddenly stopped working ...

In digging into it, we discovered that:

Because of the dependency chain, this upgrade was picked up and changed the behavior of the plugin.

The upgrade apparently exposed a bug in Ruby 3.3.0 that it previously hadn't run into. (h/t dry-rb/dry-system#284 (comment)).

This PR bumps the version of ruby to the latest on the 3.3.x line (3.3.7).

However, I'm currently unable to install this locally via qlty and cannot verify that it does indeed fix the bug. Reek runs tests on 3.3.6, so that is also a fairly safe alternative (but also does not install locally for me).

Copy link
Contributor

qltysh bot commented Jan 23, 2025

The code coverage on the diff in this pull request is 83.3%

Drilldown
Path File Coverage Δ
qlty-check/src/executor/driver.rs * -0.9
qlty-check/src/tool/command_builder.rs * 2.6
qlty-check/src/tool/download.rs * 0.7
qlty-check/src/tool/ruby/sys/linux.rs * -1.6
qlty-check/src/tool/ruby/sys/macos.rs 3.2
qlty-config/src/library.rs * -0.5

(*) Indirect Changes: These files had changes to their code coverage, but were not modified in this pull request. Learn More

Copy link
Contributor

qltysh bot commented Jan 23, 2025

The code coverage on the diff in this pull request is 0.0%

Drilldown
Path File Coverage Δ
qlty-check/src/executor/driver.rs * 0.1
qlty-cli/src/initializer/scanner/gemfile.rs * -0.3
qlty-config/src/library.rs * -0.5

@lsegal lsegal merged commit 39902c8 into main Jan 23, 2025
13 of 14 checks passed
@lsegal lsegal deleted the nd-upgrade-ruby branch January 23, 2025 02:05
@lsegal lsegal changed the title Upgrade version of ruby from 3.3.0 => 3.3.7 (Do not merge) Upgrade version of ruby from 3.3.0 => 3.3.7 Jan 23, 2025
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