Skip to content

Unified Sunbird Platform Common Module - #1289

Merged
maheshkumargangula merged 17 commits into
developfrom
platform-common
Feb 10, 2026
Merged

Unified Sunbird Platform Common Module#1289
maheshkumargangula merged 17 commits into
developfrom
platform-common

Conversation

@chethann007

Copy link
Copy Markdown
Contributor

Summary

Integrated and consolidated the legacy platform-common and related utility modules into a single, unified core/sunbird-platform-common module. This module now serves as the centralized source of truth for base classes, common utilities, logging, telemetry, and shared configurations across all Lern microservices.

Key Changes

  • New Core Module: Established core/sunbird-platform-common as the unified base library, consolidating logic from multiple legacy utility modules.
  • Legacy Cleanup: Removed the redundant core/platform-common and core/sunbird-event-utils modules to eliminate technical debt and version fragmentation.
  • Global Refactoring: Updated the entire codebase across service, controller, and core sub-modules to reference the new unified library, standardizing imports and dependency management.
  • Improved Standardization: Unified the logging patterns, telemetry generation, and error handling codes into a single shared interface.

Impact

Provides a consistent and robust foundation for all Lern microservices, reduces footprint by eliminating duplicate libraries, simplifies dependency management, and ensures that improvements to core utilities are universally applied across the platform.

…dule

- Moved telemetry-related classes from platform-common to sunbird-event-utils.
- Updated POM files and resolved circular dependencies via build-helper-maven-plugin.
- Removed the old core/platform-common module files and resources as part of the transition to a unified sunbird-platform-common library.
- Removed the core/sunbird-event-utils module and its telemetry utility classes as part of the ongoing unification into the sunbird-platform-common library.
- Added core/sunbird-platform-common module with consolidated utilities, logging, and telemetry.
- Added sunbird-platform-common module to core/pom.xml.
- Removed legacy platform-common and sunbird-event-utils modules.
- Synchronized dependency versions (Guava, Pekko, Kafka, Keycloak) across all POM files.
- Consolidated build plugins and properties in the core and root pom.xml files.
…d-platform-common

- Updated imports and request/response handling across all controllers.
- Updated request validators to use the consolidated validation logic from the unified library.
- Refactored controller unit tests to reflect changes in utility classes and error handling.
- Verified and updated telemetry generation and logging within the controller layer.
…ntegration

- Refactored the core service layer and associated unit tests to use the new unified sunbird-platform-common library structure.
- Updated imports and package references across all service implementation classes.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR consolidates legacy platform-common and utility modules into a single, unified core/sunbird-platform-common module, serving as the centralized source for base classes, common utilities, logging, telemetry, and shared configurations across all Lern microservices.

Changes:

  • Established core/sunbird-platform-common as the unified base library
  • Removed redundant core/platform-common and core/sunbird-event-utils modules
  • Updated imports across service, controller, and core sub-modules to reference the new unified library

Reviewed changes

Copilot reviewed 217 out of 532 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
core/sunbird-platform-common/src/main/java/org/sunbird/datasecurity/impl/*.java Enhanced JavaDoc documentation for encoder/decoder classes
core/sunbird-platform-common/src/main/java/org/sunbird/datasecurity/*.java Added new service interfaces with comprehensive documentation
core/sunbird-platform-common/src/main/java/org/sunbird/common/PropertiesCache.java New singleton configuration properties manager
core/sunbird-platform-common/src/main/java/org/sunbird/auth/verifier/*.java New authentication key management classes
core/sunbird-es-utils/src/test/java/**/*.java Added comprehensive test coverage for ES utilities
core/sunbird-cassandra-utils/**/*.java Import path updates and test additions
core/notification-utils/**/*.java Updated import paths to reference new unified module
controller/**/*.java Updated import paths from org.sunbird.exception.ResponseCode to org.sunbird.response.ResponseCode
controller/app/util/PrintEntryExitLog.java Updated to use getResponseCodeEnum() method
controller/app/controllers/BaseController.java Added null checks for exception.getResponseCode()

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

Comment on lines +52 to +55
int lenght = data.length() - 4;
StringBuilder builder = new StringBuilder();
for (int i = 0; i < data.length(); i++) {
if (i < lenght) {

Copilot AI Feb 5, 2026

Copy link

Choose a reason for hiding this comment

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

Corrected spelling of 'lenght' to 'length'.

Suggested change
int lenght = data.length() - 4;
StringBuilder builder = new StringBuilder();
for (int i = 0; i < data.length(); i++) {
if (i < lenght) {
int length = data.length() - 4;
StringBuilder builder = new StringBuilder();
for (int i = 0; i < data.length(); i++) {
if (i < length) {

Copilot uses AI. Check for mistakes.
}

ResponseCode code = exception.getResponseCode();
ResponseCode code = exception.getResponseCodeEnum();

Copilot AI Feb 5, 2026

Copy link

Choose a reason for hiding this comment

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

The method name getResponseCodeEnum() is inconsistent with the existing getResponseCode() method pattern in the codebase. This appears to be a new method introduced during refactoring. Verify this method exists in ProjectCommonException and consider whether the naming convention should be getResponseCode() to maintain consistency.

Suggested change
ResponseCode code = exception.getResponseCodeEnum();
ResponseCode code = exception.getResponseCode();

Copilot uses AI. Check for mistakes.
// This code is for backwards compatibility
if (request.path() != null && request.path().startsWith("/v1/otp/generate")) {
if ("errorRateLimitExceeded".equalsIgnoreCase(exception.getResponseCode().name())) {
if (exception.getResponseCode() != null && "errorRateLimitExceeded".equalsIgnoreCase(exception.getResponseCode().name())) {

Copilot AI Feb 5, 2026

Copy link

Choose a reason for hiding this comment

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

Multiple null checks for exception.getResponseCode() are repeated throughout this method. Consider extracting exception.getResponseCode() to a local variable at the beginning of the method to improve readability and avoid redundant method calls.

Copilot uses AI. Check for mistakes.
Comment on lines +364 to +369
<repositories>
<repository>
<id>cloud-store</id>
<url>https://oss.sonatype.org/content/repositories/orgsunbird-1021</url>
</repository>
</repositories>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remove this. It is not required.

@maheshkumargangula
maheshkumargangula merged commit 4063cfa into develop Feb 10, 2026
0 of 2 checks passed
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.

3 participants