-
Notifications
You must be signed in to change notification settings - Fork 58
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
Rails 7.1 updates #36
Conversation
@@ -1,4 +1,3 @@ | |||
--color | |||
--format documentation | |||
--order default |
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 option seemed to have become deprecated and caused rspec
to fail (hard to find info about where this happened after awhile searching online!). In any case, the default option is --order defined
(see docs), so we don't need to specify it.
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.
It looks like this happened in Rspec v3, which is quite old. I'm surprised we didn't notice warnings or issues from the beginning 😅
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.
You can remove the migration files, They aren't applicable to this project. I also suggest dropping the database so the schema is blank when students start using the template.
@@ -1,4 +1,3 @@ | |||
--color | |||
--format documentation | |||
--order default |
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.
It looks like this happened in Rspec v3, which is quite old. I'm surprised we didn't notice warnings or issues from the beginning 😅
config/environments/production.rb
Outdated
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. | ||
# config.force_ssl = true | ||
config.force_ssl = 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.
I think we still want to comment this out in case students don't have a plan that allows SSL when they deploy.
IIRC you don't get SSL for free Heroku apps, but maybe Render and Fly.io already allow this, I'm not sure.
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.
Good catch. I missed that change.
db/migrate/20240530180733_add_service_name_to_active_storage_blobs.active_storage.rb
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,27 @@ | |||
# This migration comes from active_storage (originally 20191206030411) | |||
class CreateActiveStorageVariantRecords < ActiveRecord::Migration[6.0] |
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.
You can remove this migration too for similar reasons. Since this is a template project and there is no database, (and active storage isn't being used) we don't need to run this migration since there's no existing data that we need to migrate.
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 clarifying about these migration files. I've removed them, reset the schema to version 0, and re-ran bin/setup
in a codespace to reset the development.sqlite3
and test.sqlite3
DBs and added those empty database files to this PR. These DBs were also already per-generated on main
on a commit from last year: 1f54f85
db/migrate/20240530180735_remove_not_null_on_active_storage_blobs_checksum.active_storage.rb
Outdated
Show resolved
Hide resolved
I'm going to merge this as is, as it's blocking me on some things. I took care of the fairly straightforward review comments already. |
Resolves #26
Resolves https://github.com/firstdraft/appdev/issues/590
See https://guides.rubyonrails.org/upgrading_ruby_on_rails.html for helpful guide on 7.0 -> 7.1 updating
The steps I took:
Gemfile
to appropriaterails
version (also needed to updatepuma
)bundle update
which updates all of the gems in theGemfile.lock
bin/rails app:update
, which provides many new files including new DB migration files. Carefully go through all files in the git diff editor in VSCode and modify them to include our special AppDev config settings (e.g. for codespaces)Testing I did:
rails generate devise:install
rspec
rails console
bin/server
live previewSome notes
Devise patch
I was getting some deprecation warnings from Devise that are a known (still unfixed) issue:
heartcombo/devise#5644
I fixed this, per the suggestion on that issue, on the commit: 47ae4f5. This is a bit awkward but I don't see another work around until they make an official fix to the gem.
New DB migration files
The
bin/rails app:update
command generated three new migration files. I'm not sure if / how these can be removed.