Skip to content

BETYdb 4.5

Compare
Choose a tag to compare
@gsrohde gsrohde released this 19 Jan 19:56
· 802 commits to master since this release

Summary of Changes

This release implements a number of bug fixes and allows site managers to customize contact information for their site(s).

Administrators: Note important upgrade instructions below.

New Features

Customization

Site managers can now customize the contact information—the e-mail address and phone number—that appears in the footer of every page. This e-mail address is also used as an administrative contact e-mail address (additional to those found in the database's users table) for automatically-generated messages.

Bug Fixes

Partial Fix for Issue #332

For deployments where the URLs for the BETYdb site and the PEcAn site are http(s)://[Domain Name]/[bety path] and http(s)://[Domain Name]/pecan respectively, the "Results" links on the "Listing Workflows" pages should now work. (Note that bety path need not necessarily be the literal bety, but the PEcAn path must be pecan.)

Fix for Issue #355

It used to be that adding a new BETYdb user would result in an error if no administrative users (users with page_access_level = 1) had been added to the database because the application would attempt to send a sign-up notification e-mail to an empty list of administrators. The new contact information customization feature now ensures there is always at least one administrative e-mail address in the "To:" list, so this error will no longer occur.

Fix for Issue #362

The "CF Guidelines" link on the "New Variables" page should now work, even for sub-URI deployments. (Prior to this, the link only worked for root-path deployments such as https://www.betydb.org.)

Fix for Issue #373

Non-point sites used to give "NaN" as the altitude of the site because we return the coordinates of the centroid of the geometry for these sites, and the centroid is a 2-dimensional point. We now simply show the altitude as blank.

Partial Fix for Issue #374

Up until now, the BETYdb Web application only supported editing Point geometries. Moreover, updating a sites row via the Web app would silently convert non-Point geometries to Point geometries using the centroid function even if only fields unrelated to the geometry (or no fields at all) were updated!

This fix prevents the Web app from changing the geometry data of non-point sites in order to prevent data loss.

Fix for Issue #377

Existing users can now request changes to their own access levels.

Steps Needed for Upgrade

Custom Configuration

Once you have pulled the new code from GitHub and restarted your Rails server, the site should be up and running. But unless you create the new customization file config/application.yml, the footer of all pages will show bogus contact information in place of what has, up until now, been the hard-coded default (namely, phone number (217) 300-0266 and e-mail address betydb@gmail.com). Even more importantly, unless you have been using 'thisisnotasecret' as the value of REST_AUTH_SITE_KEY in the config initializer file config/initializers/site_keys.rb, none of your users will be able to log in.

To address these issues, you must create an appropriate YAML config file. Here are step-by-step instructions for doing so:

  1. cd to the Rails root directory.

  2. Copy the default configuration file to application.yml:

    cp config/defaults.yml config/application.yml
    

    Do a copy, not a move! You want to keep defaults.yml as is. (For more elaborate set-ups having per-environment configuration values, you may want to copy config/application.yml.template instead. These instructions are for the simplest case.)

  3. Edit the string values for admin_phone and admin_email to the appropriate ones for your site.

  4. Open config/initializers/site_keys.rb and find the value for REST_AUTH_SITE_KEY. If it is anything other than 'thisisnotasecret', copy the value and use it as the value of rest_auth_site_key in application.yml. Otherwise, simply delete (or comment out) the line in application.yml that sets rest_auth_site_key.

  5. You now no longer need the file config/initializers/site_keys.yml, but don't delete it just yet! We want to be sure the site is working first: in case you mis-copied the site key value, we don't want the correct value to be lost forever. Instead, rename it:

    mv config/initializers/site_keys.rb config/initializers/site_keys.rb-disable
    

    Now the application will use and only use the value set in the application.yml file (or the value in defaults.yml if you aren't overriding the default value).

  6. Restart your Rails server. If you are using PhusionPassenger with Apache, you can just do

    touch tmp/restart.txt
    
  7. Go to your site page. You should see your custom contact information in the footer. If you still see the old hard-coded values ((217) 300-0266 and e-mail address betydb@gmail.com), you may not have actually restarted the server.

  8. Log out if you aren't already and then try logging in as any user. If you were able to log in, and you are sure that you actually did restart the server, it is now safe to delete config/initializers/site_keys.rb (which you renamed to config/initializers/site_keys.rb-disable above).

Status of RSpec Tests

  • There are now 246 RSpec tests that don't involve Javascript. These pass consistently, and may be run with the command

    bundle exec rspec -t ~js
    
  • There are 28 RSpec tests that involve Javascript. Most of these pass consistently, but occassionally one of these tests will fail intermittently. (This may be a timing-related issue.) These tests may be run with the command

    bundle exec rspec -t js
    

If one of these tests fails, the output will show the command needed to re-run the failing test. (If you aren't using RVM, you may need to prefix the command shown with bundle exec.) Often, the test will pass on a second try.

(Complete details for running the RSpec tests are on the Wiki pages at https://github.com/PecanProject/bety/wiki/Automated-Tests .)