Skip to content

Conversation

@ybart
Copy link
Contributor

@ybart ybart commented Jan 3, 2025

After upgrade to Ruby 3.4, our test suite outputs the following warning:

~/.rvm/gems/ruby-3.4.1/gems/activeadmin-3.2.5/lib/active_admin/inputs/filters/select_input.rb:19: warning: string returned by <Symbol>.to_s will be frozen in the future

This PR should fix it.

@codecov
Copy link

codecov bot commented Jan 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.11%. Comparing base (3639223) to head (6acf5f3).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8593      +/-   ##
==========================================
- Coverage   99.11%   99.11%   -0.01%     
==========================================
  Files         141      141              
  Lines        4076     4074       -2     
==========================================
- Hits         4040     4038       -2     
  Misses         36       36              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tagliala
Copy link
Contributor

tagliala commented Jan 3, 2025

Hi,

thanks for this PR. It is fine for me but I will leave the review to someone else

It is possible to replicate this issue by running

RUBYOPT='-w' rspec ./spec/helpers/filter_form_helper_spec.rb:405 

Also:

~/.rvm/gems/ruby-3.4.1/gems/activeadmin-3.2.5

After merging, this should be backported to 3-stable branch, since the master branch has v4 code and this seems to fix an issue on 3.x. However, I'm not sure about the plans for Ruby 3.4 and active admin 3.x

tagliala added a commit that referenced this pull request Jan 3, 2025
Ref: #8593

Running the spec suite with `RUBYOPT='-w'` to validate PR #8593 revealed
numerous warnings related to ambiguous operators.

To address these warnings, the `Lint/AmbiguousOperator` cop has been
enabled and `rubocop -a` has been run to fix the offenses.
tagliala added a commit that referenced this pull request Jan 3, 2025
Ref: #8593

Running the spec suite with `RUBYOPT='-w'` to validate PR #8593 revealed
numerous warnings related to ambiguous operators.

To address these warnings, the `Lint/AmbiguousOperator` cop has been
enabled and `rubocop -a` has been run to fix the offenses.
tagliala added a commit that referenced this pull request Jan 3, 2025
Running the spec suite with `RUBYOPT='-w'` to validate PR #8593 revealed
numerous warnings related to ambiguous operators.

To address these warnings, the `Lint/AmbiguousOperator` cop has been
enabled and `rubocop -a` has been run to fix the offenses.
@javierjulio
Copy link
Member

@tagliala I use RUBYOPT="-W:deprecated" locally. Do you know what the difference between using :deprecated and not is, if any, by chance? I typically set that ENV in projects (an example) but we don't have it in any of the 4 repos here. If you are interested in adding the ENV to the CI tests workflows, please do. Yes, we should backport to the 3-0-stable branch. @ybart did you want to open a second PR as well?

Copy link
Member

@javierjulio javierjulio left a comment

Choose a reason for hiding this comment

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

Thanks!

tagliala added a commit that referenced this pull request Jan 4, 2025
Running the spec suite with `RUBYOPT='-w'` to validate PR #8593 revealed
numerous warnings related to ambiguous operators.

To address these warnings, the `Lint/AmbiguousOperator` cop has been
enabled and `rubocop -a` has been run to fix the offenses.
ybart added 4 commits January 4, 2025 10:53
After upgrade to Ruby 3.4, our test suite outputs the following warning:

```
~/.rvm/gems/ruby-3.4.1/gems/activeadmin-3.2.5/lib/active_admin/inputs/filters/select_input.rb:19: warning: string returned by <Symbol>.to_s will be frozen in the future
```
@tagliala tagliala merged commit 5f54f91 into activeadmin:master Jan 4, 2025
22 checks passed
@tagliala
Copy link
Contributor

tagliala commented Jan 4, 2025

@tagliala I use RUBYOPT="-W:deprecated" locally. Do you know what the difference between using :deprecated and not is, if any, by chance?

I don't know, I'll ask Copilot and edit this response

I typically set that ENV in projects (an example) but we don't have it in any of the 4 repos here.

There is a lot of extra noise from other gems, and a lot of "method redefinitions" with RUBYOPT='-w'. The full log, iirc, has ~12k lines

If you are interested in adding the ENV to the CI tests workflows, please do.

I'll investigate a little bit.

ambiguous is not being spot by "-W:deprecated". This problem instead, will be detected

tagliala pushed a commit that referenced this pull request Jan 4, 2025
After upgrade to Ruby 3.4, our test suite outputs the following warning:

```
lib/active_admin/inputs/filters/select_input.rb:19: warning: string returned by <Symbol>.to_s will be frozen in the future
```
@javierjulio
Copy link
Member

Good to know about that difference. Thank you.

tagliala pushed a commit that referenced this pull request Jan 4, 2025
After upgrade to Ruby 3.4, our test suite outputs the following warning:

```
lib/active_admin/inputs/filters/select_input.rb:19: warning: string returned by <Symbol>.to_s will be frozen in the future
```
tagliala added a commit that referenced this pull request Jan 4, 2025
Fix deprecation warning in Ruby 3.4 (#8593)

After upgrade to Ruby 3.4, our test suite outputs the following warning:

```
lib/active_admin/inputs/filters/select_input.rb:19: warning: string returned by <Symbol>.to_s will be frozen in the future
```

Co-authored-by: Yvan BARTHÉLEMY <223016+ybart@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants