Fix Renovate bundler update failures (rangeStrategy) and invalid manager rule#3214
Merged
Merged
Conversation
The global rangeStrategy "pin" can't rewrite the Gemfile's pessimistic constraints (e.g. gem 'rails', '~> 8.0') into exact versions, so the bundler branches failed repeatedly with "Error updating branch: update failure". Override rangeStrategy to "update-lockfile" for the bundler manager so Renovate updates Gemfile.lock and only edits the Gemfile when a new version falls outside the existing range - the idiomatic strategy for a Rails app. pin still applies to npm and every other manager.
Also fix the minimumReleaseAge rule, which used matchManagers with a datasource name ("rubygems" is a datasource, not a manager) and failed renovate-config-validator. Switched to matchDatasources so the 7-day release-age delay applies to both npm packages and Ruby gems as intended.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Renovate has been failing on this repo with a persistent repository problem on the Mend dashboard:
Two bundler branches fail on every run:
renovate/pin-dependencies— pinningaxe-core-rspec('~> 4.8'→4.11.3)renovate/ruby-on-rails-packages— pinningrails('~> 8.0'→8.1.3)Root cause
renovate.jsonsets"rangeStrategy": "pin"globally. That's fine for npm (those updates succeed), but for the bundler manager it tries to rewrite the Gemfile's pessimistic constraints (e.g.gem 'rails', '~> 8.0') into exact versions inside the Gemfile. Renovate's bundler manager can't do that replacement — it logsValue is not updated→Error updating branch: update failure. Because the failure happens at the file-update stage (before anybundle lock), the branches never get created and the dashboard stays red.Fix
Override
rangeStrategytoupdate-lockfilefor the bundler manager only. For a Rails application, the idiomatic approach is to keep loose constraints in theGemfileand letGemfile.lockcarry the exact pinned versions.update-lockfileupdates the lockfile and only edits theGemfilewhen a new version falls outside the existing range.pinstill applies to npm and every other manager, so nothing else changes.Bonus fix
While validating,
renovate-config-validatorflagged a second, pre-existing error: theminimumReleaseAgerule usedmatchManagers: ["npm", "rubygems"], butrubygemsis a datasource, not a manager (the Ruby manager isbundler). The rule was invalid, so the 7-day release-age delay wasn't reliably applying to Ruby gems. Switched tomatchDatasources: ["npm", "rubygems"]— which is what those values were always meant to be — so the delay now correctly covers both npm packages and Ruby gems.Verification
renovate-config-validatorpasses:(Before this change it reported
Configuration Error … You have included an unsupported manager in a package rule. Your list: npm,rubygems.)prettier --check renovate.jsonis clean.