Skip to content

Conversation

@gmjimenezc
Copy link
Contributor

@gmjimenezc gmjimenezc commented Nov 12, 2025

Pull Request Checklist

Issue

https://otwarchive.atlassian.net/browse/AO3-7013

Purpose

Upgraded RuboCop:

  • RuboCop Core: 1.22.3 → 1.76.2 (54 version jump)
  • RuboCop Rails: 2.12.4 → 2.27.0
  • RuboCop RSpec: 2.6.0 → 3.3.0
  • Gemfile updated with new versions in linters group
  • Changed require: to plugins: for rubocop-rails and rubocop-rspec deprecation syntax
  • Changed TargetRubyVersion from 3.1 to 3.4 to match project requirements
  • Fixed RSpec/FilePath configuration that was split into RSpec/SpecFilePathFormat and RSpec/SpecFilePathSuffix

Testing Instructions

  • RuboCop now runs successfully without errors after running it in a couple of files

References

The requested file has the cops that, for me, are opinion-dependent. There are more that are auto-enabled, and I didn't add them because those make sense, but let me know if I should add everything to the file. I'll make sure to upload the file into Jira ticket too.
RUBOCOP_TEAM_REVIEW_SPREADSHEET.csv

Credit

warlockmel (she/her)

@gmjimenezc
Copy link
Contributor Author

@sarken @brianjaustin we have a problem with PhraseApp compatibility, there’s a monkeypatch version mismatch so I’m not sure if I should comment and disable it for this ticket, and get a new ticket created to address that, or fix it all in this same ticket?

@sarken
Copy link
Collaborator

sarken commented Nov 13, 2025

Going to leave any decisions about Phraseapp up to @Bilka2!

Copy link
Member

@brianjaustin brianjaustin left a comment

Choose a reason for hiding this comment

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

It looks like the blast radius for updates in the lockfile is pretty large. Could you try resetting it, running bundle update --conservative rubocop (should be enough for all 3 rubocop packages), and committing those changes?

Regarding the optional cops: we'll discuss them and get back to you!

@gmjimenezc
Copy link
Contributor Author

gmjimenezc commented Nov 18, 2025

It looks like the blast radius for updates in the lockfile is pretty large. Could you try resetting it, running bundle update --conservative rubocop (should be enough for all 3 rubocop packages), and committing those changes?

Regarding the optional cops: we'll discuss them and get back to you!

weird, i'm sure i had seen a comment here detailing what cops to set as enabled and which ones should be disabled, did you remove the message? As for the rest, already fixed it + including upgrade of rubocop to latest version instead

Also, please don't forget to respond to:

we have a problem with PhraseApp compatibility, there’s a monkeypatch version mismatch so I’m not sure if I should comment and disable it for this ticket, and get a new ticket created to address that, or fix it all in this same ticket?

I ended up locking the phraseapp version to one that works, the current version is too open ">=1.0.6", so i set it to '~> 1.4.0' instead. It's worth checking if the monkeypath is still needed if we upgrade the phraseapp version to a newer version instead.

There's also something weird. I see in the commit history we are on the Ruby 3.4 version. The .rubocop.yml was targeting 3.1, so i guess the person who changed missed changing that too.

In these new changes:

  • rails-i18n is also giving me problems when updated to 7.0.10 so I also locked it to its previous version =7.0.9.
  • Set phraseapp-in-context-editor-ruby to ~>1.4.0 too.
  • Updated .rubocop.yml Ruby version from 3.1 to 3.4

Also not sure why those 3 tests fail, so if you have any idea, let me know.

@brianjaustin
Copy link
Member

weird, i'm sure i had seen a comment here detailing what cops to set as enabled and which ones should be disabled, did you remove the message?

Yes, apologies about that; I was a bit over-eager, so I edited out the list until we're fully ready (I think it will mostly stay the same though)

Also, please don't forget to respond to:

we have a problem with PhraseApp compatibility, there’s a monkeypatch version mismatch so I’m not sure if I should comment and disable it for this ticket, and get a new ticket created to address that, or fix it all in this same ticket?

I ended up locking the phraseapp version to one that works, the current version is too open ">=1.0.6", so i set it to '~> 1.4.0' instead. It's worth checking if the monkeypath is still needed if we upgrade the phraseapp version to a newer version instead.

To clarify, we only want the rubocop dependencies upgraded in this PR, not Phrase. This should avoid the issue for now (we are in discussions about the future of Phrase integration, so it's not worth the time investment regarding the monkeypatch). The version shouldn't be updated with the more targeted bundler command I linked above.

Also not sure why those 3 tests fail, so if you have any idea, let me know.

I haven't had a chance to dig into this (yet), but I would work on reducing the number of changes to Gemfile.lock to rule out an unintended upgrade changing something. A quick run with just the direct rubocop packages upgraded and nothing else showed some promise

@gmjimenezc
Copy link
Contributor Author

weird, i'm sure i had seen a comment here detailing what cops to set as enabled and which ones should be disabled, did you remove the message?

Yes, apologies about that; I was a bit over-eager, so I edited out the list until we're fully ready (I think it will mostly stay the same though)

Also, please don't forget to respond to:

we have a problem with PhraseApp compatibility, there’s a monkeypatch version mismatch so I’m not sure if I should comment and disable it for this ticket, and get a new ticket created to address that, or fix it all in this same ticket?

I ended up locking the phraseapp version to one that works, the current version is too open ">=1.0.6", so i set it to '~> 1.4.0' instead. It's worth checking if the monkeypath is still needed if we upgrade the phraseapp version to a newer version instead.

To clarify, we only want the rubocop dependencies upgraded in this PR, not Phrase. This should avoid the issue for now (we are in discussions about the future of Phrase integration, so it's not worth the time investment regarding the monkeypatch). The version shouldn't be updated with the more targeted bundler command I linked above.

Also not sure why those 3 tests fail, so if you have any idea, let me know.

I haven't had a chance to dig into this (yet), but I would work on reducing the number of changes to Gemfile.lock to rule out an unintended upgrade changing something. A quick run with just the direct rubocop packages upgraded and nothing else showed some promise

I'm going to verify then why it changes so much for me even when using the conservative flag. That's why I had to lock PhraseApp and the other gem. If I see the result is the same I'll leave the changes that are already there until you have time to review the other 3 failing tests.

@Bilka2
Copy link
Contributor

Bilka2 commented Nov 30, 2025

Please reduce the amount of changes in the Gemfile.lock, it would be wasted effort to investigate failing tests before that is done. Ideally, only rubocop, rubocop-rails, rubocop-rspec and their depedencies should be upgraded. I have also verified that this is doable with the --conservative option.

Copy link
Contributor

@marcus8448 marcus8448 left a comment

Choose a reason for hiding this comment

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

Here's the list of cops to be enabled/disabled:

Cop Name Final Decision Notes
Style/NumberedParameters Enable EnforcedStyle: Disallow
Style/ArgumentsForwarding Enable  
Style/EndlessMethod Enable  
Style/DataInheritance Enable  
Style/OpenStructUse Disable  
Style/TopLevelMethodDefinition Enable  
Security/CompoundHash Enable  
Security/IoMethods Enable  
Style/MapCompactWithConditionalBlock Enable  
Style/RedundantEach Enable  
Style/RedundantFilterChain Enable  
Style/CombinableDefined Enable  
Metrics/CollectionLiteralLength Disable  
Layout/LineContinuationLeadingSpace Enable  
Layout/LineContinuationSpacing Enable  

@gmjimenezc
Copy link
Contributor Author

Here's the list of cops to be enabled/disabled:

Cop Name Final Decision Notes
Style/NumberedParameters Enable EnforcedStyle: Disallow
Style/ArgumentsForwarding Enable  
Style/EndlessMethod Enable  
Style/DataInheritance Enable  
Style/OpenStructUse Disable  
Style/TopLevelMethodDefinition Enable  
Security/CompoundHash Enable  
Security/IoMethods Enable  
Style/MapCompactWithConditionalBlock Enable  
Style/RedundantEach Enable  
Style/RedundantFilterChain Enable  
Style/CombinableDefined Enable  
Metrics/CollectionLiteralLength Disable  
Layout/LineContinuationLeadingSpace Enable  
Layout/LineContinuationSpacing Enable

Ok please allow me this week and I'll try to fix it, I want to close this ticket myself, the season is delaying everything for me but I'll do it

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.

5 participants