Conversation
…recompile and db:prepare
…ed memory for selenium
… building during test
…sue running tests
…zer for post only
awilfox
left a comment
There was a problem hiding this comment.
There are some things to review and fix (see inline comments), but overall this looks good.
I have a few general/overview questions as well:
-
Was
bundle exec rails app:updaterun? The lack of changes inconfig/surprises me.Unfortunately, that is usually the most time-consuming part of updating Rails apps when I was doing it. The format/style doesn't match ours at all, so you need to use
d(diff) and apply the relevant changes manually. -
For the memory issues seen in CI, I'm wondering if adding this to
config/application.rbwould fix it:config.yjit = false
If it does, I would hazard that we could be more specific; perhaps putting it behind
if ENV['CI']or inconfig/environments/test.rb. Still worth a try to see if it fixes it, though. -
Do we want to mix the Twitter removal ticket with the dependency updates?
| # Only allow a list of trusted parameters through. | ||
| def item_params | ||
| params.require(:item).permit(:directory, :title, :author, :copies, :active, :publisher, :physical_desc, term_ids: []) | ||
| params.expect(item: [:directory, :title, :author, :copies, :active, :publisher, :physical_desc, { term_ids: [] }]) |
There was a problem hiding this comment.
To be clear, this change means all of these fields are now required. Is this desired? (permit will allow any of them to be blank, but allows them through; expect requires all listed parameters to have a value.)
There was a problem hiding this comment.
I thought params.expect allows for empty values but simply enforces the structure in a more modern way.
That was a rubocop suggestion.
docker-compose.yml
Outdated
| environment: &app-environment | ||
| LIT_LENDING_ROOT: spec/data/lending | ||
| LIT_IIIF_BASE_URL: http://iipsrv.test/iiif/ | ||
| #LIT_IIIF_BASE_URL: http://localhost/iiif/ |
There was a problem hiding this comment.
Was this a leftover from testing?
There was a problem hiding this comment.
Yes, when running it locally the viewer wasn't rendering the images unless I set the base URL to http://localhost/iiif. I'm not sure why it's set to http://iipsrv.test/iiif/. I can take that out and change a test that looks to look for http://localhost/iiif instead?
| services: | ||
| app: | ||
| build: !reset | ||
| command: sleep infinity |
There was a problem hiding this comment.
It fails with a 137 (out of memory) in the test stage of the build without it. I tried it with config.yjit = false as well. Not sure why it's using so much memory for testing.
awilfox
left a comment
There was a problem hiding this comment.
Glad to see rails app:update wasn't quite the heavy diff I feared it could be. There's a few things we should discuss before merging.
| # Log to STDOUT with the current request id as a default log tag. | ||
| config.log_tags = [:request_id] | ||
| config.logger = ActiveSupport::TaggedLogging.logger($stdout) |
There was a problem hiding this comment.
I don't think we want this in prod?
There was a problem hiding this comment.
That's a new default in rails 8. It wraps the standard logger and adds some context like request_id etc..
Should I take this out?
config/puma.rb
Outdated
| # This directive tells Puma to first boot the application and load code | ||
| # before forking the application. This takes advantage of Copy On Write | ||
| # process behavior so workers use less memory. | ||
| # The default is set to 3 threads as it's deemed a decent compromise between |
There was a problem hiding this comment.
| # The default is set to 3 threads as it's deemed a decent compromise between | |
| # The default is set to 5 threads as it's deemed a decent compromise between |
Documentation should reflect reality - this caught me when I did Framework's update, too.
There was a problem hiding this comment.
Good catch. I saw that framework was using 5 so I bumped it up here as well but missed the default comment. Will change that
Gemfile
Outdated
| gem 'okcomputer', '~> 1.19', '>= 1.19.1' | ||
| gem 'omniauth-cas', '~> 2.0' | ||
| gem 'pagy', '~> 5.6' | ||
| gem 'nokogiri', '~> 1.18.0' |
There was a problem hiding this comment.
Why are we explicitly specifying a dependency on nokogiri? I don't see any explicit usage of it in the app.
Is this a version pin for a security vulnerability? This should be documented if so, as I would remove this while doing other maintenance.
There was a problem hiding this comment.
It's used by some gems the app uses. I can remove it and let those gems handle it.
| gem 'pagy', '~> 5.6' | ||
| gem 'nokogiri', '~> 1.18.0' | ||
| gem 'non-digest-assets', '~> 2.6.0' | ||
| gem 'observer', '~> 0.1.2' |
There was a problem hiding this comment.
Same question as above re: nokogiri.
There was a problem hiding this comment.
factory-bot needs observer but it looks like I can remove non-digest-assets and replace it with mutex_m which is used. It's currently brought in via non-digest-assets but I'll remove that and so the app uses mutex_x directly
Gemfile
Outdated
| gem 'ruby-vips', '~> 2.0' | ||
| gem 'sprockets-rails', '~> 3.4' | ||
| gem 'typesafe_enum', '~> 0.3' | ||
| gem 'psych', '~> 2.0.10' |
There was a problem hiding this comment.
And same question here; we don't seem to use psych anywhere directly.
There was a problem hiding this comment.
That can be removed
…d static page instead of direct redirect to CAS
I ran into issues with the build. It was running out of memory during the tests so I had to rework the test section of build.yml. I'm not sure why this is using so much memory though. Any thoughts? This currently builds but it won't using the previous build.yml