Unified Sunbird Platform Common Module - #1289
Conversation
… use flexible index options.
…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.
There was a problem hiding this comment.
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-commonas the unified base library - Removed redundant
core/platform-commonandcore/sunbird-event-utilsmodules - 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.
| int lenght = data.length() - 4; | ||
| StringBuilder builder = new StringBuilder(); | ||
| for (int i = 0; i < data.length(); i++) { | ||
| if (i < lenght) { |
There was a problem hiding this comment.
Corrected spelling of 'lenght' to 'length'.
| 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) { |
| } | ||
|
|
||
| ResponseCode code = exception.getResponseCode(); | ||
| ResponseCode code = exception.getResponseCodeEnum(); |
There was a problem hiding this comment.
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.
| ResponseCode code = exception.getResponseCodeEnum(); | |
| ResponseCode code = exception.getResponseCode(); |
| // 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())) { |
There was a problem hiding this comment.
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.
| <repositories> | ||
| <repository> | ||
| <id>cloud-store</id> | ||
| <url>https://oss.sonatype.org/content/repositories/orgsunbird-1021</url> | ||
| </repository> | ||
| </repositories> |
There was a problem hiding this comment.
Remove this. It is not required.
Summary
Integrated and consolidated the legacy platform-common and related utility modules into a single, unified
core/sunbird-platform-commonmodule. 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
core/sunbird-platform-commonas the unified base library, consolidating logic from multiple legacy utility modules.core/platform-commonandcore/sunbird-event-utilsmodules to eliminate technical debt and version fragmentation.service,controller, andcoresub-modules to reference the new unified library, standardizing imports and dependency management.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.