scientist-softserv / ams

Archival Management System to support the American Archive of Public Broadcasting
GNU General Public License v3.0
1 stars 0 forks source link

Rails Upgrade #23

Closed jillpe closed 1 year ago

jillpe commented 1 year ago

Summary

Do initial rail upgrade from 5.1.6 to 6.1

Acceptance Criteria

Screenshots or Video

Testing Instructions

Notes

watch out for protected attributes

Gem list

Handle separately

Update first

Don't update

ShanaLMoore commented 1 year ago

blocked by #21 - Shana to have a convo with Steven. Which tool is better and why? Prod dev is using bootboot.

ShanaLMoore commented 1 year ago

Implementation suggestions: per https://www.youtube.com/watch?v=eiQutUYn_9A

upgrade to the next minor version at a time (5.1 => 5.2 => etc), then upgrade to the next major version (=> 6.0.0). address and fix deprecation warnings.

Image

- [backport](https://blog.testdouble.com/posts/2021-05-11-working-strategically-through-rails-upgrades/) strategy: 
  - take new things and backport it to the old version of rails that your app is using (ie: strong params). 
    - include module to cause app to error ie: 

Image

Test Failure strategies - break it up:

ShanaLMoore commented 1 year ago

example of gemfile + notes w Steven

if ENV['DEPENDENCIES_NEXT'] && !ENV['DEPENDENCIES_NEXT'].empty?
  # gem 'rails', '~>5.2'
  # hit every version
  # fix deprecation warnings => sql string to where or joins method should be wrapped in a call to arel.sql (per rails 6)
  # update all gems other than rails to the latest as possible to deploy smaller PRs of those changes
  # so that it's not like you upgraded rails and 30 gems and don't know which one was the issue
  # group the dependencies. big ones like hyrax, do them on their own. smaller ones can be grouped. 
  # this process makes it easier to test. 
  # at the end update rails. 
  # look up blog articles and release notes for each version for any gotchas and breaking changes => rails guides. 
  # some depdendecy upgrades will be blocked by a rails version, so this process will be repeated multiple times. 
  # active storage or new features? otherwise not much has changed in core rails
  # 
  # continual? ok to leave it indefinitely and use for upgrading any gems. 
  # deploy - ci can build different images, can deploy it to staging. deploy image during an offtime and roll back if needed. 
  # have devs work under next but test on current.
  # 

else
  # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
  gem 'rails', '~> 5.1.5'
end
ShanaLMoore commented 1 year ago

this required us to upgrade the gemspec of hyrax-batch_ingest

ref: https://github.com/samvera-labs/hyrax-batch_ingest/pull/152

and sony_ci_api was switched to main instead of v1.0