-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Reduce bundler version hardcoding #4973
Reduce bundler version hardcoding #4973
Conversation
d60ffbb
to
ccf1e06
Compare
Thanks for working on this, @deivid-rodriguez! I just opened #5024, which I hope to help DRY up a lot of our infrastructure. Do you see any potential issues / opportunities with this new approach? |
@mattt Unfortunately my idea here didn't work as well as I expected, because of what I think it's a chicken-and-egg issue. I wanted to let RubyGems (required first thing when booting Ruby) choose the appropriate Bundler version according to the version in the I'll have a look at the new infra to see if I come up with new dry up ideas, but don't worry at all about how it could affect this cleanup since it's already not a successful attempt :) |
ccf1e06
to
84208c4
Compare
0372ade
to
de0e7e5
Compare
Alright, I found a way to do this. It doesn't allow to remove Dependabot helpers to parse lockfiles, which was one original motivation from #4884 (comment). But it does accomplish the goal of having a single source of truth for the Bundler version run by Dependabot (well, two, actually, but much better than before :)). |
de0e7e5
to
e8b9d12
Compare
I got one more idea to potentially further improve this and leave the Bundler version in a single place, and a much simpler setup. Will give it a try tomorrow. |
83d51ec
to
deafea3
Compare
deafea3
to
9eafa96
Compare
Ok, I put together a small patch that leaves the exact Bundler version at a single place (the Dockerfile). The removal of harcoded versions is based on two ideas:
|
9eafa96
to
061ec2a
Compare
061ec2a
to
9a5b869
Compare
9a5b869
to
b99c170
Compare
cb83965
to
e836b8a
Compare
@deivid-rodriguez is this ready for review or still a work-in-progress? |
There's only two versions of Bundler installed (1.17.3, and 2.3.x), and RubyGems chooses the highest version by default. So there's no need to explicitly pin the version when we want to use Bundler 2.3.x.
This note makes total sense for `helpers/v1/build`, because there we explicitly pass `BUNDLER_VERSION=1.17.3` to `bundle install`, which generates a `Gemfile.lock` using that version, which indeed forces RubyGems into choosing Bundler 1.17.3 instead of the highest version installed. Here, however, we would get the same behaviour of 2.3.18 being chosen, with or without a `Gemfile.lock` using that, because it's the highest version.
When shelling out to native helpers, we don't need to know the exact version, we just need to know the major version to figure out the path to native helpers run.rb script and everything else. Proper activation of bundler can be done inside the run.rb script without needing the full version either.
e836b8a
to
0412766
Compare
Yes! I only changed some commit messages to try to better explain the approach I ended up taking, but other than that I think it's ready! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This all makes sense to me, thank you for the helpful commit messages, they made it much easier to follow the logic.
I'm 👍 for merging this, but I don't have time to cut a release and deploy it just yet, and I don't want to push that risk onto a teammate w/o their permission in case there's a problem and they need to revert. I'll see if someone else can take a look, otherwise will merge when I have the space to also deploy it.
That sounds super wise @jeffwidman 👍, thanks! |
Yes, I think this should work, and is a super welcome simplification! 🎉 |
Let me know of any issues 🤞 |
Thx again for this @deivid-rodriguez, a really nice simplification. |
This is an experiment to reduce the number of places that need to be updated when Bundler version is bumped to just the
Dockerfile
and thebundler/helpers/v2/Gemfile.lock
files.