Skip to content

Comments

Update Framework to Rails 7.2#28

Open
awilfox wants to merge 1 commit intomainfrom
awilfox/AP-270-rails-7-2
Open

Update Framework to Rails 7.2#28
awilfox wants to merge 1 commit intomainfrom
awilfox/AP-270-rails-7-2

Conversation

@awilfox
Copy link
Member

@awilfox awilfox commented Feb 21, 2026

  • Rails.application.secrets is removed; the secret_key_base accessor in Rails.application has been present since 6.x, so just use that.

  • Minor configuration updates for 7.2 defaults.

  • Add mutex_m to avoid deprecation warnings for Ruby 3.4.

Ref: AP-270


This includes the SECRET_KEY_BASE setting in build.yml that @danschmidt5189 suggested in Slack, so cc'ing him.

Only other thing of note is that Rails 7.2 enforces HTTPS (HSTS / redirects) in prod, but this shouldn't be an issue since AFAIK all Library endpoints are HTTPS anyway.

Copy link
Member

@danschmidt5189 danschmidt5189 left a comment

Choose a reason for hiding this comment

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

A few minor questions but definitely not blockers.


# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
# config.force_ssl = true
config.force_ssl = true
Copy link
Member

Choose a reason for hiding this comment

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

Do you know how this behaves behind a proxy that terminates SSL? X-Forwarded-Proto would be https, but the actual connection to the proxy is http.

Copy link
Member Author

Choose a reason for hiding this comment

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

AVPlayer and Lost-and-Found both have config.force_ssl enabled, so it should be fine here AFAIK.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the application to Rails 7.2, aligning configuration defaults and dependency versions while addressing deprecations (notably Rails.application.secrets removal and Ruby 3.4 warnings).

Changes:

  • Upgrade Rails from 7.1 to 7.2 (and update Gemfile/Gemfile.lock accordingly, including adding mutex_m).
  • Update environment and framework configuration defaults (e.g., load_defaults 7.2, SSL enforcement in production, test/development config tweaks).
  • Adjust CI and tooling scripts (GitHub Actions build workflow, docker-compose CI overrides, simplified binstubs).

Reviewed changes

Copilot reviewed 11 out of 15 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
public/robots.txt Updates documentation URL to HTTPS.
docker-compose.ci.yml Adds a CI mount intended to provide SECRET_KEY_BASE.
config/puma.rb Replaces Puma config comments and adds pidfile support.
config/environments/test.rb Enables deprecation logging to stderr; comment updates.
config/environments/production.rb Enables force_ssl and adds Rails 7.2 production defaults.
config/environments/development.rb Comment/style tweaks; adds Action Mailer template caching setting.
config/boot.rb Removes explicit require 'logger'.
config/application.rb Switches load_defaults to 7.2 and adds autoload_lib ignore list.
bin/rubocop Replaces Bundler-generated binstub with a simplified wrapper and forces explicit config path.
bin/brakeman Replaces Bundler-generated binstub with a simplified wrapper and adds --ensure-latest.
app/models/efees_invoice.rb Migrates from Rails.application.secrets to Rails.application.secret_key_base.
Gemfile.lock Locks Rails 7.2.3 and related dependency updates (including mutex_m).
Gemfile Bumps Rails requirement to 7.2.3 and adds mutex_m.
.idea/altmedia.iml Updates IDE module metadata for new gem versions.
.github/workflows/build.yml Generates a secret key base file during CI stack setup.
Files not reviewed (1)
  • .idea/altmedia.iml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 12 to 14
volumes: !override
- artifacts:/opt/app/artifacts
- /tmp/secret_key_base:/run/secrets/SECRET_KEY_BASE
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

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

Mounting /tmp/secret_key_base at /run/secrets/SECRET_KEY_BASE won’t affect Rails unless something reads that file and sets ENV["SECRET_KEY_BASE"] (no such logic exists in this repo). If the intent is to satisfy Rails 7.2’s secret_key_base requirement in CI, pass SECRET_KEY_BASE as an environment variable to the container (and/or add boot-time code to read /run/secrets/SECRET_KEY_BASE).

Copilot uses AI. Check for mistakes.
Copy link
Member

Choose a reason for hiding this comment

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

Wrong -- the berkeley_library-docker gem automatically loads secrets from /run/secrets into ENV when the application boots.

* `Rails.application.secrets` is removed; the `secret_key_base` accessor
  in `Rails.application` has been present since 6.x, so just use that.

* Minor configuration updates for 7.2 defaults.

* Add `mutex_m` to avoid deprecation warnings for Ruby 3.4.

Ref: AP-270
@awilfox awilfox force-pushed the awilfox/AP-270-rails-7-2 branch from e66223e to 0decf6b Compare February 21, 2026 02:29
@awilfox
Copy link
Member Author

awilfox commented Feb 21, 2026

v2: Addressed feedback.

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