Issue #SBCOSS-00: Migrate Keycloak config to config-based approach and fix ClassCastException in managedUsers#212
Merged
pallakartheekreddy merged 6 commits intoSunbird-Lern:release-8.0.0from Aug 14, 2025
chethann007:delete-job-fix
Merged
Issue #SBCOSS-00: Migrate Keycloak config to config-based approach and fix ClassCastException in managedUsers#212pallakartheekreddy merged 6 commits intoSunbird-Lern:release-8.0.0from chethann007:delete-job-fix
pallakartheekreddy merged 6 commits intoSunbird-Lern:release-8.0.0from
chethann007:delete-job-fix
Conversation
- Add comprehensive Keycloak configuration section to UserDeletionCleanupConfig - Replace hardcoded environment variable references with config-based properties in KeyCloakConnectionProvider - Update KeyCloakConnectionProvider constructor to accept UserDeletionCleanupConfig - Use config value for connection pool size instead of hardcoded string - Fix deletionStatus assignment in UserDeletionCleanupFunction for proper audit tracking - Add logging for URL and response status in user deletion process - Group Keycloak-related configuration properties for better organization
There was a problem hiding this comment.
Review by Korbit AI
Korbit automatically attempts to detect when you fix issues in new commits.
| Category | Issue | Status |
|---|---|---|
| Exposed Sensitive Keycloak Credentials in Memory ▹ view | ||
| Unsafe List Type Casting ▹ view | ||
| Insufficient Keycloak Configuration Context ▹ view | ✅ Fix detected | |
| Mismatched Config Keys and Variable Names ▹ view |
Files scanned
| File Path | Reviewed |
|---|---|
| user-org-jobs/user-deletion-cleanup/src/main/scala/org/sunbird/job/deletioncleanup/domain/Event.scala | ✅ |
| user-org-jobs/user-deletion-cleanup/src/main/scala/org/sunbird/job/deletioncleanup/task/UserDeletionCleanupConfig.scala | ✅ |
| user-org-jobs/user-deletion-cleanup/src/main/scala/org/sunbird/job/deletioncleanup/util/KeyCloakConnectionProvider.scala | ✅ |
| user-org-jobs/user-deletion-cleanup/src/main/scala/org/sunbird/job/deletioncleanup/functions/UserDeletionCleanupFunction.scala | ✅ |
Explore our documentation to understand the languages and file types we support and the files we ignore.
Check out our docs on how you can make Korbit work best for you and your team.
...-cleanup/src/main/scala/org/sunbird/job/deletioncleanup/task/UserDeletionCleanupConfig.scala
Outdated
Show resolved
Hide resolved
...-cleanup/src/main/scala/org/sunbird/job/deletioncleanup/task/UserDeletionCleanupConfig.scala
Show resolved
Hide resolved
...-cleanup/src/main/scala/org/sunbird/job/deletioncleanup/task/UserDeletionCleanupConfig.scala
Outdated
Show resolved
Hide resolved
...jobs/user-deletion-cleanup/src/main/scala/org/sunbird/job/deletioncleanup/domain/Event.scala
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the user-deletion-cleanup Flink job to improve configuration management and fix runtime errors. It migrates Keycloak configuration from environment variables to a centralized config-based approach and addresses a ClassCastException in the managedUsers method.
- Centralized Keycloak configuration in UserDeletionCleanupConfig class
- Fixed ClassCastException with proper type checking in Event.managedUsers method
- Corrected variable assignment issues in deletion status tracking
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| KeyCloakConnectionProvider.scala | Updated constructor to accept config object and replaced environment variable calls with config properties |
| UserDeletionCleanupConfig.scala | Added Keycloak configuration properties with centralized management |
| UserDeletionCleanupFunction.scala | Fixed deletion status assignment and updated Keycloak provider instantiation |
| Event.scala | Enhanced managedUsers method with robust type checking to handle ClassCastException |
| pom.xml | Added Maven Shade Plugin configuration for executable JAR packaging |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
...cleanup/src/main/scala/org/sunbird/job/deletioncleanup/util/KeyCloakConnectionProvider.scala
Outdated
Show resolved
Hide resolved
...jobs/user-deletion-cleanup/src/main/scala/org/sunbird/job/deletioncleanup/domain/Event.scala
Show resolved
Hide resolved
...jobs/user-deletion-cleanup/src/main/scala/org/sunbird/job/deletioncleanup/domain/Event.scala
Outdated
Show resolved
Hide resolved
b9be252
into
Sunbird-Lern:release-8.0.0
4 of 5 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR refactors and stabilizes the user-deletion-cleanup Flink Job by:
Refactor
Fix
Chore
Description by Korbit AI
What change is being made?
Migrate Keycloak configuration to a config-based approach and resolve a ClassCastException in the
managedUsersfunction within the user deletion cleanup module.Why are these changes being made?
The Keycloak configuration previously depended on environment variables, which was less efficient and hard to manage. Transitioning to a config-based setup enhances maintainability and scalability. Additionally, handling potential
ClassCastExceptioninmanagedUsersensures smoother and more robust data processing when user deletion cleanup jobs are executed.