Skip to content

Conversation

@pfurio
Copy link
Member

@pfurio pfurio commented May 22, 2025

No description provided.

@halender
Copy link
Contributor

Task linked: TASK-7413 Implement notifications system

@pfurio pfurio requested a review from Copilot May 22, 2025 10:24
Copy link
Contributor

Copilot AI left a 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);

@pfurio pfurio requested a review from Copilot May 27, 2025 08:18
Copy link
Contributor

Copilot AI left a 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.

@opencb opencb deleted a comment from Copilot AI May 27, 2025
@ifiancu ifiancu self-requested a review June 9, 2025 15:46
@ifiancu ifiancu requested review from ifiancu and removed request for ifiancu June 9, 2025 15:53
@ifiancu ifiancu self-requested a review July 15, 2025 09:48
@ifiancu ifiancu requested a review from j-coll July 15, 2025 09:49
@ifiancu ifiancu requested review from jtarraga and removed request for j-coll July 15, 2025 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants