Skip to content

Conversation

@sntiwari1
Copy link

@sntiwari1 sntiwari1 commented Oct 13, 2025

This PR upgrades the sunbird-dial-service repository from Play Framework 2.4.6 + Akka + Scala 2.11.12 to Play Framework 2.8.22 + Apache Pekko 1.0.3 + Scala 2.13.12.

The upgrade ensures license compliance, security, and modernization, while maintaining API compatibility and preserving existing functionality.

Issue Fixed: N/A (general upgrade and maintenance)

Motivation and Context:

  • License Compliance: Akka switched to Business Source License 1.1; Pekko remains Apache 2.0
  • Security: Old Play and Akka versions no longer receive updates
  • Modernization: Access to Play 2.8 features, Scala 2.13 improvements, and performance optimizations

Dependencies:

  • Play Framework 2.8.22
  • Apache Pekko 1.0.3
  • Scala 2.13.12
  • Jackson 2.11.4
  • Guice 5.1.0
  • SLF4J 2.0.9
  • Logback 1.4.14
  • Netty 4.1.93.Final
  • Commons Lang3 3.12.0

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature / Upgrade (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • Built all modules: mvn clean install -Dmaven.test.skip=true
  • Built with test compilation: mvn clean install -DskipTests
  • Packaged distribution: mvn play2:dist
  • Development server runs successfully: mvn play2:run

Test Configuration:

  • Software versions: Java 11/17, Play 2.8.22, Scala 2.13.12, Pekko 1.0.3
  • Hardware versions: 2 CPU / 4GB RAM

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my upgrade works
  • New and existing unit tests pass locally
  • Any dependent changes have been merged and published in downstream modules

Key Changes / Files Modified

Maven POMs

  • Updated all POM files with Play 2.8, Pekko 1.0.3, Scala 2.13, and supporting libraries
  • Added Scala 2.13 exclusions to prevent conflicts with Scala 2.11

Source Code

  • Migrated Akka imports to Pekko equivalents (akka.*org.apache.pekko.*)
  • Controllers updated to accept Http.Request parameters
  • Promise API converted to CompletionStage
  • Header API updated to use Optional pattern

Configuration

  • application.conf: Updated akka namespaces to pekko
  • Actor system, serialization, dispatcher references updated

Global.java Removal

  • Replaced deprecated Global.java with modules/StartModule.java using Guice
  • Preserved all startup functionality (Netty system property, telemetry, health checks)
  • Provides better lifecycle management via dependency injection

Play 2.8 API Updates

  • StartModule implements AbstractModule for Guice-based initialization
  • Filters updated to return List<EssentialFilter>
  • Routes file updated for request injection

Migration Impact

  • Business Logic: No changes; functionality preserved
  • API Compatibility: Maintained (Pekko API-compatible with Akka 2.6)
  • Code Changes: Primarily package name updates (akkapekko)
  • License: Fully compliant with Apache 2.0

Phase 2

  • Upgrade from Play Framework 2.8.22 to Play Framework 3.0.5 (Pending)

Copilot AI and others added 24 commits October 10, 2025 11:26
Co-authored-by: sntiwari1 <54884367+sntiwari1@users.noreply.github.com>
Co-authored-by: sntiwari1 <54884367+sntiwari1@users.noreply.github.com>
Co-authored-by: sntiwari1 <54884367+sntiwari1@users.noreply.github.com>
Co-authored-by: sntiwari1 <54884367+sntiwari1@users.noreply.github.com>
Co-authored-by: sntiwari1 <54884367+sntiwari1@users.noreply.github.com>
- Updated pom.xml with Play 3.0.5, Scala 2.13.12, and Pekko 1.0.3
- Migrated all Akka imports to Pekko (3 files)
- Updated configuration files (akka -> pekko)
- Added upgrade documentation (UPGRADE_README.md)

Co-authored-by: sntiwari1 <54884367+sntiwari1@users.noreply.github.com>
- Updated pom.xml to Play 2.8.22 (Maven plugin compatible)
- Migrated Akka to Pekko imports (3 files)
- Updated Promise to CompletionStage API
- Updated configuration (akka -> pekko)
- Added commons-lang3 dependency
- Updated Scala filter for Play 2.8
- Build partially working - controller updates in progress

Co-authored-by: sntiwari1 <54884367+sntiwari1@users.noreply.github.com>
…eckFilter

- Updated Global.java to extend DefaultHttpRequestHandler instead of GlobalSettings
- Fixed CompletionStage usage and request parameter handling
- Updated Filters.java to implement getFilters() method correctly
- Fixed HealthCheckFilter.scala to use akka.stream.Materializer (Play 2.8 uses Akka streams)
- Fixed all header() calls to use Optional pattern (.orElse(null))
- Added commons-lang3 dependency

Co-authored-by: sntiwari1 <54884367+sntiwari1@users.noreply.github.com>
- Fixed Filters.java to return List<EssentialFilter> (Play 2.8 requirement)
- Simplified Global.java to basic initialization class
- Updated all controller methods to accept Http.Request parameter
- Added ThreadLocal request() helper in BaseController for backward compatibility
- Updated routes file to pass request parameter to controller methods
- Fixed all header() API calls to use Optional pattern
- Build now completes successfully with mvn clean install -DskipTests

Co-authored-by: sntiwari1 <54884367+sntiwari1@users.noreply.github.com>
- Removed deprecated Global.java class
- Created modules/StartModule.java for Guice-based initialization
- Updated application.conf to use play.modules.enabled instead of application.global
- Fixed NullPointerException during startup by using proper module initialization
- Build and startup now work correctly with Play 2.8.22

Co-authored-by: sntiwari1 <54884367+sntiwari1@users.noreply.github.com>
- Created .mvn/jvm.config with --add-opens flags for Java 17 compatibility
- Downgraded Jackson from 2.14.3 to 2.11.4 (Play 2.8.22 compatibility)
- Updated UPGRADE_README.md with complete build instructions
- Application now starts successfully with mvn play2:run
- Server listening on port 9000

Co-authored-by: sntiwari1 <54884367+sntiwari1@users.noreply.github.com>
- Added detailed explanation of Global.java to StartModule.java migration
- Clarified that all functionality was preserved (no missing features)
- Explained Guice-based initialization replaces deprecated GlobalSettings
- Cleaned up README format per user requirements
- Removed version-specific details to focus on key changes

Co-authored-by: sntiwari1 <54884367+sntiwari1@users.noreply.github.com>
Updated upgrade documentation to reflect Phase 1 changes and removed testing recommendations and known issues.
…d Production Ready (Maven Compatible - Play 3.0 Not Supported)

Upgrade to Play Framework 2.8.22 and Apache Pekko 1.0.3 - Complete and Production Ready (Maven Compatible - Play 3.0 Not Supported)
@sntiwari1 sntiwari1 changed the base branch from release-8.0.0 to release-8.1.0 October 13, 2025 11:17
Copilot AI and others added 5 commits October 17, 2025 09:47
Co-authored-by: sntiwari1 <54884367+sntiwari1@users.noreply.github.com>
…umentation

Co-authored-by: sntiwari1 <54884367+sntiwari1@users.noreply.github.com>
Co-authored-by: sntiwari1 <54884367+sntiwari1@users.noreply.github.com>
…bution package generation

Co-authored-by: sntiwari1 <54884367+sntiwari1@users.noreply.github.com>
Copilot AI and others added 10 commits October 17, 2025 10:21
Co-authored-by: sntiwari1 <54884367+sntiwari1@users.noreply.github.com>
…patibility

Co-authored-by: sntiwari1 <54884367+sntiwari1@users.noreply.github.com>
Co-authored-by: sntiwari1 <54884367+sntiwari1@users.noreply.github.com>
Co-authored-by: sntiwari1 <54884367+sntiwari1@users.noreply.github.com>
Co-authored-by: sntiwari1 <54884367+sntiwari1@users.noreply.github.com>
Upgrade Play Framework to 3.0.5 and Match All Dependencies
SBCOSS-676: Upgraded the secret key variable
@sonarqubecloud
Copy link

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