Skip to content
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

Upgrade to v4.0 #3226

Merged
merged 126 commits into from
Oct 26, 2022
Merged

Upgrade to v4.0 #3226

merged 126 commits into from
Oct 26, 2022

Conversation

briri
Copy link
Contributor

@briri briri commented Oct 24, 2022

Researchers

  • Updated the PDF coversheet to include all Contributors
  • Fixed an issue that was causing the link to organizational guidance to repeat

Administrators

Developers

This release includes a major upgrade of Rails (5.x to 6.1) and an upgrade from Ruby 2.6 to 2.7.6. Please review the following release notes as well as our upgrade guide and be aware that you will most likely need to adjust/modify any local customizations you may have made within your local fork of the code.

This release includes an upgrade from Ruby 2.6 to Ruby 2.7.6 and Rails 5.x to Rails 6.1!

You will need to do the following:

  • Review the new default configuration options for Rails 6.1 and adjust as necessary for your implementation. The config settings can be found in config/initializers/new_framework_defaults_6_1.rb
  • Set a DMPROADMAP_HOST environment variable. Rails 6+ introduces new middleware that helps mitigate DNS rebinding attacks. This includes a hostname whitelist. The value you assign to this environment variable will be added to the whitelist.
  • Update the SUPPORTED_LOCALES CLIENT_LOCALES and DEFAULT_LOCALE in the config/initializers/translation.rb for your instance
  • If you have any raw SQL queries were deprecated in Rails 5.2. You may need to convert these over. See this article

Updates:

  • Updated Ruby from 2.6.3 to 2.7.6 Upgrade Ruby version #3139
  • Updated Rails from 5.2 to 6.1 Rails 6  #3103 Rails 6 Tasks (to-do list) #3187
  • Updated the TinyMCE editor to v5 and installed the 'oxide' skin Update tinyMCE to latest version #2942
  • Switched from Turbolinks to Turbo
  • Updated all JS and gem dependencies
  • Fixed an issue that allowed researchers to add an ORCID for a contributor that included spaces resulting in URLs that looked like https://orcid.org// 0000-0000-0000-0000. Contributor form allows user to include whitespace at the beginning of ORCID #3212
  • Made some minor modifications to improve query responsiveness on the Contributors, Guidances, Plans, Orgs, Users and Templates pages
  • Replaced all occurrences of update_attributes with updates since update_attributes was deprecated
  • Upgraded chart.js which is used on the Usage page to render the bar and pie charts
  • Made changes to accommodate the new Zeitwerk autoloader (which has stricter convention-over-configuration rules):
    • Changed the name of the JSONLinkValidator class file to JsonLinkValidator
    • Updated models so that any JSON fields have their default values defined prior to serialization
    • Updated deprecated occurrences of record.errors[:model] << 'foo' to record.errors.add(:model, 'foo')
    • Updated JS babel configuration
    • Updated the config/environments/*.rb files to use the new DMPROADMAP_HOST environment variable to defined the Rails.application.routes.default_url_options and new config.hosts setting.
    • Added a new download_coversheet_tickbox_checked flag to the config/initializers/_dmproadmap.rb initializer that will default the Plans Download page to default that checkbox to be true
    • Removed the out-of-date eslint package from webpacker. We will investigate re-introducing a JS linter in a future release
    • Fix to the db/seeds.rb file that is used for new installations so that it uses the find_or_create_by instead of create! to prevent duplicates when the DB already exists.
    • Updated and fixed tests as needed

benjaminfaure and others added 30 commits May 4, 2022 08:25
plans details coversheet is ticked by default.

Fix for issue #3063.

Changes:
- added a configurable property to
    # Check download of a plan coversheet tickbox
    config.x.plans.download_coversheet_tickbox_checked = false
- use property to check "project details coversheet" by default or not
if property set. If property is unset, the tickbox is unchecked.
…ct_sheet_tickbox_for_plan_downloads

Feature #3063 - Feature to be able to configure whether the download
…variable due to Rails new middleware that prevents DNS rebinding by introducing a host whitelist
… for zeitwerk. Fixed some issues with the ContactUs controller because its constant name did not conform to Rails standards. removed Faker:Language helper because it did not conform to naming conventions and updated tests. Started trying to fix rspec tests
add contributor to coversheet and add plan title to csv export
…eme_help

do not repeat help instructions for every guidance group
…veRecord::ConnectionNotEstablished exception

The full error was ActiveRecord::ConnectionNotEstablished - No connection pool for 'ActiveRecord::Base' found for the 'other' role.
Copy link
Contributor

@pengyin-shan pengyin-shan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

Copy link
Contributor

@benjaminfaure benjaminfaure left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking good so far !

It might be good to add a warning for people using query methods with raw SQL. It's been deprecated since Rails 5.2 and removed in Rails 6
You can see an example (and a solution) here : https://medium.com/@mitsun.chieh/activerecord-relation-with-raw-sql-argument-returns-a-warning-exception-raising-8999f1b9898a

DMP OPIDoR is impacted because we're using JSON fields with queries on the JSON data.
For example :
.pluck("data->>'keyword'")
.order("data->>'lastName', data->>'firstName'")

@briri
Copy link
Contributor Author

briri commented Oct 26, 2022

thanks @benjaminfaure and @pengyin-shan

I added a note to the You will need to do the following section for Developers that mentions the raw SQL change

@briri briri merged commit c16f001 into main Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants