Enhanced API for rOpensci traits package; upgrade to rails 3.2, Ruby 2.1.5.
This release upgrades the Rails version from Rails 3.0.18 to Rails 3.2.21 and changes the RVM-specified version of Ruby from version 1.9.3-p429 to version 2.1.5. In addition to these changes which in and of themselves make for improved security, there are numerous minor changes to the Rails code including security fixes, removal of obsolete code, fixes and improvements to the query API, and phase-out of vendor plugins in favor of gems,
Changes Pertinent to PEcAn Users
Administrators need to do a database migration.
See "Database Changes" below.
Summary of Changes
New Features
Enhanced API for rOpensci traits package
See section 2 of the BETYdb Data Access guide at https://www.authorea.com/users/5574/articles/7062.
API Key generation
Users may now generate their own API keys by going to the Users page and clicking the "key" button. And there is now a new rake task that administrators can use to generate API keys for all current users. See section 2.3 of the BETYdb Data Access guide at https://www.authorea.com/users/5574/articles/7062.
Directory-Specific Session Keys
When multiple copies of BETYdb are deployed on the same host, they now use differently-named session cookies (assuming the basenames of the Rails root directories are different). This mainly affects developers who may visit different copies of BETYdb on the same host simultaneously; up to now, such users will likely have seen baffling interactions between the two copies.
Updated version of selenium-webdriver
The Gem version specification for selenium-webdriver has been changed to a version compatible with the latest versions of Firefox. This mainly affects those running the RSpec tests in debug mode.
Addition of primary keys to join tables
This facilitate the synchronizing of data having to do with many-to-many associations.
Security Updates
Miscellaneous security updates have been implemented, including
Upgrading of Rails from version 3.0.18 to 3.2.21
Upgrading the default version of Ruby to version 2.1.5
Storage of session data in the database instead of in cookies
Elimination of most non-specific routes
In keeping with recommended practice in Rails 3.2, packages that were formerly kept in vendor plugins are now in Ruby gems.
The change to database storage of session data has the additional benefit of overcoming some restrictions on the size of bulk uploads.
Bug Fixes
The API for querying and downloading data offers more features than available previously, restoring some features that were lost in the upgrade from Rails 2 to Rails 3. See section 2 of the Data Access Guide: https://www.authorea.com/users/5574/articles/7062
Cloning of PFTs now works again.
A bug that prevented editing a PFT if it was associated with some Prior whose paramb column was NULL has now been fixed.
Steps Needed for Upgrade
Database Changes
Administrators need to do database migrations!
One migration has been added that adds id columns to the join tables.
The database version for this release is 20150202215147.
Ruby Upgrade
The officially-supported version of Ruby for use with BETYdb is now Ruby version 2.1.5. It is recommended that you upgrade to some Ruby 2 version since Ruby 1.9.3 is no longer being maintained. (See https://www.ruby-lang.org/en/news/2015/02/23/support-for-ruby-1-9-3-has-ended/ for details.)
Nevertheless, users who can not or do not wish to upgrade will likely be able to continue to use Ruby 1.9.3 without difficulty. It may also be possible to use the latest version of Ruby, Ruby 2.2.1.
To continue using Ruby 1.9.3
If you use RVM or some other Ruby version management system that reads the .ruby-version file, revert the string in that file so that it once again reads ruby-1.9.3-p429. You may wish to add .ruby-version to your .gitignore file so that git doesn't try to change it or flag it as having been modified.
To upgrade to Ruby 2.1.5
Install Ruby 2.1.5 if you haven't done so already. If you use RVM, you may do this by running
rvm install 2.1.5
If you run BETYdb with Apache httpd, change or add the directive
PassengerDefaultRuby /path/to/ruby2/executable
or the
PassengerRuby /path/to/ruby2/executable
directive according to your needs.
Otherwise, if you only use WEBrick, just ensure that the version of Ruby you want to use is first in your path. If you are using RVM, this is automatic (though you may have to leave and then return to the BETYdb Rails root directory if you haven't done so since updating your .ruby-version file; run rvm current to verify that you are using the correct Ruby version and gemset).
Gem Installation, Including Rails Upgrade
Administrators need to run the bundler to install several new Ruby Gems and updated versions of existing ones.
First, change to the root directory of your BETYdb Rails installation. Then, if you are using RVM, run rvm current to ensure you are using the correct Ruby version and gemset. It should say ruby-2.1.5@betydb_rails3 if you upgraded Ruby and ruby-1.9.3-p429@betydb_rails3 if you did not. If you are not using a Ruby version management system, simply run ruby -v to check your version of Ruby.
Once you ensure you are using the correct Ruby version and gemset, run
bundle
If you have trouble installing capybara-webkit and don't need to run the Javascript-based RSpec tests, you may run
bundle --without javascript_testing
instead. If you won't be running RSpec tests at all and want to minimize your Gem installation, run
bundle --without javascript_testing test debug
See https://github.com/PecanProject/bety/wiki/Installing-the-BetyDB-Rails-Application#minimizing-gem-installation for details.
Status of RSpec Tests
All tests continue to pass when run in the default environment and can be run using the command
bundle exec rspec
Complete details for running the rspec tests are on the updated Wiki page at https://github.com/PecanProject/bety/wiki/Automated-Tests