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

fix Gemfile not updating for peer dependencies #7621

Merged
merged 6 commits into from
Jul 25, 2023

Conversation

jakecoffman
Copy link
Member

@jakecoffman jakecoffman commented Jul 24, 2023

This fixes an issue in Bundler updates where if you have a peer dependency on the dependency being updated, the peer gets updated in the lockfile, but not the Gemfile.

The problem can be reproduced with this Gemfile:

# frozen_string_literal: true

source "https://rubygems.org"

git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }

gem "octicons", "~> 19.2"
gem "octicons_helper", "~> 19.2"

With this PR, octicons and octicons_helper are correctly updated together in the Gemfile. I checked against this branch of the smoke tests.

I'm not as knowledgeable about Bundler, so let me know if something I did here doesn't make sense!

@github-actions github-actions bot added the L: ruby:bundler RubyGems via bundler label Jul 24, 2023
@jakecoffman jakecoffman marked this pull request as ready for review July 24, 2023 18:30
@jakecoffman jakecoffman requested a review from a team as a code owner July 24, 2023 18:30
@jakecoffman
Copy link
Member Author

Oh I will add this case as a fixture.

Copy link
Member

@jurre jurre left a comment

Choose a reason for hiding this comment

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

That makes sense to me 👍

Copy link
Contributor

@deivid-rodriguez deivid-rodriguez left a comment

Choose a reason for hiding this comment

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

I was wondering if it'd make more sense to fix this inside the native helper? I think we have more direct access to direct dependencies in there.

That said, anything that fixes this and passes all tests seems good!

@jakecoffman
Copy link
Member Author

Ok if this works we can circle back and see if it makes more sense in the native helper. Personally I don't like developing in the helpers, it's a bit of a pain to debug them!

@jakecoffman jakecoffman merged commit 4392f1c into main Jul 25, 2023
91 checks passed
@jakecoffman jakecoffman deleted the jakecoffman/fix-gemfile-not-updating-when-required branch July 25, 2023 15:13
deivid-rodriguez added a commit that referenced this pull request Aug 3, 2023
brettfo pushed a commit to brettfo/dependabot-core that referenced this pull request Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L: ruby:bundler RubyGems via bundler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants