Feature #12873
closed
Update Rails to 4.1.latest
Added by Dominic Cleal over 9 years ago.
Updated almost 7 years ago.
Description
#7230 updates Rails to 4.1.5, but this should be updated again to 4.1.latest (currently 4.1.14), either pinned specifically or ~> 4.1.5
.
There are changes to how test DB schemas are maintained between 4.1.5 and 4.1.14 (db:test:prepare is no longer deprecated), so this will need revising.
1.11.0 blocker, as 4.1.5 contains known security vulnerabilities.
- Status changed from New to Assigned
- Assignee set to Dominic Cleal
- Blocked by Bug #13242: db:migrate fails under Rails 4.1.latest with "katello_key_system_groups_pkey" not found added
- Status changed from Assigned to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/3082 added
- Blocked by Bug #13335: Tests fail on Rails 4.1.14 added
- Related to Refactor #13409: Remove maintain_test_schema! Rails initializer added
- Blocked by Bug #13592: Partial ../overrides/foreman/activation_keys/_host_tab accessed outside of view paths added
- Related to Bug #13666: Partials in app/overrides must be moved into a views path added
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
- Related to Bug #13710: apipie:cache fails with Missing template ../../layouts/apipie/apipie added
- Related to Bug #13804: apipie:cache fails with :"en-GB" is not a valid locale added
- Related to Bug #13977: Upgrade rails to 4.1.14.2 added
- Bugzilla link set to 1325632
Also available in: Atom
PDF
fixes #12873 - update Rails to 4.1.14.1
maintain_test_schema! changed behaviour and now launches db:test:prepare
in the background, causing the environment to be loaded again. A check
in the initializer prevents this from happening recursively.
Ideally this call would be removed from the initializers and leave it to
rails/test_help, but requires one of three solutions:
1. validates_lengths_from_database and validate_inclusion_in_families
must be lazier, not checking the database during class
initialisation. The Rails environment and even some models could be
loaded but only start working after the DB is available, instead of
not setting up their validators.
2. Remove all model class loading from the environment setup. The
apipie initializer can be made lazier, the HostObserver can be
refactored, but many plugins still cause models to be loaded through
to_prepare hooks.
3. Ignore the problem, always set up the test DB schema externally
before using rake tasks, without relying on rails/test_help and
maintain_test_schema.
Any of these would allow for the Rails environment to be loaded either
before the test DB schema is maintained without an effect on behaviour.
Test failures in the pagelets tests are fixed, which previously
referenced partials stored outside of the known view paths. These are
blocked by Rails in the Action View CVE-2016-0752 fix, so instead the
static fixtures directory is added to the view search paths.