Revision fb9f45e8
Added by Daniel Lobato Garcia over 8 years ago
- added
- modified
- copied
- renamed
- deleted
- Gemfile (diff)
- app
- assets
- javascripts
- host_checkbox.js
- host_checkbox.js.erb
- topbar.js (diff)
- stylesheets
- javascripts
- controllers
- helpers
- models
- bookmark.rb (diff)
- compute_profile.rb (diff)
- concerns
- config_group_class.rb (diff)
- domain.rb (diff)
- environment.rb (diff)
- host
- base.rb (diff)
- managed.rb (diff)
- host_class.rb (diff)
- hostgroup_class.rb (diff)
- lookup_keys
- operatingsystem.rb (diff)
- puppetclass.rb (diff)
- report.rb (diff)
- subnet.rb (diff)
- user.rb (diff)
- user_mail_notification.rb (diff)
- user_role.rb (diff)
- usergroup.rb (diff)
- usergroup_member.rb (diff)
- services
- views
- assets
- bundler.d
- config
- db
- lib
- test
- functional
- lib
- custom_runner.rb
- custom_runner_test.rb
- test_helper.rb (diff)
- test_runner.rb
- unit
Fixes #7230, #12021 - Upgrade to Rails 4.1.5
This commits upgrades Rails to Rails 4.1.5. See a description of the
changes included here, and go to the pull request in GitHub to see more
detailed explanations:
On minitest 5, the runner API was deprecated, so our custom test
runner is no longer working.
An index is added previously on lookup_values :priority, and on Rails 4
rename_column changes 'priority' to 'match' already changes the name of
the index.
On Rails 4, .find will not default to .friendly.find so find_hostgroup,
find_environment and find_host will fail for non numeric IDs. However, we can
use from_param to find these objects. This is something we can do both on
Rails 3 and Rails 4, whereas using .friendly isn't an option until friendly_id
5.0, which depends on Rails 4.
The finder needed to be refactored because with the new Friendly ID we
have to use .friendly explicitely. It currently follows the strategy of
searching like this:
- from_param -> .friendly -> regular find
Some of our tests are checking if port 80 or 443 is included in the URL
generated by lib/foreman/renderer.rb. However url_for has changed in
Rails 4 and now it does not append the port even if explicitly added.
If the protocol is specified, as it is in this case, then the url
generated will just have the protocol (http or https) but not the port
(80 or 443)
On Rails 4 such validations will fail when we try to create objects
without explicitely assigning the id.
Puppetclass.new(:config_group => config_group) would fail even for a
valid config group, :config_group_id => config_group.id should be used
instead.
To avoid that, we validate the object, not the ID column
Changes that have to deal with how some of the internal Rails objects
need a new syntax, like generating routes, exceptions, form builders.
None of these are Rails 3 compatible.
There are actually two parts to the issue of not being able to migrate
with this branch. The first is
https://gist.github.com/eLobato/0f5db50b5c93cc6c277c and can be
temporarily fixed with rails/sass-rails#136 (comment) I am not sure of a
long term fix for that atm.
Once that is patched, this error
https://gist.github.com/johnpmitsch/96e5ba3629890931193a happens on a
migration. This will fix that error by changing the Migrator class
initializer arguments which have changed from rails 3 to rails 4
Fixes #7230, #12021 - Upgrade to Rails 4.1.5
This commits upgrades Rails to Rails 4.1.5. See a description of the
changes included here, and go to the pull request in GitHub to see more
detailed explanations:
On minitest 5, the runner API was deprecated, so our custom test
runner is no longer working.
An index is added previously on lookup_values :priority, and on Rails 4
rename_column changes 'priority' to 'match' already changes the name of
the index.
On Rails 4, .find will not default to .friendly.find so find_hostgroup,
find_environment and find_host will fail for non numeric IDs. However, we can
use from_param to find these objects. This is something we can do both on
Rails 3 and Rails 4, whereas using .friendly isn't an option until friendly_id
5.0, which depends on Rails 4.
The finder needed to be refactored because with the new Friendly ID we
have to use .friendly explicitely. It currently follows the strategy of
searching like this:
- from_param -> .friendly -> regular find
Some of our tests are checking if port 80 or 443 is included in the URL
generated by lib/foreman/renderer.rb. However url_for has changed in
Rails 4 and now it does not append the port even if explicitly added.
If the protocol is specified, as it is in this case, then the url
generated will just have the protocol (http or https) but not the port
(80 or 443)
On Rails 4 such validations will fail when we try to create objects
without explicitely assigning the id.
Puppetclass.new(:config_group => config_group) would fail even for a
valid config group, :config_group_id => config_group.id should be used
instead.
To avoid that, we validate the object, not the ID column
Changes that have to deal with how some of the internal Rails objects
need a new syntax, like generating routes, exceptions, form builders.
None of these are Rails 3 compatible.
There are actually two parts to the issue of not being able to migrate
with this branch. The first is
https://gist.github.com/eLobato/0f5db50b5c93cc6c277c and can be
temporarily fixed with rails/sass-rails#136 (comment) I am not sure of a
long term fix for that atm.
Once that is patched, this error
https://gist.github.com/johnpmitsch/96e5ba3629890931193a happens on a
migration. This will fix that error by changing the Migrator class
initializer arguments which have changed from rails 3 to rails 4
in that case
asset-url or image-url