-
Notifications
You must be signed in to change notification settings - Fork 3
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 LMS Rails version to 6.0.5 #9343
Conversation
# Memory profiling | ||
gem 'puma_worker_killer', '~> 0.1.0' | ||
|
||
# temp for migrations | ||
gem 'paperclip' | ||
|
||
# TBD | ||
gem 'rb-readline' | ||
gem 'awesome_print' | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the consolidation you did here for items we should do later analysis on regarding whether we use these or not. It may be worth going ahead and creating a Task card in Notion so that we remember to come back and do this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm planning on doing an audit after the 6.1 upgrade.
expect(json_hash['metadata']).to eq(@feedback_history.metadata) | ||
expect(json_hash['rule_uid']).to eq(@feedback_history.rule_uid) | ||
|
||
expect(json_hash['prompt']).to eq(@feedback_history.prompt.as_json) | ||
expect(json_hash['prompt']['text']).to eq(@prompt.text) | ||
|
||
expect(Time.iso8601(json_hash['time'])).to be_within(1.second).of @feedback_history.time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be a reasonable solution to this problem. I've generally fallen back to coercing string representations, but this feel cleaner.
a417c89
to
fedb2c2
Compare
fedb2c2
to
15392be
Compare
15392be
to
7724737
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Thanks for your work on this. I left a few small comments on things to double check, but nothing is blocking.
services/QuillLMS/Gemfile
Outdated
@@ -5,7 +5,7 @@ source 'https://rubygems.org' | |||
ruby '2.7.6' | |||
|
|||
# CORE DEPS | |||
gem 'rails', '5.2.8' | |||
gem 'rails', '~> 6.0.5' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious the about why the change away from a locked patch version. I would think even a patch upgrade of Rails would be a manually planned/tested endeavor, so curious what we gain from this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've viewed patch upgrades even with Rails as safe updates, but I will change it back to the locked version since I don't really have a strong preference.
@@ -0,0 +1,30 @@ | |||
# frozen_string_literal: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to clarify, does this empty file mean this functionality is off (that's what we would want)? Wondering since we are using the secure_headers gem to set CSP here. We'd want to ensure that these don't conflict.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was autogenerated, but I agree that it's confusing. I will remove it.
|
||
# Specify a serializer for the signed and encrypted cookie jars. | ||
# Valid options are :json, :marshal, and :hybrid. | ||
Rails.application.config.action_dispatch.cookies_serializer = :hybrid |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice that they provide a migration path. I don't think this is an issue for how we use cookies, but just flagging it in case it comes up:
SPOILER! When using the :json or :hybrid serializer, you should be aware that not all Ruby objects can be serialized as JSON. For example, Date and Time objects will be serialized as strings, and Hashes will have their keys stringified.
Upgrade LMS Rails version to 6.0.5 (#9343)
WHAT
Upgrade LMS from 5.2.8 to 6.0.5
WHY
Newer versions of Rails provide new features as well as security enhancements.
HOW
Update Gemfile with new Rails version. Then, after lots of flipping switches with Gemfile.lock, run
bundle
.A couple of specs had to be fixed:
1. Fixing module_parent calls:
parent
will be deprecated in Rails 6 so update those calls tomodule_parent
2. Fix time comparison:
as_json
calls in Rails 6 convertsActiveSupport::TimeWithZone
values to strings whereas it currently leaves the object as aActiveSupport::TimeWithZone
. (NB: Comparisons with these objects are tricky, see here and here)Addendum 1:
Cookie serialization is updated to
hybrid
per this postAddendum 2:
Removed livingstyleguide gem from development group since it breaks development build. This was missed on heroku since the gem doesn't run.
Screenshots
(If applicable. Also, please censor any sensitive data)
Notion Card Links
(Please provide links to any relevant Notion card(s) relevant to this PR.)