Page MenuHomePhabricator

Outreachy 31: Programs & Events Dashboard — Upgrade Ruby-on-Rails and other dependencies
Open, MediumPublic

Description

Project title: Programs & Events Dashboard: Upgrade Ruby-on-Rails and other dependencies
Brief summary: The Dashboard codebase has been running Rails 7.0.7 for more than two years, and Rails and other dependencies are significantly outdated. Incrementally upgrade Ruby dependencies to bring the application up to the current version of Rails (8.0.x). Optionally, upgrade outdated JavaScript dependencies as well.
Skills required: Ruby, JavaScript
Learning outcomes: Learn about the Ruby and Rails open source ecosystems, and the process of maintaining a complex Rails application.
Possible mentor(s): @Ragesoss, @Abishekdascs @empty-codes
Microtasks: https://github.com/WikiEducationFoundation/WikiEduDashboard/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22newcomer%20friendly%22
Any other additional information that the interns should know about:
Check out these docs to learn more about contributing to the Dashboard and how internships work for this project:

IMPORTANT: GSoC / Outreachy candidates are required to complete micro-tasks during the application period to prove their ability to work on a three month long project

Event Timeline

To the mentors: Has anyone started contributing to this project?

Most of the applicants are still getting familiar with the codebase. It’s quite large, so it might take a few more days or at least this week before they start contributing (opening PRs.)

Thanks, @Abishekdascs, for the update. It's great to know that the participants are already getting busy. How many are contributing to the project?

Around 10 Outreachy applicants have joined the Slack channel so far, so hopefully they’ll all start contributing to the project soon.

Around 10 Outreachy applicants have joined the Slack channel so far, so hopefully they’ll all start contributing to the project soon.

All the best to the contributors.. I'll be checking in soon..

LGoto triaged this task as Medium priority.Nov 5 2025, 9:30 PM

Weekly Update

Week 1: December 8 – December 12
Overview of Tasks Completed:

  • Upgraded Rails incrementally from 7.0.7 → 7.0.8 → 7.0.10
  • Updated the Gemfile and Gemfile.lock to apply the latest Rails 7.0.x security and bug fixes
  • Fixed test failures related to VCR, OmniAuth, and CSRF handling
  • Investigated and resolved Passenger spawning errors encountered in production
  • Restored the reverted Rails upgrade and updated Passenger/Apache documentation
  • Began work on the Rails 7.1.0 upgrade

Key Accomplishments:

  • Successfully applied Rails 7.0.10, updating all first-party Rails gems
  • Resolved production-only boot failures by enabling PassengerPreloadBundler
  • Stabilized the test suite with targeted spec and configuration updates
  • Updated Apache/Passenger config examples and upgrade docs to prevent future issues

Challenges Faced:

  • Passenger errors occurred only in production and were not reproducible locally
  • Some test failures were caused by external dependencies rather than application logic

Learnings:

  • Learned how Passenger loads gems differently from local bundle exec workflows
  • Gained experience performing safe, incremental Rails upgrades
  • Improved understanding of OmniAuth and CSRF behavior in feature tests

Goals for Next Week:

  • Continue upgrading from Rails 7.0.10 → 7.1.0
  • Address deprecations and ensure the test suite remains stable

Weekly Update Summary : 14 Dec to 22 Dec

Rails Upgrade & Dependency Management
Main update - Upgrading rails from 7.0.10 to 7.1.0 (ongoing)

  • Upgraded Rails incrementally from 7.0.7 → 7.0.8 → 7.0.10 → 7.1.0
  • Updated 20+ model files to use Rails 7.1–compatible serialization syntax
  • Updated application configuration to align with Rails 7.1 changes
  • Migrated from omniauth-rails_csrf_protection gem to OmniAuth’s built-in CSRF protection
  • Updated Devise to 4.9.4 and resolved related compatibility issues
  • Updated cache store and YAML loading configuration for Rails 7.1 and Psych security changes

Test Infrastructure

  • Fixed OAuth test failures by disabling CSRF protection in feature specs (Capybara does not preserve tokens across redirects)
  • Updated RSpec configuration to comply with Rails 7.1 requirements
  • Refactored TrainingModuleDueDateManager specs using proper before(:each) / after(:each) hooks for better isolation
  • Added comprehensive tests for course_ai_alert_manager.rb alert logic

Code Quality & Bug Fixes

  • Fixed serialization errors related to ActiveSupport::SafeBuffer
  • Corrected MySQL datetime comparison issues in alert logic
  • Improved TrainingModuleDueDateManager to handle empty blocks and ensure course associations are loaded
  • Added PassengerPreloadBundler configuration for improved server performance
  • Fixed RuboCop linting violations
  • Improved form markup by adding explicit IDs for better JavaScript and test reliability

Documentation

  • Updated upgrade documentation with Rails 7.0.8 migration notes
  • Added notes covering Rails 7.1 compatibility and configuration changes
  • Cleaned up deprecated Passenger gem boot issue notes

Issues Faced

Rails 7.1 Serialization Changes

  • Rails 7.1 required updating deprecated serialize usage across 20+ models to the new keyword-based syntax.

YAML Loading Security Restrictions

  • Psych security changes required explicit handling of YAML aliases, causing failures when loading existing configuration files.

CSRF Protection in OAuth Tests

  • CSRF enforcement in OAuth flows caused feature test failures due to Capybara losing tokens during external OAuth redirects.

Learnings

OmniAuth CSRF Handling

  • OmniAuth 2.0+ includes built-in CSRF protection via
  • OmniAuth::AuthenticityTokenProtection, making the separate gem unnecessary.
  • CSRF can be disabled in tests using: OmniAuth.config.request_validation_phase = nil

Rails 7.1 Upgrade Experience

  • Gained a deeper understanding of Rails 7.1 configuration changes, serialization updates, and security-related defaults.

Weekly Update - Dec 22 - Dec 29

Tasks Completed

  • Continued work on upgrading the application to Rails 7.1, focusing on post-upgrade stabilization and compatibility.
  • Investigated and resolved multiple test failures that emerged after the upgrade, particularly those related to time handling and test isolation.
  • Refactored time-dependent tests to ensure consistent behavior when tests are run individually or as part of the full test suite.
  • Updated deprecated Rails APIs and adjusted code to comply with new Rails 7.1 conventions.
  • Fixed serialization-related issues caused by stricter handling in newer Rails and Psych versions.
  • Updated YAML loading logic to align with enhanced security requirements in Rails 7.1.
  • Ran RuboCop after the upgrade and addressed a large number of offenses, including both auto-correctable and manual fixes.
  • Improved overall code quality by refactoring legacy patterns flagged during the upgrade process.

Challenges Faced

  • Several existing tests failed due to subtle changes in Rails 7.1 behavior, especially around time calculations and execution order.
  • Debugging test failures was challenging because some issues only appeared when the full test suite was run, indicating state leakage and test isolation problems.
  • Changes in serialization and YAML handling required careful investigation to avoid breaking existing functionality while staying compatible with the new framework version.
  • The large number of RuboCop offenses introduced after the upgrade made it necessary to distinguish between safe auto-fixes and changes requiring manual review.

Learnings and Skills Gained

  • Gained a deeper understanding of Rails 7.1 behavioral changes and how framework upgrades can surface hidden technical debt.
  • Improved skills in debugging complex test failures, especially those involving time-dependent logic and shared state.
  • Learned best practices for writing isolated, reliable tests that remain stable across framework upgrades.
  • Developed better familiarity with modern Rails conventions, updated serialization patterns, and secure YAML loading.
  • Strengthened experience in using RuboCop as a tool not just for linting, but for improving long-term maintainability.

Week 4 update - Dec 29 - Jan 2

Tasks Completed

  • Continued stabilizing and refining the Rails 7.1 upgrade, ensuring earlier changes are consistent and reliable across the codebase.
  • Investigated and fixed remaining intermittent test failures that appeared during full test suite execution.
  • Addressed additional RuboCop warnings that required manual fixes after auto-correction.
  • Began researching Rails 7.2, reviewing upcoming changes, deprecations, and behavioral updates.
  • Started creating a Rails 7.2 upgrade checklist to track required changes and potential risks.
  • Initiated a documentation draft outlining observations, breaking changes, and preparation steps for a future Rails 7.2 upgrade.

Challenges Faced

  • Some test failures were difficult to reproduce consistently and required deeper investigation into execution order and shared state.
  • Evaluating Rails 7.2 changes without finalized context required careful interpretation of early documentation and changelogs.

Learnings and Skills Gained

  • Gained stronger insight into how Rails upgrades affect test execution, application state, and long-term maintainability.
  • Improved skills in debugging flaky tests and isolating root causes.
  • Learned how to proactively prepare for future framework upgrades by creating structured checklists and documentation.
  • Developed a better understanding of Rails versioning, deprecation cycles, and forward-compatibility planning.

Weekly update - Jan 5 - Jan 12

Tasks Completed

  • Worked on Rails 7.1 upgrade, focusing on stabilizing the codebase after version changes.
  • Refactored and improved model specs (especially article_scoped_program_spec) for better clarity and organization.
  • Debugged and analyzed failing CI test cases, identifying issues related to cached counts and associations.

Managed Git workflows efficiently:

  • Compared branches and commits
  • Squashed multiple commits into a single clean commit
  • Used soft reset and commit editing to maintain a clean PR history
  • Restored specific files from another branch to fix local inconsistencies during the upgrade process.
  • Investigated serialization and dependency issues related to Rails 7.1 and gem compatibility.

Challenges Faced

  • Test failures after the Rails upgrade, especially where expected cached values did not update correctly.
  • Understanding why certain specs returned unexpected results (e.g., counts being 0 instead of 1).
  • Managing multiple commits during the upgrade and ensuring no work was accidentally lost while squashing.
  • Handling environment mismatches between local setup and CI, particularly with fixtures and test configurations.
  • Navigating gem version constraints and compatibility issues introduced by the Rails upgrade.

Learnings & Skills Gained

  • Gained deeper understanding of Rails 7.1 internals, especially around serialization, caching, and test behavior.
  • Improved confidence with advanced Git operations like soft resets, interactive rebasing, and commit squashing.
  • Strengthened debugging skills for RSpec failures and CI-related issues.
  • Learned best practices for maintaining clean and review-friendly PRs during large upgrades.
  • Enhanced ability to reason about test data setup, fixtures, and cache-dependent logic.

Week 6 - Jan 12 to Jan 18

Activities Completed

Worked on Rails 7.1 upgrade–related changes, including:

  • Updating controller methods to use redirect_back_or_to instead of redirect_back(fallback_location: ...) and few other changes related to rails 7.1 Made different PR's for smooth transition from 7.0.10 to 7.1.0 .
  • Understanding and referencing official Rails 7.1 changelogs for accurate PR documentation.
  • Updated PR descriptions with correct technical justifications (e.g., RSpec hook behavior).
  • Investigated CI failures caused by RuboCop after dependency upgrades.
  • Debugged and clarified Sidekiq 7 Strict Arguments behavior.

Challenges Faced

  • RuboCop failures in CI after upgrades, especially related to:
  • RSpec style rules (e.g., before(:each) vs before).
  • Understanding how to break down large upgrade branches into smaller, independent changes, as suggested.
  • Sidekiq 7’s Strict Arguments causing unexpected job failures due to non-JSON-safe arguments.
  • Recovering from Git history changes without losing work.

What I Learned

  • RSpec Best Practices - Upgrade Strategy
  • Large upgrades (Rails / Sidekiq) should be implemented incrementally.
  • Isolating changes reduces risk and makes PRs easier to review and debug.
  • Sidekiq 7 : Job arguments must be strictly JSON-serializable (no symbols, ActiveRecord objects, or custom classes).
  • Rails 7.1 : New helper methods like redirect_back_or_to simplify controller logic and improve safety.
  • Git -git reset --soft only moves HEAD and keeps changes staged. You can recover using reflog or recommit without losing code.

Week 7: Jan 19 - Jan 25

Activities Completed

  • Focused on stabilizing the codebase after the Rails 7.1 upgrade, addressing breaking changes introduced by the new version.
  • Refactored controller logic to align with updated Rails conventions, including replacing deprecated redirect patterns with safer alternatives.
  • Broke down the overall Rails upgrade effort into smaller, targeted pull requests to make reviews and debugging more manageable.
  • Studied Rails 7.1 release notes and changelogs to ensure upgrade-related changes were implemented correctly and documented accurately.
  • Refined pull request descriptions to clearly explain why certain changes were required, particularly around testing behavior.
  • Investigated CI pipeline failures triggered by newly enforced RuboCop rules after dependency upgrades.

Challenges Faced

  • A significant number of RuboCop violations surfaced post-upgrade, especially in test files, requiring decisions between refactoring vs temporary suppression.
  • Understanding how to sequence upgrade-related changes so that one PR would not block or conflict with another.
  • Navigating Git resets and branch cleanup while ensuring previous work could be restored if needed.

What I learned

  • Gained a stronger understanding of Rails 7.1 internals, especially around serialization and framework deprecations.
  • Improved skills in debugging framework upgrade issues by reading stack traces and understanding gem-level warnings.
  • Strengthened experience with CI/CD stability during major upgrades, ensuring progress without blocking the pipeline.
  • Developed a more audience-aware approach to documentation and PR descriptions, clearly explaining why decisions were made, not just what was changed.

Week 8 - Jan 26 – Feb 2
Activities Completed

  • Worked extensively on Ruby on Rails upgrade-related issues, especially around Ruby 3.x compatibility.
  • Investigated and debugged RSpec failures caused by keyword argument changes after upgrading Ruby.
  • Analyzed Ruby 3 keyword argument behavior and reviewed official Ruby changelogs to understand breaking changes.
  • Debugged failing GitHub Actions CI pipelines, including issues during:
  • Ruby setup
  • Bundler installation
  • Dependency resolution
  • Explored Rails 7.1 upgrade implications, particularly around authentication and server compatibility.
  • Researched and documented the need for upgrading Passenger to support newer Rails and Ruby versions.
  • Read through community discussions and StackOverflow threads to understand real-world upgrade pitfalls.

Challenges Faced

  • Faced unexpected test failures due to stricter keyword argument enforcement in newer Ruby versions.
  • Existing code and specs that worked earlier broke because Ruby no longer auto-converts hashes to keyword arguments.
  • CI failures were hard to trace due to environment differences between local and GitHub Actions runners.
  • Confusion around why upgrading one dependency (Rails) forced upgrades in others (Passenger, Ruby).
  • Lack of a single, clear source explaining minimum version compatibility between Rails, Ruby, and Passenger.
  • Debugging was time-consuming because multiple issues surfaced simultaneously after upgrades.

What I Learned

  • Gained a deeper understanding of Ruby 3 keyword argument changes and how they affect method signatures and RSpec tests.
  • Learned how framework upgrades cascade — upgrading Rails often requires aligning Ruby, Passenger, and other dependencies.
  • Improved skills in reading changelogs and RFC-style documentation instead of relying only on error messages.
  • Became more comfortable debugging CI/CD pipeline failures and understanding how Bundler and Ruby versions are resolved in CI.
  • Learned the importance of documenting upgrade decisions clearly to help future contributors.
  • Strengthened problem-solving skills by breaking down large upgrade issues into smaller, traceable causes.

Week 9 - Feb 3 - Feb 9
Activities Completed

  • Upgraded Rails from 7.0.10 to 7.1.0 and updated related framework gems.
  • Upgraded Ruby from 3.1.2 to 3.4.8, updated CI, and ensured compatibility.
  • Added required gems (csv, observer) for Ruby 3.4+.
  • Refactored deprecated Rails configurations (fixture_paths) and updated Jbuilder serialization.
  • Updated number_to_human usage to handle return type changes.
  • Refactored all Sentry logging to use recommended block syntax.
  • Fixed localization key and mailer variable issues.
  • Updated and stabilized failing tests.

Challenges Faced

  • Handling Rails 7.1 deprecations and behavioral changes.
  • Identifying Ruby 3.4 breaking changes (removed stdlib gems).
  • Updating Sentry API usage across the codebase.
  • Fixing brittle tests after framework upgrades.

Key Learnings

  • Framework upgrades require careful review of release notes and deprecations.
  • Ruby version changes can impact dependencies and CI.
  • Proper dependency management and version pinning are critical for stability.