Conversation
|
A quick set of todos before I transition to my other position mid August. :
|
|
Test successful. Needs to be merged with #845, once approved. Merging involves accepting the merge conflicts from the introduction of the Config Gem. |
…lock. * todo: update config & code
* rubocop-capybara, rubocop-minitest, rubocop-performance, and rubocop-rails extension supports the new plugin system in rubocop 1.72
* site loads enabling: config/initializers/new_framework_defaults_7_2.rb: * adds to workaround current Rails 7.2 incompatibility in restarone/comfortable-mexican-sofa: Rails.application.config.active_record.default_column_serializer = YAML
* After running bin/rails app:update, staging.rb not changed therefore align with updated production.rb while retaining staging/production differences.
66d8b1b to
e36db20
Compare
| - name: Read Node version from .tool-versions | ||
| id: node_version | ||
| run: | | ||
| echo "node_version=$(grep nodejs .tool-versions | awk '{print $2}')" >> $GITHUB_OUTPUT | ||
|
|
||
| - uses: actions/setup-node@v5 | ||
| with: | ||
| node-version: 18 | ||
| node-version: ${{ steps.node_version.outputs.node_version }} |
There was a problem hiding this comment.
Inconsistency between ./tool-versions and what is defined in the GitHub action. This change aligns the two.
| - standard | ||
| plugins: | ||
| - rubocop-capybara | ||
| - rubocop-minitest | ||
| - rubocop-performance | ||
| - rubocop-rails | ||
| - standard | ||
|
|
There was a problem hiding this comment.
Silence a warning while running rubocop. rubocop-capybara, rubocop-minitest, rubocop-performance, and rubocop-rails extension supports the new plugin system in rubocop 1.72.
| require "bundler/setup" | ||
|
|
||
| # explicit rubocop config increases performance slightly while avoiding config confusion. | ||
| ARGV.unshift("--config", File.expand_path("../.rubocop.yml", __dir__)) |
There was a problem hiding this comment.
bin/rails app:update suggestion.
| # it changes. This slows down response time but is perfect for development | ||
| # since you don't have to restart the web server when you make code changes. | ||
| config.cache_classes = false | ||
| config.enable_reloading = true |
There was a problem hiding this comment.
Rails 7.2: can omit cache_classes = false because it's now implied when enable_reloading = true. Suggestion by bin/rails app:update.
| # Rails.application.config.active_record.default_column_serializer = nil | ||
| # comfortable_mexican_sofa v3.5 https://github.com/restarone/comfortable-mexican-sofa.git | ||
| # not updated for Rails 7.1 to specify serialization method for the | ||
| # Comfy::Cms::Fragment and Comfy::Cms::Revision models | ||
| Rails.application.config.active_record.default_column_serializer = YAML |
There was a problem hiding this comment.
Flagging as a non-default setting due to lack of maintenance on the current fork of comfortable_mexican_sofa. YAML needs to be specifed or comfortable_mexican_sofa patched to specify a serialization method for Comfy::Cms::Fragment and Comfy::Cms::Revision models.
| config.logger = ActiveSupport::Logger.new($stdout) | ||
| .tap { |logger| logger.formatter = ::Logger::Formatter.new } | ||
| .then { |logger| ActiveSupport::TaggedLogging.new(logger) } | ||
|
|
There was a problem hiding this comment.
bin/rails app:update suggestion. The previous config.logger definition aligned with Jupiter and/or the default Rails generated version of this file. The rest of this file aligns with bin/rails app:update suggestions with past customizations layered ontop. Similar with other config/environments/{environment}.rb files.
| threads_count = ENV.fetch("RAILS_MAX_THREADS", 5) | ||
| threads threads_count, threads_count | ||
|
|
||
| # Allow puma to be restarted by `rails restart` command. | ||
| # Specifies the `port` that Puma will listen on to receive requests; default is 3000. | ||
| port ENV.fetch("PORT", 3000) | ||
|
|
||
| # Allow puma to be restarted by `bin/rails restart` command. | ||
| plugin :tmp_restart | ||
|
|
||
| # Specify the PID file. Defaults to tmp/pids/server.pid in development. | ||
| # In other environments, only set the PID file if requested. | ||
| pidfile ENV["PIDFILE"] if ENV["PIDFILE"] |
There was a problem hiding this comment.
bin/rails app:update suggested text and reordering. I reordered to hopefully make the next Rails update easier. The pidfile setting was added by bin/rails app:update. I'm not sure if needed.
|
404.html, 406-unsupported-browser.html, 422.html, 500.html, icon.png, and icon.svg were added by the |
…refore downgrade rack to 3.1.17 with security fixes. Fixes merge from main causing build failures
| rack (>= 2.2.4) | ||
| rack (>= 2.2.4, < 3.2) |
There was a problem hiding this comment.
Notice the refined version set on actionpack for rack. This requires the downgrade of rack from 3.2.2 to 3.1.17 later on in Gemfile.lock. Both remain supported: https://github.com/rack/rack?tab=readme-ov-file#version-supported. Impact seems unnoticable.
pgwillia
left a comment
There was a problem hiding this comment.
Just the comment about the potential duplication of error messages. Is there work to do there?
public/404.html
Outdated
There was a problem hiding this comment.
I didn't see why we have this, but there's routes, an ErrorController and views in our code
Lines 8 to 10 in 77ccbb3
https://github.com/ualbertalib/library-cms/tree/main/app/views/errors
Does this replace that?
There was a problem hiding this comment.
I accidentally deleted my commit on this while untangling the dependency problems. Yes, I need to redo work from 3 weeks ago.
There was a problem hiding this comment.
Thanks for flagging this. Looks better now.
There was a problem hiding this comment.
Just for my understanding... Are we handling errors in a non-standard way?
There was a problem hiding this comment.
Did my research. It's a standard way of having custom error pages
https://guides.rubyonrails.org/configuring.html#config-exceptions-app
library-cms/config/application.rb
Line 26 in f359b99
There are many blogs describing this approach. Here's one from 2024 https://www.dotruby.com/articles/how-to-create-a-custom-error-page-in-rails
* Pre-existing config/routes.rb routes with custom erb file handle the error pages; see https://github.com/ualbertalib/library-cms/blob/77ccbb358e9e44ff2e797ead3549f86dc01e9e2c/config/routes.rb#L8-L10
public/404.html
Outdated
There was a problem hiding this comment.
Did my research. It's a standard way of having custom error pages
https://guides.rubyonrails.org/configuring.html#config-exceptions-app
library-cms/config/application.rb
Line 26 in f359b99
There are many blogs describing this approach. Here's one from 2024 https://www.dotruby.com/articles/how-to-create-a-custom-error-page-in-rails
Uh oh!
There was an error while loading. Please reload this page.