-
Notifications
You must be signed in to change notification settings - Fork 987
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
fixes #19050 - add Ruby on Rails 5.0 support #4422
Conversation
@domcleal thanks for doing this, it seems like a major effort... a few questions:
are there any other highlight to the release (performance etc) that you've noticed? thanks! |
We can do, though I don't see much point in that. Testing the default version ought to be sufficient.
I don't think any is necessary. Rails 4 provides deprecation warnings where required.
All Ruby 2.0, 2.1 and early 2.2 installations, as Rails 5.0 requires 2.2.2 or higher. For OS versions, that would be Ubuntu 14.04, Debian 8, current EL7 packages, and Fedora 24.
I don't see why not.
No. |
|
05a2e50
to
a5976c0
Compare
PR rebased for review. Fixes for MySQL test failures etc. merged via other PRs. |
@domcleal is there an easy way to run this patch across many plugins? I am assuming some of them will break and hope to allow them to prepare in advance? |
Add the plugins to your checkout, run their rake test tasks? |
I know that :-) , I mean using jenkins matrix. |
Sure, you can create a matrix job using the test plugin job or its scripts then. |
1dd56c1
to
5386b62
Compare
[test katello] |
@domcleal I often get
bumping the pool size value helped to avoid it (from 5 to 10) but I wonder if you know more about the root cause or if we should update our installer too? |
foreman and katello test failures seems unrelated. |
@lzap heads up, this breaks discovery a bit
|
also,when running tests locally i see failures on all facts related tables, any idea why it fails on my env?
|
[test foreman] |
I don't know the root cause without more information on how to reproduce it. I don't see why the pool would need to be higher unless something (internally or your web server) is multi-threaded.
It suggests that the auto-increment on the |
thanks @domcleal i had a local user db that probably didnt have the auto increment. @domcleal could you provide a way to preserve the existing rake task interface behavior this breaks every plugin that adds rake tasks by needing to |
config/boot_settings.rb
Outdated
SETTINGS = File.exist?(dist_settings_file) ? YAML.load(ERB.new(File.read(dist_settings_file)).result) || {} : {} | ||
|
||
settings_file = File.expand_path('../settings.yaml', __FILE__) | ||
SETTINGS.merge! YAML.load(ERB.new(File.read(settings_file)).result).select { |k,v| k == :rails } |
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.
nitpick: can use something like
SETTINGS[:rails] = YAML.load(...)[:rails]
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.
Fixed.
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.
@domcleal Left a comment inline about the packaging work that could be needed, let me know what you had in mind.
Still need to check breakages on plugins or tasks like @ohadlevy said before.
Thanks, this looks like a neat solution to the problem (especially since it looks like for some time we'd have 4.2 on some OSs).
when '4.2' | ||
gem 'rails', '4.2.8' | ||
when '5.0' | ||
gem 'rails', '5.0.3' |
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.
There is no RoR 5.0 nor Ruby 2.3+ SCL that I'm aware of, I asked the CentOS SCL SIG on #centos-devel and @pvalena replied it's on its way, but not yet there.
How would this be handled package-wise? Would we need 2 different packages foreman-1.16-rails-50 foreman-1.16-rails-42 or is there some other solution I'm not yet aware of? Fedora/Ubuntu/etc... using 4.2 until it's possible to switch to 5.0 and EL7 relying on the SCL?
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'm not sure I understand your question. Supporting both is unlikely to be useful, but they can use the default Rails version or override it via config/settings.yaml.dist
if desired.
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 don't advocate for supporting both on every platform either, my question is more about what to do once this is merged:
- CentOS/RHEL for 1.16 will probably have the required SCLs to run this without a problem (so this is fine)
- Fedora 25+ doesn't need anything AFAIK (https://fedoraproject.org/wiki/Changes/Ruby_on_Rails_5.0). Older fedoras cannot be supported
- Debian only ships Ruby 2.3+ on stretch and sid (jessie is 2.1.5). So it should ship with the 4.2 version.
- Ubuntu xenial, yakkety and zesty all have 2.3+. Trusty, however, is still on 1.9.3
Therefore, Debian Jessie and Ubuntu Trusty if we want to keep maintaining them will have to be 4.2, while the rest would be 5.0. Is that your original plan?
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.
Trusty can upgrade Ruby version using PPA, so only Jessie blocks from upgrading all to 2.3.
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.
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.
Adds configurable support for running on Ruby on Rails 5.0 or 4.2, defaulting now to 5.0 on Ruby 2.3 or higher. Ruby versions with partial or no support remain using 4.2 by default. Other points: 1. SETTINGS[:rails] is loaded pre-Rails boot, then post-boot the majority of the SETTINGS are loaded depending on the environment. settings.yaml.dist will allow packagers to override the default version of Rails loaded to match their distribution. 2. rails-controller-testing, record_tag_helper replace extracted Rails 4.x features. 3. ParamsParser middleware is no longer loaded by default and is deprecated, CatchJsonParseErrors is no longer order dependent. 4. quiet_assets is not supported under Rails 5, will be replaced under ticket #18500, only affects development logging.
Done, however it will be hard to remove this again in the future via a deprecation. Plugins should require files they use. PR updated. |
@jlsherrill @dLobatog any idea on the katello failures? is it due to a change in foreman or katello? |
It looks like as soon as it gets to this test `Actions::Pulp::Repository::RemoveScheduleTest#test_remove_schedule`` it aborts (http://ci.theforeman.org/job/test_develop_pr_katello/2912/database=postgresql,ruby=2.2,slave=fast/consoleFull). I'll investigate it further but I don't think this is expected to break, so it's probably changes in this PR. |
when '4.2' | ||
gem 'rails', '4.2.8' | ||
when '5.0' | ||
gem 'rails', '5.0.3' |
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 don't advocate for supporting both on every platform either, my question is more about what to do once this is merged:
- CentOS/RHEL for 1.16 will probably have the required SCLs to run this without a problem (so this is fine)
- Fedora 25+ doesn't need anything AFAIK (https://fedoraproject.org/wiki/Changes/Ruby_on_Rails_5.0). Older fedoras cannot be supported
- Debian only ships Ruby 2.3+ on stretch and sid (jessie is 2.1.5). So it should ship with the 4.2 version.
- Ubuntu xenial, yakkety and zesty all have 2.3+. Trusty, however, is still on 1.9.3
Therefore, Debian Jessie and Ubuntu Trusty if we want to keep maintaining them will have to be 4.2, while the rest would be 5.0. Is that your original plan?
I'll check what are the problems with this + Katello and if everything's OK, merge sooner than later. I believe only Fedora 25, and newer versions of Ubuntu would be able to use this by default right now though. |
[test katello] |
The katello test seems to abort at different points, on the latest run it was at |
[test katello] same here - I cannot reproduce the failures on Rails 4.2, Rails 5.0 + Katello breaks currently with |
@jlsherrill I'm seeing a similar failure on http://ci.theforeman.org/job/test_develop_pr_katello/2985/database=postgresql,ruby=2.2,slave=fast/console , which corresponds to #4591 , I wouldn't be so sure it's this PR causing it. |
@jlsherrill can you confirm? thanks! |
@dLobatog the failure on http://ci.theforeman.org/job/test_develop_pr_katello/2985/database=postgresql,ruby=2.2,slave=fast/console looks completely different than the failure here. The failure there the tests don't even start and there is some postgresql issue. The failure here gets into the tests but then randomly aborts. I still have not seen this failure anywhere else. Lets try again [test katello] |
Adds configurable support for running on Ruby on Rails 5.0 or 4.2,
defaulting now to 5.0 on Ruby 2.3 or higher. Ruby versions with partial
or no support remain using 4.2 by default. Other points:
majority of the SETTINGS are loaded depending on the environment.
settings.yaml.dist will allow packagers to override the default
version of Rails loaded to match their distribution.
4.x features.
deprecated, CatchJsonParseErrors is no longer order dependent.
ticket #18500, only affects development logging.