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

feat(ruby): improve bump/widen strategy for ~> #17091

Merged
merged 3 commits into from Aug 16, 2022

Conversation

qnighy
Copy link
Contributor

@qnighy qnighy commented Aug 10, 2022

Changes

This PR changes how Renovate updates Ruby's Gemfile to be more consistent. It includes the following changes:

  • Changes to ~> range
    • In bump and replace strategies, the precision in ~> will never be changed as the implicit upper bound relies on the precision.
      • Instead, in bump strategy, it adds or removes the corresponding >= range to represent the exact lower bound.
    • In widen strategy, it decomposes ~> to >= and < ranges.
  • Changes to != range
    • In bump strategy, it tries to convert != into >= range.
  • Changes to <, <= ranges
    • The behaviors for < and <= are now consistent with each other.
    • In bump, replace, and widen strategies, it updates these ranges only if the new version violates them.
  • Changes to >, >= ranges
    • The behaviors for > and >= are now consistent with each other.
    • In bump strategy, it always updates the range so that the lower bound sticks with the new version.
    • In replace and widen strategies, it updates these ranges only if the new version violates them. (This is supposed to be a rare case)

Context

This PR is a second attempt at #11130.

The most important motivation is that Renovate sometimes updates ~> in a way that the upper bound is unintentionally tightened.

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please tick one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

lib/modules/versioning/ruby/index.spec.ts Show resolved Hide resolved
lib/modules/versioning/ruby/index.spec.ts Outdated Show resolved Hide resolved
lib/modules/versioning/ruby/index.spec.ts Outdated Show resolved Hide resolved
@qnighy qnighy requested a review from rarkins August 15, 2022 13:03
@rarkins rarkins enabled auto-merge (squash) August 16, 2022 05:26
@rarkins rarkins merged commit c9b21ce into renovatebot:main Aug 16, 2022
@qnighy qnighy deleted the feat/ruby-bump-and-widen branch August 16, 2022 05:42
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 32.160.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@viceice viceice added the regression Issue about a regression bug, or the PR caused it label Aug 17, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
regression Issue about a regression bug, or the PR caused it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants