- 
                Notifications
    You must be signed in to change notification settings 
- Fork 102
TASK-7413 - Implement notifications system #2586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
| Task linked: TASK-7413 Implement notifications system | 
There was a problem hiding this comment.
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 implements a notifications system in the OpenCGA catalog, adding new managers, database adaptors, API endpoints, CLI commands, and corresponding client support.
- Adds NotificationManager and related methods to CatalogManager and AbstractManager.
- Introduces NotificationDBAdaptor and NotificationConverter, and updates CLI commands and REST client generators to support notifications.
- Extends authorization and permission checks with project administrator functionality, and adjusts CatalogFqn usage in VariantStorageManager.
Reviewed Changes
Copilot reviewed 67 out of 67 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description | 
|---|---|
| CatalogManager.java | Added NotificationManager field initialization and a corresponding getter. | 
| AbstractManager.java | Added a new method to get NotificationDBAdaptor and updated query key conversion. | 
| CatalogAuthorizationException.java | Added a new exception method for project administration. | 
| NotificationConverter.java | New converter class for notifications. | 
| UserMongoDBAdaptor.java | Modified query handling for INTERNAL_STATUS_ID, removing conversion logic. | 
| OrganizationMongoDBAdaptorFactory.java | Added NOTIFICATION_COLLECTION support and accessor for NotificationDBAdaptor. | 
| MongoDBAdaptorFactory.java | Added NotificationDBAdaptor accessor method. | 
| UserDBAdaptor.java | Added NOTIFICATIONS query parameter. | 
| NotificationDBAdaptor.java | New interface for Notification database operations. | 
| DBAdaptorFactory.java | Updated with NotificationDBAdaptor method definition. | 
| CatalogAuthorizationManager.java | Extended authorization logic with project admin checks and updated method signature for study administration. | 
| AuthorizationManager.java | Updated interface with new project admin methods and renamed study id parameter. | 
| CLI and REST client files | Added notifications command options, executor, CLI completions, and client generation updates. | 
| VariantStorageManager.java | Updated CatalogFqn method to extract the FQN correctly. | 
Comments suppressed due to low confidence (3)
opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/NotificationsCommandExecutor.java:50
- Since the notifications functionality spans multiple components (manager, adaptor, CLI, etc.), it is important to ensure that comprehensive tests are added to cover these new code paths and edge scenarios.
logger.debug("Executing Notifications command line");
opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/mongodb/UserMongoDBAdaptor.java:777
- The conversion logic for INTERNAL_STATUS_ID (i.e. converting the status to a positive status) has been removed. Please verify that this change is aligned with the overall behavior expected from the query, as it might affect clients that rely on the transformed status values.
case INTERNAL_STATUS_ID:
opencga-analysis/src/main/java/org/opencb/opencga/analysis/variant/manager/VariantStorageManager.java:1083
- The change from using fromProjectFqn to extractFqnFromProjectFqn alters how the FQN is parsed. It is advisable to review that the new method handles all project FQN edge cases consistently with the previous behavior.
CatalogFqn projectFqn = CatalogFqn.extractFqnFromProjectFqn(projectFqnStr);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request implements a notifications system and integrates it across the catalog, authorization, CLI, and client generator modules. Key changes include:
- Introducing a new NotificationDBAdaptor interface and its corresponding factory methods.
- Adding a notifications query parameter to UserDBAdaptor and updating authorization methods for project-level admin checks.
- Extending CLI options, executors, completers, and client generators to support notifications.
Reviewed Changes
Copilot reviewed 77 out of 77 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description | 
|---|---|
| MongoDBAdaptorFactory.java | Adds a new method to obtain the NotificationDBAdaptor for a given organization. | 
| UserDBAdaptor.java | Introduces a new NOTIFICATIONS query parameter for notifications. | 
| NotificationDBAdaptor.java | Defines the NotificationDBAdaptor interface with all relevant notification operations. | 
| DBAdaptorFactory.java | Updates the adaptor factory to include notifications support. | 
| CatalogAuthorizationManager.java | Adds methods for checking project administrator permissions and a helper for retrieving project admins. | 
| AuthorizationManager.java | Updates interface signatures for study and project admin checks. | 
| UsersCommandOptions.java & OrganizationsCommandOptions.java | Updates parameter descriptions for name and email fields. | 
| NotificationsCommandOptions.java | Adds CLI options for notifications commands. | 
| NotificationsCommandExecutor.java | Implements CLI executor methods for aggregation stats, creation, search, info, and visit operations related to notifications. | 
| ExecutorProvider.java, OpencgaCliOptionsParser.java, OpenCgaCompleter.java | Integrates notifications into the command routing and autocompletion. | 
| Client generator files & VariantStorageManager.java | Update code and configuration to account for notifications functionality. | 
No description provided.