-
Notifications
You must be signed in to change notification settings - Fork 900
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
Lock down bundler to pre-2.2.10 and fix ManageIQ::Environment.bundler_version #21051
Conversation
d91579a
to
6369e44
Compare
@@ -132,7 +132,12 @@ def self.update_ui | |||
|
|||
def self.bundler_version | |||
gemfile = APP_ROOT.join("Gemfile") | |||
File.read(gemfile).match(/gem\s+['"]bundler['"],\s+['"](.+?)['"]/)[1] |
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 would only return "~> 2.1"
gemfile_dependencies = Bundler::Definition.build(gemfile, nil, {}).dependencies | ||
bundler_dependency = gemfile_dependencies.detect { |dep| dep.name == "bundler" } | ||
|
||
version_requirements = bundler_dependency.requirement.requirements |
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.
>> version_requirements
=> [["~>", #<Gem::Version "2.1">], [">=", #<Gem::Version "2.1.4">], ["<", #<Gem::Version "2.2.10">]]
6369e44
to
4ce5246
Compare
4ce5246
to
71e5a0b
Compare
|
Checked commit agrare@71e5a0b with ruby 2.6.3, rubocop 0.82.0, haml-lint 0.35.0, and yamllint |
LGTM, but does |
|
Yeah so if I include e.g.
|
@agrare @Fryguy Cool, I didn't know about this script, and I do agree it is a better long term solution. That said, it doesn't seem like the UI classic actually consumes this script like it does here in the base repo: https://travis-ci.com/github/ManageIQ/manageiq-ui-classic/jobs/483230007#L254-L258
(bundler So we might need to make some changes over in UI Classic regardless if we take this change or mine. |
@NickLaMuro I believe the https://github.com/ManageIQ/manageiq-ui-classic/blob/master/bin/setup#L20 |
@miq-bot cross-repo-tests manageiq-ui-classic |
From Pull Request: ManageIQ/manageiq#21051
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.
@agrare Good point. I clearly was missing that bit when I was double checking, and I think I agree that what you have here should work.
That said, I think in this particular case, the cross-repo tests, while they appear to be working as expected, aren't a perfect replication since we are simulating a travis run, but not replicating it. So there is a chance it doesn't work quite the same.
That said, I think you are still good, so 👍 from me.
Bundler 2.2.10 has a bug causing bundle install to fail with gems being installed from one source that depend on gems from another. Until that is resolved we should lockdown bundler to max 2.2.9.
Also the
ManageIQ::Environment.bundler_version
regex isn't able to properly parse all gem requirements other than the first on. We can use theBundler::Definition
to parse the Gemfile "properly"Alternative to: ManageIQ/manageiq-ui-classic#7634 (comment)