renovate icon indicating copy to clipboard operation
renovate copied to clipboard

Create `group:rubyOnRails` preset and put it in the `config:recommended` preset

Open HonkingGoose opened this issue 1 year ago • 0 comments

What would you like Renovate to be able to do?

In PR #16270 I tried to add documentation about why Renovate doesn't support Ruby on Rails gems correctly. @rarkins thinks adding this documentation is not a proper fix, and only highlights a negative thing. And I agree with that. 😄

Instead let's create a group:rubyOnRails preset, that we put in the config:recommended preset.

Copy/pasting a comment from @DawidJanczak:

I think that's actually enough to figure out what's wrong, I should have realised this sooner. It looks like whenever a Rails gem is to be updated they all have to be updated in batch. We have the following defined in Gemfile:

gem 'actionmailer'
gem 'actionpack'
gem 'activemodel'
gem 'activerecord'
gem 'activesupport'

Updating any of these alone doesn't work, they all have to be updated at the same time. So running bundler lock --update actionpack won't do anything (apart from updating its dependency, like it did with loofah for us). We'd have to run bundler lock --update actionmailer actionpack activemodel activerecord activesupport railties.

This is something that's very specific to Rails and as such I'm not sure if you want to handle it. If you do you'd essentially have to scan the Gemfile for all Rails gems (that's the ones mentioned here https://github.com/rails/rails#frameworks-and-libraries + rails + railties) and update all of them whenever a single one needs updating.

~If you don't want to handle it it might be worth adding a note somewhere in the docs about this Rails-specific behaviour.~

Thanks for looking into this!

If you have any ideas on how this should be implemented, please tell us here.

  • [ ] Create a list of all Ruby on Rails gems that should be grouped
  • [ ] Create group:rubyOnRails preset, where we group all Ruby on Rails gems that must be updated together
  • [ ] Put the group:rubyOnRails preset into our config:recommended preset
  • [ ] Check if this PR maybe closes issue #15365

I think a group:rubyOnRails preset like this may work:

{
  "packageRules": [
    {
      "matchDatasources": [
        "rubygems"
      ],
      "matchPackageNames": [
        "list",
        "all",
        "Ruby on Rails gems",
        "here"
      ],
      "groupName": "Ruby on Rails gems"
    }
  ]
}

Is this a feature you are interested in implementing yourself?

No

HonkingGoose avatar Aug 10 '22 09:08 HonkingGoose

The rails gem lists its runtime dependencies on RubyGems: [^rails-on-rubygems]

rails 7.0.3.1

Runtime dependencies (13):

  • actioncable = 7.0.3.1
  • actionmailbox = 7.0.3.1
  • actionmailer = 7.0.3.1
  • actionpack = 7.0.3.1
  • actiontext = 7.0.3.1
  • actionview = 7.0.3.1
  • activejob = 7.0.3.1
  • activemodel = 7.0.3.1
  • activerecord = 7.0.3.1
  • activestorage = 7.0.3.1
  • activesupport = 7.0.3.1
  • bundler >= 1.15.0
  • railties = 7.0.3.1

Looks like we have the list of gems that must be updated together when you use Rails. I guess the bundler gem should stay out of the group though?

[^rails-on-rubygems]: rails package on RubyGems registry

HonkingGoose avatar Aug 15 '22 10:08 HonkingGoose

:tada: This issue has been resolved in version 32.165.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

renovate-release avatar Aug 18 '22 17:08 renovate-release