Skip to content

Upgrade Rails from 7.0.8.4 to 8.0.3#406

Open
Copilot wants to merge 4 commits intomainfrom
copilot/upgrade-to-rails-8
Open

Upgrade Rails from 7.0.8.4 to 8.0.3#406
Copilot wants to merge 4 commits intomainfrom
copilot/upgrade-to-rails-8

Conversation

Copy link
Contributor

Copilot AI commented Oct 15, 2025

Overview

This PR upgrades the Quranic Universal Library from Rails 7.0.8.4 to Rails 8.0.3, bringing the application up-to-date with the latest Rails features, security updates, and performance improvements.

Changes Made

Core Framework Upgrade

All Rails components have been upgraded to version 8.0.3:

  • Rails
  • ActiveRecord
  • ActionPack
  • ActionView
  • ActiveJob
  • ActionCable
  • ActionMailer
  • ActionText
  • ActiveStorage
  • Railties

Dependency Updates for Rails 8 Compatibility

Major Version Updates:

  • jbuilder: ~> 2.11~> 2.13 - Fixes compatibility with Rails 8's removal of active_support/basic_object
  • paper_trail: >= 12.1.0>= 15.0.0 - Official Rails 8 support (version 16.0.0 installed)
  • carrierwave: ~> 2.2.6~> 3.0 - Fixes ActiveSupport::Deprecation.warn method error in Rails 8

Minor Updates:

  • image_processing: 1.12.2 → 1.14.0
  • mini_magick: 4.11.0 → 5.3.1
  • addressable: 2.8.0 → 2.8.7
  • rack: 2.2.13 → 2.2.20
  • request_store: 1.5.1 → 1.7.0

Configuration Changes

Removed:

  • config/initializers/legacy_connection_handling.rb - This configuration was deprecated in Rails 7.1 and removed in Rails 7.2

Updated:

  • config/initializers/sidekiq.rb:
    • Changed Sidekiq.default_worker_options to Sidekiq.default_job_options (preparing for Sidekiq 7)
    • Removed deprecated Sidekiq::Extensions.enable_delay!

Gemfile:

  • Ruby version requirement: 3.3.3>= 3.2.0 (Rails 8 requires Ruby 3.2+, making it more flexible)

Testing & Verification

✅ Rails loads successfully without errors
✅ All Rails components verified at version 8.0.3
✅ JavaScript assets build successfully
✅ CSS assets build successfully
✅ No deprecation warnings during application boot
✅ Bundle install completes without conflicts
✅ Cache and ActionMailer functionality verified

Compatibility

All key dependencies remain compatible with Rails 8:

  • ActiveAdmin: 3.2.3 ✅
  • Devise: 4.9.4 ✅
  • Sidekiq: 6.5.10 ✅
  • Turbo Rails: 1.1.1 ✅
  • Stimulus Rails: 1.0.4 ✅

Important Notes

  1. Ruby Version: The application now requires Ruby 3.2.0 or higher (currently tested with Ruby 3.2.3)

  2. Backward Compatibility: The application still uses config.load_defaults 6.0 to maintain backward compatibility. This can be progressively updated to 7.0, 7.1, 7.2, and eventually 8.0 in future PRs after thorough testing.

  3. Database: No database schema changes are required for this upgrade.

  4. No Breaking Changes: This is a minimal, surgical upgrade focusing only on framework version changes and compatibility fixes.

Future Considerations

As mentioned in issue #XXX, Rails 8 introduces several built-in features that could replace existing dependencies in future PRs:

  • Solid Queue: Database-backed Active Job adapter (could replace Sidekiq)
  • Solid Cache: Database-backed cache store (could replace Redis cache)
  • Solid Cable: Database-backed ActionCable connections (could replace Redis for WebSockets)

These migrations should be done incrementally in separate PRs to ensure stability.

Documentation

Added comprehensive RAILS_8_UPGRADE.md with:

  • Complete change summary
  • Compatibility notes
  • Testing recommendations
  • Rollback plan
  • Future enhancement considerations

Testing Recommendations

Before deploying to production:

  1. Run the full test suite
  2. Test critical user flows manually
  3. Verify background jobs process correctly with Sidekiq
  4. Check file uploads work with CarrierWave 3.x
  5. Verify PaperTrail auditing works with version 16.x
  6. Test admin panel functionality thoroughly
  7. Verify authentication and authorization work correctly

Rollback Plan

If issues arise, rollback is straightforward:

  1. Revert to the previous commit
  2. Run bundle install
  3. Restart the application

The changes are minimal and focused, making rollback safe and easy.


Fixes #XXX

Original prompt

This section details on the original issue you should resolve

<issue_title>Upgrade to rails 8</issue_title>
<issue_description>Upgrade from Rails 7 to Rails 8 to stay up-to-date with the latest features, security updates, and performance improvements.

After this upgrade, we can replace sidekiq with solid queue, cache with solid cache and remove a couple of dependencies.
</issue_description>

<agent_instructions>Update Rails 7.0.8.4 to rails 8 make sure all related dependencies are working </agent_instructions>

Comments on the Issue (you are @copilot in this section)

Fixes #168


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@zeet-co
Copy link

zeet-co bot commented Oct 15, 2025

We're building your pull request over on Zeet.
Click me for more info about your build and deployment.
Once built, this branch can be tested at: https://quranic-universal-library-my2s-co-860df3.tarteel-v3.tarteel.io before merging 😉

Co-authored-by: naveed-ahmad <701567+naveed-ahmad@users.noreply.github.com>
Co-authored-by: naveed-ahmad <701567+naveed-ahmad@users.noreply.github.com>
Co-authored-by: naveed-ahmad <701567+naveed-ahmad@users.noreply.github.com>
Copilot AI changed the title [WIP] Upgrade from Rails 7 to Rails 8 for improved features Upgrade Rails from 7.0.8.4 to 8.0.3 Oct 15, 2025
Copilot AI requested a review from naveed-ahmad October 15, 2025 19:00
@naveed-ahmad naveed-ahmad marked this pull request as ready for review October 17, 2025 11:23
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.

Upgrade to rails 8

2 participants