Conversation
Coverage Report for CI Build 30031688818Coverage remained the same at 98.384%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
JPrevost
left a comment
There was a problem hiding this comment.
Overall looks good. I think we need to bring back our CSP and maybe reintroduce an option to Puma config.
Once we update those and land this, let's check GeoData in staging closely and then tag #proj_use to do some testing in unified search staging before we promote.
| # Rails.application.configure do | ||
| # config.content_security_policy do |policy| | ||
| # policy.default_src :self, :https | ||
| # policy.font_src :self, :https, :data | ||
| # policy.img_src :self, :https, :data | ||
| # policy.object_src :none | ||
| # policy.script_src :self, :https | ||
| # policy.style_src :self, :https | ||
| # # Specify URI for violation reports | ||
| # # policy.report_uri "/csp-violation-report-endpoint" | ||
| # end |
There was a problem hiding this comment.
Please review this more closely. We had explicit settings in the old config we want to carry forward while updating the boilerplate. CSP is confusing (to me) and I don't remember why we had some of the settings, but they were required for...something?
| # Processes count, allows better CPU utilization when executing Ruby code. | ||
| # Recommended to always run in at least one process so `rack-timeout` RACK_TERM_ON_TIMEOUT=1 can be used | ||
| # https://devcenter.heroku.com/articles/h12-request-timeout-in-ruby-mri | ||
| workers(ENV.fetch('WEB_CONCURRENCY') { 2 }) |
There was a problem hiding this comment.
This one is confusing and I think comes from Heroku config. We set WEB_CONCURRENCY=1 in Heroku config and use rack-timeout (but don't seem to set RACK_TERM_ON_TIMEOUT=1 so 🤷🏻 ).
tldr; we may want to keep this around?
There was a problem hiding this comment.
I'm not sure I agree. I think Heroku config should come from Heroku, not hardcoded in Puma config. Furthermore, a fallback of 2 feels oddly expensive to me. I think that if we want a setting of 2 in staging and prod, we should set that explicitly in our staging/prod apps.
To be fair, this is another instance of "I'm not sure why we did this," so the safest option is to keep it as-is. But, imo, the correct option is likely to modify our staging/prod apps to use the config we want.
There was a problem hiding this comment.
Setting this in heroku config cannot affect anything unless we tell puma to read the value though. Heroku is telling us how to best run Puma in Heroku.
These tickets clarify somewhat why that setting is in place:
- https://mitlibraries.atlassian.net/browse/USE-396
- https://mitlibraries.atlassian.net/browse/TIMX-298 (yes, this is a ticket that no work was logged under but I'm pretty sure I just forgot there was a ticket when I did the work and noticed that recently so I closed it)
There was a problem hiding this comment.
Also, the 2 value isn't how many dynos are running it's how many instances of the app run in each dyno. This allows us to most effectively use the RAM allocated in each dyno. Our dynos are so small we don't get many instances.
There was a problem hiding this comment.
Ahh, gotcha. Thanks for clarifying.
| # Skip http-to-https redirect for the default health check endpoint. | ||
| # config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } } | ||
|
|
||
| # Prepend all log lines with the following tags. |
There was a problem hiding this comment.
Hmmm. I thought we'd need to keep this to get the request id but it seems maybe it is now default or semantic logger adds it. Nothing to do here, just talking out loud :)
There was a problem hiding this comment.
Yup, semantic logger does this now.
|
@JPrevost Let me know what you think about the Puma config. If we're aligned, I'll update staging/prod apps to confirm If you disagree, I don't mind leaving the config in the codebase. I'm not particularly firm in my opinion on this. I mostly don't understand why we're falling back to |
JPrevost
left a comment
There was a problem hiding this comment.
Approving and also totally open to change the fall back for WEB_CONCURRENCY to 1 based on what you said about it along the way.
| # Processes count, allows better CPU utilization when executing Ruby code. | ||
| # Recommended to always run in at least one process so `rack-timeout` RACK_TERM_ON_TIMEOUT=1 can be used | ||
| # https://devcenter.heroku.com/articles/h12-request-timeout-in-ruby-mri | ||
| workers(ENV.fetch('WEB_CONCURRENCY') { 2 }) |
There was a problem hiding this comment.
Based on our comments about this, I'd be pretty good with defaulting to 1 and then instances that want more can intentionally bump it up. What do you think about that?
There was a problem hiding this comment.
If 2 is what is broadly needed, I trust that it's a reasonable fallback. It doesn't seem like it's causing issues thus far.
Developer
Accessibility
New ENV
Approval beyond code review
Additional context needed to review
E.g., if the PR includes updated dependencies and/or data
migration, or how to confirm the feature is working.
Code Reviewer
Code
added technical debt.
Documentation
(not just this pull request message).
Testing