Skip to content

Conversation

@depfu
Copy link
Contributor

@depfu depfu bot commented Aug 14, 2025

Jira issue: https://issues.redhat.com/browse/THREESCALE-12186


🚨 Your current dependencies have known security vulnerabilities 🚨

This dependency update fixes known security vulnerabilities. Please see the details below and assess their impact carefully. We recommend to merge and deploy this as soon as possible!


Here is everything you need to know about this upgrade. Please take a good look at what changed and the test results before merging this pull request.

What changed?

✳️ rails (7.1.6 β†’ 8.0.2.1) Β· Repo

Release Notes

Too many releases to show here. View the full release notes.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

✳️ webrick (1.8.2 β†’ 1.9.2) Β· Repo

Sorry, we couldn't find anything useful about this release.

↗️ actioncable (indirect, 7.1.6 β†’ 8.0.2.1) Β· Repo Β· Changelog

Release Notes

8.0.1 (from changelog)

More info than we can show here.

8.0.0.1 (from changelog)

More info than we can show here.

8.0.0 (from changelog)

More info than we can show here.

7.2.2.1 (from changelog)

More info than we can show here.

7.2.2 (from changelog)

More info than we can show here.

7.2.1.2 (from changelog)

More info than we can show here.

7.2.1.1 (from changelog)

More info than we can show here.

7.2.1 (from changelog)

More info than we can show here.

7.2.0 (from changelog)

More info than we can show here.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ actionmailbox (indirect, 7.1.6 β†’ 8.0.2.1) Β· Repo Β· Changelog

↗️ actionmailer (indirect, 7.1.6 β†’ 8.0.2.1) Β· Repo Β· Changelog

Security Advisories 🚨

🚨 Possible ReDoS vulnerability in block_format in Action Mailer

There is a possible ReDoS vulnerability in the block_format helper in Action Mailer. This vulnerability has been assigned the CVE identifier CVE-2024-47889.

Impact

Carefully crafted text can cause the block_format helper to take an unexpected amount of time, possibly resulting in a DoS vulnerability. All users running an affected release should either upgrade or apply the relevant patch immediately.

Ruby 3.2 has mitigations for this problem, so Rails applications using Ruby 3.2 or newer are unaffected. Rails 8.0.0.beta1 requires Ruby 3.2 or greater so is unaffected.

Releases

The fixed releases are available at the normal locations.

Workarounds

Users can avoid calling the block_format helper or upgrade to Ruby 3.2

Credits

Thanks to yuki_osaki for the report!

Release Notes

8.0.1 (from changelog)

More info than we can show here.

8.0.0.1 (from changelog)

More info than we can show here.

8.0.0 (from changelog)

More info than we can show here.

7.2.2.1 (from changelog)

More info than we can show here.

7.2.2 (from changelog)

More info than we can show here.

7.2.1.2 (from changelog)

More info than we can show here.

7.2.1.1 (from changelog)

More info than we can show here.

7.2.1 (from changelog)

More info than we can show here.

7.2.0 (from changelog)

More info than we can show here.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ actionpack (indirect, 7.1.6 β†’ 8.0.2.1) Β· Repo Β· Changelog

Security Advisories 🚨

🚨 Possible Content Security Policy bypass in Action Dispatch

There is a possible Cross Site Scripting (XSS) vulnerability in the content_security_policy helper in Action Pack.

Impact

Applications which set Content-Security-Policy (CSP) headers dynamically from untrusted user input may be vulnerable to carefully crafted inputs being able to inject new directives into the CSP. This could lead to a bypass of the CSP and its protection against XSS and other attacks.

Releases

The fixed releases are available at the normal locations.

Workarounds

Applications can avoid setting CSP headers dynamically from untrusted input, or can validate/sanitize that input.

Credits

Thanks to ryotak for the report!

🚨 Possible Content Security Policy bypass in Action Dispatch

There is a possible Cross Site Scripting (XSS) vulnerability in the content_security_policy helper in Action Pack.

Impact

Applications which set Content-Security-Policy (CSP) headers dynamically from untrusted user input may be vulnerable to carefully crafted inputs being able to inject new directives into the CSP. This could lead to a bypass of the CSP and its protection against XSS and other attacks.

Releases

The fixed releases are available at the normal locations.

Workarounds

Applications can avoid setting CSP headers dynamically from untrusted input, or can validate/sanitize that input.

Credits

Thanks to ryotak for the report!

🚨 Possible ReDoS vulnerability in HTTP Token authentication in Action Controller

There is a possible ReDoS vulnerability in Action Controller's HTTP Token authentication. This vulnerability has been assigned the CVE identifier CVE-2024-47887.

Impact

For applications using HTTP Token authentication via authenticate_or_request_with_http_token or similar, a carefully crafted header may cause header parsing to take an unexpected amount of time, possibly resulting in a DoS vulnerability. All users running an affected release should either upgrade or apply the relevant patch immediately.

Ruby 3.2 has mitigations for this problem, so Rails applications using Ruby 3.2 or newer are unaffected. Rails 8.0.0.beta1 depends on Ruby 3.2 or greater so is unaffected.

Releases

The fixed releases are available at the normal locations.

Workarounds

Users on Ruby 3.2 are unaffected by this issue.

Credits

Thanks to scyoon for reporting

🚨 Possible ReDoS vulnerability in query parameter filtering in Action Dispatch

There is a possible ReDoS vulnerability in the query parameter filtering routines of Action Dispatch. This vulnerability has been assigned the CVE identifier CVE-2024-41128.

Impact

Carefully crafted query parameters can cause query parameter filtering to take an unexpected amount of time, possibly resulting in a DoS vulnerability. All users running an affected release should either upgrade or apply the relevant patch immediately.

Ruby 3.2 has mitigations for this problem, so Rails applications using Ruby 3.2 or newer are unaffected. Rails 8.0.0.beta1 depends on Ruby 3.2 or greater so is unaffected.

Releases

The fixed releases are available at the normal locations.

Workarounds

Users on Ruby 3.2 are unaffected by this issue.

Credits

Thanks to scyoon for the report and patches!

Release Notes

8.0.1 (from changelog)

More info than we can show here.

8.0.0.1 (from changelog)

More info than we can show here.

8.0.0 (from changelog)

More info than we can show here.

7.2.2.1 (from changelog)

More info than we can show here.

7.2.2 (from changelog)

More info than we can show here.

7.2.1.2 (from changelog)

More info than we can show here.

7.2.1.1 (from changelog)

More info than we can show here.

7.2.1 (from changelog)

More info than we can show here.

7.2.0 (from changelog)

More info than we can show here.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ actiontext (indirect, 7.1.6 β†’ 8.0.2.1) Β· Repo Β· Changelog

Security Advisories 🚨

🚨 Possible ReDoS vulnerability in plain_text_for_blockquote_node in Action Text

There is a possible ReDoS vulnerability in the plain_text_for_blockquote_node helper in Action Text. This vulnerability has been assigned the CVE identifier CVE-2024-47888.

Impact

Carefully crafted text can cause the plain_text_for_blockquote_node helper to take an unexpected amount of time, possibly resulting in a DoS vulnerability. All users running an affected release should either upgrade or apply the relevant patch immediately.

Ruby 3.2 has mitigations for this problem, so Rails applications using Ruby 3.2 or newer are unaffected. Rails 8.0.0.beta1 depends on Ruby 3.2 or greater so is unaffected.

Releases

The fixed releases are available at the normal locations.

Workarounds

Users can avoid calling plain_text_for_blockquote_node or upgrade to Ruby 3.2

Credits

Thanks to ooooooo_q for the report!

Release Notes

8.0.1 (from changelog)

More info than we can show here.

8.0.0.1 (from changelog)

More info than we can show here.

8.0.0 (from changelog)

More info than we can show here.

7.2.2.1 (from changelog)

More info than we can show here.

7.2.2 (from changelog)

More info than we can show here.

7.2.1.2 (from changelog)

More info than we can show here.

7.2.1.1 (from changelog)

More info than we can show here.

7.2.1 (from changelog)

More info than we can show here.

7.2.0 (from changelog)

More info than we can show here.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ actionview (indirect, 7.1.6 β†’ 8.0.2.1) Β· Repo Β· Changelog

Release Notes

8.0.1 (from changelog)

More info than we can show here.

8.0.0.1 (from changelog)

More info than we can show here.

8.0.0 (from changelog)

More info than we can show here.

7.2.2.1 (from changelog)

More info than we can show here.

7.2.2 (from changelog)

More info than we can show here.

7.2.1.2 (from changelog)

More info than we can show here.

7.2.1.1 (from changelog)

More info than we can show here.

7.2.1 (from changelog)

More info than we can show here.

7.2.0 (from changelog)

More info than we can show here.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ activejob (indirect, 7.1.6 β†’ 8.0.2.1) Β· Repo Β· Changelog

Release Notes

8.0.1 (from changelog)

More info than we can show here.

8.0.0.1 (from changelog)

More info than we can show here.

8.0.0 (from changelog)

More info than we can show here.

7.2.2.1 (from changelog)

More info than we can show here.

7.2.2 (from changelog)

More info than we can show here.

7.2.1.2 (from changelog)

More info than we can show here.

7.2.1.1 (from changelog)

More info than we can show here.

7.2.1 (from changelog)

More info than we can show here.

7.2.0 (from changelog)

More info than we can show here.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ activemodel (indirect, 7.1.6 β†’ 8.0.2.1) Β· Repo Β· Changelog

Release Notes

8.0.1 (from changelog)

More info than we can show here.

8.0.0.1 (from changelog)

More info than we can show here.

8.0.0 (from changelog)

More info than we can show here.

7.2.2.1 (from changelog)

More info than we can show here.

7.2.2 (from changelog)

More info than we can show here.

7.2.1.2 (from changelog)

More info than we can show here.

7.2.1.1 (from changelog)

More info than we can show here.

7.2.1 (from changelog)

More info than we can show here.

7.2.0 (from changelog)

More info than we can show here.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ activerecord (indirect, 7.1.6 β†’ 8.0.2.1) Β· Repo Β· Changelog

Security Advisories 🚨

🚨 Active Record logging vulnerable to ANSI escape injection

This vulnerability has been assigned the CVE identifier CVE-2025-55193

Impact

The ID passed to find or similar methods may be logged without escaping. If this is directly to the terminal it may include unescaped ANSI sequences.

Releases

The fixed releases are available at the normal locations.

Credits

Thanks to lio346 from Unit 515 of OPSWAT for reporting this vulnerability

🚨 Active Record logging vulnerable to ANSI escape injection

This vulnerability has been assigned the CVE identifier CVE-2025-55193

Impact

The ID passed to find or similar methods may be logged without escaping. If this is directly to the terminal it may include unescaped ANSI sequences.

Releases

The fixed releases are available at the normal locations.

Credits

Thanks to lio346 from Unit 515 of OPSWAT for reporting this vulnerability

Release Notes

8.0.1 (from changelog)

More info than we can show here.

8.0.0.1 (from changelog)

More info than we can show here.

8.0.0 (from changelog)

More info than we can show here.

7.2.2.1 (from changelog)

More info than we can show here.

7.2.2 (from changelog)

More info than we can show here.

7.2.1.2 (from changelog)

More info than we can show here.

7.2.1.1 (from changelog)

More info than we can show here.

7.2.1 (from changelog)

More info than we can show here.

7.2.0 (from changelog)

More info than we can show here.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ activestorage (indirect, 7.1.6 β†’ 8.0.2.1) Β· Repo Β· Changelog

Security Advisories 🚨

🚨 Active Storage allowed transformation methods that were potentially unsafe

Active Storage attempts to prevent the use of potentially unsafe image transformation methods and parameters by default.

The default allowed list contains three methods allowing for the circumvention of the safe defaults which enables potential command injection vulnerabilities in cases where arbitrary user supplied input is accepted as valid transformation methods or parameters.

This has been assigned the CVE identifier CVE-2025-24293.

Versions Affected: >= 5.2.0
Not affected: < 5.2.0
Fixed Versions: 7.1.5.2, 7.2.2.2, 8.0.2.1

Impact

This vulnerability impacts applications that use Active Storage with the image_processing processing gem in addition to mini_magick as the image processor.

Vulnerable code will look something similar to this:

<%= image_tag blob.variant(params[:t] => params[:v]) %>

Where the transformation method or its arguments are untrusted arbitrary input.

All users running an affected release should either upgrade or use one of the workarounds immediately.

Releases

The fixed releases are available at the normal locations.

Workarounds

Consuming user supplied input for image transformation methods or their parameters is unsupported behavior and should be considered dangerous.

Strict validation of user supplied methods and parameters should be performed as well as having a strong ImageMagick security policy deployed.

Credits

Thank you lio346 from Unit 515 of OPSWAT for reporting this!

🚨 Active Storage allowed transformation methods that were potentially unsafe

Active Storage attempts to prevent the use of potentially unsafe image transformation methods and parameters by default.

The default allowed list contains three methods allowing for the circumvention of the safe defaults which enables potential command injection vulnerabilities in cases where arbitrary user supplied input is accepted as valid transformation methods or parameters.

This has been assigned the CVE identifier CVE-2025-24293.

Versions Affected: >= 5.2.0
Not affected: < 5.2.0
Fixed Versions: 7.1.5.2, 7.2.2.2, 8.0.2.1

Impact

This vulnerability impacts applications that use Active Storage with the image_processing processing gem in addition to mini_magick as the image processor.

Vulnerable code will look something similar to this:

<%= image_tag blob.variant(params[:t] => params[:v]) %>

Where the transformation method or its arguments are untrusted arbitrary input.

All users running an affected release should either upgrade or use one of the workarounds immediately.

Releases

The fixed releases are available at the normal locations.

Workarounds

Consuming user supplied input for image transformation methods or their parameters is unsupported behavior and should be considered dangerous.

Strict validation of user supplied methods and parameters should be performed as well as having a strong ImageMagick security policy deployed.

Credits

Thank you lio346 from Unit 515 of OPSWAT for reporting this!

Release Notes

8.0.1 (from changelog)

More info than we can show here.

8.0.0.1 (from changelog)

More info than we can show here.

8.0.0 (from changelog)

More info than we can show here.

7.2.2.1 (from changelog)

More info than we can show here.

7.2.2 (from changelog)

More info than we can show here.

7.2.1.2 (from changelog)

More info than we can show here.

7.2.1.1 (from changelog)

More info than we can show here.

7.2.1 (from changelog)

More info than we can show here.

7.2.0 (from changelog)

More info than we can show here.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ activesupport (indirect, 7.1.6 β†’ 8.0.2.1) Β· Repo Β· Changelog

Release Notes

8.0.1 (from changelog)

More info than we can show here.

8.0.0.1 (from changelog)

More info than we can show here.

8.0.0 (from changelog)

More info than we can show here.

7.2.2.1 (from changelog)

More info than we can show here.

7.2.2 (from changelog)

More info than we can show here.

7.2.1.2 (from changelog)

More info than we can show here.

7.2.1.1 (from changelog)

More info than we can show here.

7.2.1 (from changelog)

More info than we can show here.

7.2.0 (from changelog)

More info than we can show here.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ connection_pool (indirect, 2.5.4 β†’ 3.0.2) Β· Repo Β· Changelog

Release Notes

3.0.2 (from changelog)

More info than we can show here.

3.0.1 (from changelog)

More info than we can show here.

3.0.0 (from changelog)

More info than we can show here.

2.5.5 (from changelog)

More info than we can show here.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ date (indirect, 3.5.0 β†’ 3.5.1) Β· Repo

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ erb (indirect, 4.0.4 β†’ 6.0.0) Β· Repo Β· Changelog

Release Notes

6.0.0

More info than we can show here.

5.1.3

More info than we can show here.

5.1.2

More info than we can show here.

5.1.1 (from changelog)

More info than we can show here.

5.1.0 (from changelog)

More info than we can show here.

5.0.3 (from changelog)

More info than we can show here.

5.0.2 (from changelog)

More info than we can show here.

5.0.1 (from changelog)

More info than we can show here.

5.0.0 (from changelog)

More info than we can show here.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ psych (indirect, 5.2.6 β†’ 5.3.0) Β· Repo Β· Changelog

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ railties (indirect, 7.1.6 β†’ 8.0.2.1) Β· Repo Β· Changelog

Release Notes

8.0.1 (from changelog)

More info than we can show here.

8.0.0.1 (from changelog)

More info than we can show here.

8.0.0 (from changelog)

More info than we can show here.

7.2.2.1 (from changelog)

More info than we can show here.

7.2.2 (from changelog)

More info than we can show here.

7.2.1.2 (from changelog)

More info than we can show here.

7.2.1.1 (from changelog)

More info than we can show here.

7.2.1 (from changelog)

More info than we can show here.

7.2.0 (from changelog)

More info than we can show here.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ rdoc (indirect, 6.15.1 β†’ 6.17.0) Β· Repo Β· Changelog

Release Notes

6.17.0

More info than we can show here.

6.16.1

More info than we can show here.

6.16.0

More info than we can show here.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ stringio (indirect, 3.1.8 β†’ 3.1.9) Β· Repo Β· Changelog

Release Notes

3.1.9

More info than we can show here.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ timeout (indirect, 0.4.4 β†’ 0.5.0) Β· Repo

Release Notes

0.5.0

More info than we can show here.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

πŸ†• uri (added, 1.1.1)

πŸ†• useragent (added, 0.16.11)

πŸ—‘οΈ cgi (removed)

πŸ—‘οΈ mutex_m (removed)


Depfu Status

Depfu will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with @depfu rebase.

All Depfu comment commands
@​depfu rebase
Rebases against your default branch and redoes this update
@​depfu recreate
Recreates this PR, overwriting any edits that you've made to it
@​depfu merge
Merges this PR once your tests are passing and conflicts are resolved
@​depfu cancel merge
Cancels automatic merging of this PR
@​depfu close
Closes this PR and deletes the branch
@​depfu reopen
Restores the branch and reopens this PR (if it's closed)
@​depfu pause
Ignores all future updates for this dependency and closes this PR
@​depfu pause [minor|major]
Ignores all future minor/major updates for this dependency and closes this PR
@​depfu resume
Future versions of this dependency will create PRs again (leaves this PR as is)

@depfu depfu bot added the depfu label Aug 14, 2025
@depfu depfu bot force-pushed the depfu/update/group/rails-8.0.2.1 branch from 615e103 to 9cbb15f Compare October 7, 2025 18:43
@mayorova mayorova force-pushed the depfu/update/group/rails-8.0.2.1 branch from b3589df to 53c5665 Compare November 5, 2025 15:19
@mayorova mayorova marked this pull request as draft November 5, 2025 15:23
@depfu depfu bot force-pushed the depfu/update/group/rails-8.0.2.1 branch from 53c5665 to 1f70b27 Compare November 12, 2025 18:30
@depfu depfu bot force-pushed the depfu/update/group/rails-8.0.2.1 branch from 1f70b27 to b58c09a Compare December 10, 2025 10:10
@depfu depfu bot changed the title 🚨 [security] Update rails 7.0.8.7 β†’ 8.0.2.1 (major) 🚨 [security] Update rails 7.1.6 β†’ 8.0.2.1 (major) Dec 10, 2025
@depfu depfu bot force-pushed the depfu/update/group/rails-8.0.2.1 branch from b58c09a to 511ad57 Compare December 11, 2025 17:15
@jlledom jlledom self-assigned this Jan 16, 2026
bin/dev Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need this file?

Copy link
Contributor

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 need it. It was created automatically by rails app:update

@jlledom jlledom force-pushed the depfu/update/group/rails-8.0.2.1 branch 2 times, most recently from ef7f8d7 to e89c22d Compare January 21, 2026 08:41
@jlledom
Copy link
Contributor

jlledom commented Jan 21, 2026

Jira issue for this upgrade: https://issues.redhat.com/browse/THREESCALE-12186

I followed the migration guides for 7.2 and 8.0 and went through the whole list of deprecations for both updates. This is what I did:

I also tested locally, Both normal and TLS DB:

  • Add app
  • Edit app secret
  • Remove app
  • Add domain
    • Couldn't test it because I dont know how to test it

I comment further details in each file. About the rails defaults, I think we should set config.load_defaults to 8.0. But I'm leaving the defaults initializers for now so we can discuss the values. My intention is to remove them before merging.

end

gem 'rails', '~> 7.1.6'
gem "mutex_m", "~> 0.3.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

Fix a deprecation warning:

/home/jlledom/.asdf/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32: warning: /home/jlledom/.asdf/installs/ruby/3.3.1/lib/ruby/3.3.0/mutex_m.rb was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.4.0. Add mutex_m to your Gemfile or gemspec.


gem 'rails', '~> 7.1.6'
gem "mutex_m", "~> 0.3.0"
gem "csv", "~> 3.3"
Copy link
Contributor

Choose a reason for hiding this comment

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

Deprecation warning:

/home/jlledom/.asdf/installs/ruby/3.3.1/lib/ruby/gems/3.3.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32: warning: /home/jlledom/.asdf/installs/ruby/3.3.1/lib/ruby/3.3.0/csv.rb was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.4.0. Add csv to your Gemfile or gemspec. Also contact author of license_finder-7.0.1 to add csv into its gemspec.

has_many :integration_states, dependent: :destroy

enum state: %i[active disabled].index_with{ |status| status.to_s }
enum :state, %i[active disabled].index_with{ |status| status.to_s }
Copy link
Contributor

Choose a reason for hiding this comment

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

Changed in rails: rails/rails@439298e

Comment on lines +50 to +51
# Append comments with runtime information tags to SQL queries in logs.
config.active_record.query_log_tags_enabled = true
Copy link
Contributor

Choose a reason for hiding this comment

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

This was added by app:update

Comment on lines 49 to 50
# Prevent health checks from clogging up the logs.
config.silence_healthcheck_path = "/up"
Copy link
Contributor

Choose a reason for hiding this comment

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

Added by the update task. Any idea which is our health check path?

Comment on lines 68 to 69
# Only use :id for inspections in production.
config.active_record.attributes_for_inspect = [ :id ]
Copy link
Contributor

Choose a reason for hiding this comment

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

Added by app:update. It doesn't harm I guess.

# Raise error when a before_action's only/except options reference missing actions.
config.action_controller.raise_on_missing_callback_actions = true

config.active_job.queue_adapter = :test
Copy link
Contributor

Choose a reason for hiding this comment

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

# See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors.
Rails.application.config.filter_parameters += [
:password, :access_token
:password, :access_token, :passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn, :cvv, :cvc
Copy link
Contributor

Choose a reason for hiding this comment

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

Added by the update task, I think it's fine.

# backends that use the same database as Active Record as a queue, hence they
# don't need this feature.
#++
# Rails.application.config.active_job.enqueue_after_transaction_commit = :default
Copy link
Contributor

Choose a reason for hiding this comment

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

This one is pretty confusing: enqueue_after_transaction_commit. It tries to fix the scenario when job is enqueued inside a transaction but the transaction was rollbacked. In that scenario the job would actually run and lead to undefined behavior. It's confusing because Rails maintainers changed opinion about this several times:

  1. 7.2: Added, and took 3 values: :always. :never and :default.
  2. 8.0: Deprecated, and took 2 values: true and false
  3. 8.1: Removed
  4. 8.2: Added again, taking boolean values, and true by default.

8.2 Changelog: https://github.com/rails/rails/blob/6f39910d26eb590cb214a0fce5858fe0d7ddfff8/activejob/CHANGELOG.md?plain=1#L48-L58

The setting only makes sense when the queue is not stored in the same DB ActiveRecord uses. For instance the Sidekiq scenario using Redis. But Que stores the queue in the same DB as ActiveRecord so the changes in the queue are committed or rollbacked along with other changes in the transaction.

I think this doesn't affect us, so leaving it unset.

# This is possible due to broad browser support for WebP, but older browsers and email clients may still not support
# WebP. Requires imagemagick/libvips built with WebP support.
#++
# Rails.application.config.active_storage.web_image_content_types = %w[image/png image/jpeg image/gif image/webp]
Copy link
Contributor

Choose a reason for hiding this comment

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

Not relevant, we don't have assets in Zync, right?

# Applications with existing timestamped migrations that do not adhere to the
# expected format can disable validation by setting this config to `false`.
#++
Rails.application.config.active_record.validate_migration_timestamps = true
Copy link
Contributor

Choose a reason for hiding this comment

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

It doesn't seem we'll face the scenario this tries to protect from, right?

#
# This query used to return a `String`.
#++
Rails.application.config.active_record.postgresql_adapter_decode_dates = true
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't use the affected syntax in our codebase AFAIK

# Enables YJIT as of Ruby 3.3, to bring sizeable performance improvements. If you are
# deploying to a memory constrained environment you may want to set this to `false`.
#++
Rails.application.config.yjit = true
Copy link
Contributor

Choose a reason for hiding this comment

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

Apparently this will get us 15-20% performance boost if enabled, it requires Ruby 3.3 which we use.

# If set to `:offset`, `to_time` methods will use the UTC offset.
# If `false`, `to_time` methods will convert to the local system UTC offset instead.
#++
Rails.application.config.active_support.to_time_preserves_timezone = :zone
Copy link
Contributor

Choose a reason for hiding this comment

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

This won't affect us I think. Anyway, we still see the deprecation warning about this because the warning is shown before this initializer runs. So the proper way to set this value would be setting load_defaults to 8.0.

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, better set that

# only consider `If-None-Match` as specified by RFC 7232 Section 6.
# If set to `false` both conditions need to be satisfied.
#++
Rails.application.config.action_dispatch.strict_freshness = true
Copy link
Contributor

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 return 304 from zync, right? This should have any effect. Anyway, if the setting forces following an RFC, then it's good I think.

###
# Set `Regexp.timeout` to `1`s by default to improve security over Regexp Denial-of-Service attacks.
#++
Regexp.timeout = 1
Copy link
Contributor

Choose a reason for hiding this comment

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

Not Rails class, but I agree on setting this.


execute do |connection|
connection.select_all(relation.to_sql)
connection.select_all(relation)
Copy link
Contributor

Choose a reason for hiding this comment

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

For some reason, to_sql doesn't bind values in Rails 8, which generates SQL conditions like error_count = $1. This fixes it.

Comment on lines 15 to 18
def with_que_adapter(&block)
ApplicationJob.stub(:queue_adapter, ActiveJob::QueueAdapters::QueAdapter.new, &block)
end

Copy link
Contributor

Choose a reason for hiding this comment

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

All tests run now using the default :test queue adapter I set in the environments/test.rb file. However, this particular test suite actually requires using the Que adapter, Claude suggested this.

class ModelTest < ActiveSupport::TestCase
self.use_transactional_tests = false

def test_weak_lock
Copy link
Contributor

Choose a reason for hiding this comment

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

The original idea for this test was simulating a race condition and ensure the corresponding exception is raised. But this test had a few problems:

  1. Instead of simulating different threads belonging to different requests, it used Fibers within a single thread.
  2. It was using a stub that didn't work because the stub was set only when the fiber was created, but remove just before the fiber starts to run.
  3. The test tries to simulate an unfinished transaction, but the whole test itself ran inside a parent transaction.
  4. It relied on stubbing some rails internals, but those internals changed in Deprecate ConnectionPool#connectionΒ rails/rails#51230

I rewrote it in a way it more closely reproduces reality.

@jlledom jlledom marked this pull request as ready for review January 21, 2026 09:42
@mayorova
Copy link
Contributor

Before even reviewing the PR, @jlledom, a question - is it actually safe to jump straight from 7.1 to 8.0 ?
Shouldn't we pass through 7.2 first? πŸ€”

@jlledom
Copy link
Contributor

jlledom commented Jan 21, 2026

Before even reviewing the PR, @jlledom, a question - is it actually safe to jump straight from 7.1 to 8.0 ? Shouldn't we pass through 7.2 first? πŸ€”

Maybe I should have questioned that also before starting to work on it. But Depfu did the skip and I took it without question. I don't know, everything seems to work for me, zync is a small project and we have QE. WDYT?

@mayorova
Copy link
Contributor

Maybe I should have questioned that also before starting to work on it. But Depfu did the skip and I took it without question. I don't know, everything seems to work for me, zync is a small project and we have QE. WDYT?

I also kind of forgot that there was a 7.2 in-between πŸ™ƒ

But I think it would make sense to first upgrade to 7.2, and then to 8.0. It's probably OK to do it within the same product release. But for the sake of sanity, we probably should split them in 2 PRs? πŸ€”

Unless @akostadinov has a different opinion.

@jlledom jlledom force-pushed the depfu/update/group/rails-8.0.2.1 branch from e89c22d to 5857eab Compare January 27, 2026 12:59
Comment on lines +22 to +28

# Build connection URL with SSL parameters from database config
# Workaround for https://github.com/que-rb/que/issues/442
db_config = ActiveRecord::Base.connection_db_config.configuration_hash
connection_url = Que::DBConnectionURL.build_connection_url(db_config)

Que.locker = Que::Locker.new(connection_url: connection_url, **Rails.application.config.x.que)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not directly related to Rails 8, but rather #573.

It's just I tried to run the tests against an SSL protected DB and found them failing because of this.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hm, not sure I understand. Does it mean that #573 didn't fix the issue completely?

Or it did work with the old Rails, but after upgrade some extra code is now needed?

Copy link
Contributor

Choose a reason for hiding this comment

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

The issue was solved in #573. This change is only to run the test suite against an SSL database. It only affects tests.

Not related to Rails 8, the rails upgrade has no effect in SSL connections. It's just I was testing things locally and found the suite not working over SSL databases, and I thought: why not just push this to the current branch I'm working on, which happens to be Rails 8, rather than having to open a new PR? And I told myself it was a good idea.

Copy link
Contributor

Choose a reason for hiding this comment

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

Still not getting it πŸ™ƒ

How does it "only affects tests", if it's actually changing the initializer code? πŸ€”

Also, if you run this suite against master - do the tests also fail without the change? If they do - then I'd say #573 did not in fact fix the issue completely.

Or am I missing something?

Overall, if this would be also needed for master for whatever test to pass, I would split it into another PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

How does it "only affects tests", if it's actually changing the initializer code? πŸ€”

It's in an initializer, but it's a method defined by us, not part of Que gem. I don't know why it's defined in the initializer, but shrug. The thing is that method is currently only called for tests.

This is the sequence:

  • Que is installed: 2a5f898
    • The method is defined in the intializer
    • It's called from config.ru for production
    • And from test_helper.rb for tests
  • Que is updated: daae239
    • Stops being called from config.ru, instead, it's called from a callback defined in the initializer
  • Que moved to it's own rake task: https://github.com/3scale/zync/pull/181/changes
    • My guess is, at the beginning Que was started by rails but after this PR it started to be a separated rake task.
    • The PR stops calling the method from the rails callback, so the only remaining call is from test_helper.rb
    • 150faa7

So the only usage left for this method is from tests. In #573 I fixed SSL for actual que execution but not for tests. Now this change fixes it.

Also, if you run this suite against master - do the tests also fail without the change? If they do - then I'd say #573 did not in fact fix the issue completely.

The tests work in master... unless you run the tests against an SSL protected DB:

$ DATABASE_SSL_CA=/home/jlledom/3scale-services/redis-configs/certs/ca-root-cert.pem DATABASE_SSL_CERT=/home/jlledom/3scale-services/redis-configs/certs/redis-client.crt DATABASE_SSL_KEY=/home/jlledom/3scale-services/redis-configs/certs/redis-client.key DATABASE_SSL_MODE=verify-full DATABASE_URL=postgresql://porta:@localhost:25432 RAILS_ENV=test bundle exec rails test

connection to server at "::1", port 25432 failed: FATAL:  connection requires a valid client certificate (PG::ConnectionBad)

So basically, que is initialized differently for two scenarios:

  • Rake taks
  • Tests

In #573 I only fixed the rake task. Now the test scenario is also available to read ssl params.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you for the explanation! I understand now.

So, Que.start! and Que.stop! method is not the actual Que interface - maybe at some point (original versions) it was, but now it's only used for tests.

So, I see that previously que was actually being started as bundle exec que - which basically executes the gem's Que::CommandLineInterface directly.

Then it was changed to bundle exec rake que - which then calls the que executable anyway, so the rake task is just a wrapper that adds some extra parameters to the executable.

But bundle exec que is still a valid command that works. However, as que by default doesn't support TLS for DB, I guess adding the correct config to the rake task is correct and works for production (as our pods execute the rake task).

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe the question is can we call it in tests in the same way as tasks? Or define this custom thing in the test_helper or somewhere. If not too hard.

@jlledom
Copy link
Contributor

jlledom commented Jan 27, 2026

@mayorova @akostadinov I rebased this PR onto master after merging Rails 7.2

@@ -1,5 +1,3 @@
require "active_support/core_ext/integer/time"
Copy link
Contributor

Choose a reason for hiding this comment

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

what was this for?

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually a good question, I guess the rake app removed this and I didn't notice. Let me investigate, but we should probably revert this change.

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it, this was to make 1.hour.to_i work. But it works anyway after removing the require, so I guess it was not needed.

Comment on lines -43 to -56
# Specifies the number of `workers` to boot in clustered mode.
# Workers are forked web server processes. If using threads and workers together
# the concurrency of the application would be max `threads` * `workers`.
# Workers do not work on JRuby or Windows (both of which do not support
# processes).
#
# workers ENV.fetch("WEB_CONCURRENCY") { 2 }

# Use the `preload_app!` method when specifying a `workers` number.
# 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.
#
# preload_app!
Copy link
Contributor

Choose a reason for hiding this comment

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

any insight of why the above is not needed and how do we set workers ENV.fetch("WEB_CONCURRENCY") { 2 }, was this unsupported or something?

db_config = ActiveRecord::Base.connection_db_config.configuration_hash
connection_url = Que::DBConnectionURL.build_connection_url(db_config)

Que.locker = Que::Locker.new(connection_url: connection_url, **Rails.application.config.x.que)
Copy link
Contributor

Choose a reason for hiding this comment

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

I still think this deserves its own PR, as it doesn't have anything to do with this Rails upgrade πŸ™ƒ

Also, we might need to evaluate whether we actually need:

  • Que.start! and Que.stop! - maybe we can just add something like Que.locker = Que::Locker.new directly in the test helper, and call Que.locker.stop! where needed.
  • maybe we don't need that initializer at all
  • also, maybe we don't need the que.yml file and the corresponding code in the application.rb - I can't find where they are used (except for the tests)

But well, that's all optional, I just noticed it while investigating.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants