-
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
Add an options argument to the bundler_version helper method that is passed from the public API down #3230
Conversation
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.
Nice one, are there other places left for this or should we get this in?
I think there's a few more, my plan was to take this PR right up to having a null adapter that just raises if the feature is on |
Ah yes that makes sense 👌 |
a19f047
to
9440f33
Compare
34dc277
to
fa7ed79
Compare
|
||
def bundler_version | ||
@bundler_version ||= Helpers.bundler_version(lockfile) | ||
end |
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.
I've tentatively removed this as I think all the classes mixing it in are overriding it locally, but CI may prove me wrong
bundler/lib/dependabot/bundler/file_updater/lockfile_updater.rb
Outdated
Show resolved
Hide resolved
require "json" | ||
|
||
$LOAD_PATH.unshift(File.expand_path("./lib", __dir__)) | ||
$LOAD_PATH.unshift(File.expand_path("../v1/monkey_patches", __dir__)) |
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.
$LOAD_PATH.unshift(File.expand_path("../v1/monkey_patches", __dir__)) | |
$LOAD_PATH.unshift(File.expand_path("../v2/monkey_patches", __dir__)) |
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.
oh wait this is intentional, ignore
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.
No worries, I flip flopped on that, I was nervous about hard forking monkey patches. It might make sense to go ahead and fork them but for now I just wanted to avoid breaking the loading.
e97f584
to
49f90f7
Compare
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.
Thanks for testing this! LGTM 💯
Looks like quite a few classes require |
Aha, I made it a required argument and didn't update the unit tests 🤕 Should be a relatively quick fix. |
793a97d
to
ef56726
Compare
The CI failures seem to be limited to the new tests that use the v2 native helper, but I'm not seeing them locally, I suspect the issue is the v2 helper just isn't set up properly for CI yet. I've committed |
f5af517
to
ed20d2f
Compare
Yep, that was the issue, I forgot to add v2 to the Dockerfile and had some build script tweaks to make 😅 |
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.
🙌 just did a release of core so could merge this in now and release after?
In order to start testing bundler 2 support, we want to be able to optionally use it in Dependabot core by passing an
options[:bundler_2_available]
flag into the Fetcher, Parser and Updater APIs from the running environment.This PR adds this configuration layer which currently results in the Bundler native helper using a stubbed V2 library which returns a
NotImplemented
error for the existing method signatures.This error is this used as a testing proof that our top-level classes fail due to this error if we pass in the options to verify we have passed the configuration correctly. This is further verified by making
options
a required argument of thebundler_version
helper method, ensuring we get anArgumentError
in any cases we've missed.