Skip to content

Ap 587 update dependencies#21

Draft
davezuckerman wants to merge 28 commits intomainfrom
AP-587-update-dependencies
Draft

Ap 587 update dependencies#21
davezuckerman wants to merge 28 commits intomainfrom
AP-587-update-dependencies

Conversation

@davezuckerman
Copy link
Contributor

@davezuckerman davezuckerman commented Feb 25, 2026

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

David Zuckerman added 21 commits February 20, 2026 16:10
Copy link
Member

@awilfox awilfox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:update run? The lack of changes in config/ 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.rb would 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 in config/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: [] }])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought params.expect allows for empty values but simply enforces the structure in a more modern way.
That was a rubocop suggestion.

environment: &app-environment
LIT_LENDING_ROOT: spec/data/lending
LIT_IIIF_BASE_URL: http://iipsrv.test/iiif/
#LIT_IIIF_BASE_URL: http://localhost/iiif/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this a leftover from testing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be unnecessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member

@awilfox awilfox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +42 to +44
# Log to STDOUT with the current request id as a default log tag.
config.log_tags = [:request_id]
config.logger = ActiveSupport::TaggedLogging.logger($stdout)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we want this in prod?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# 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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question as above re: nokogiri.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And same question here; we don't seem to use psych anywhere directly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That can be removed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants