Skip to content

zms storage layer does not return multiple matches for the product id listing#3145

Merged
psasidhar merged 2 commits intomasterfrom
dom-list
Dec 11, 2025
Merged

zms storage layer does not return multiple matches for the product id listing#3145
psasidhar merged 2 commits intomasterfrom
dom-list

Conversation

@havetisyan
Copy link
Copy Markdown
Collaborator

@havetisyan havetisyan commented Dec 8, 2025

Description

addresses #3142

Contribution Checklist:

  • The pull request does not introduce any breaking changes
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.

Attach Screenshots (Optional)

… listing

Signed-off-by: Henry Avetisyan <hga@yahooinc.com>
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @havetisyan, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses an issue in the ZMS storage layer where domain lookup operations by product ID or cloud provider were only returning a single match, even if multiple domains shared the same identifier. The core change involves modifying these lookup methods to return a list of domains, thereby supporting scenarios where multiple domains can be linked to the same product ID or cloud provider attribute. This enhancement ensures more accurate and complete data retrieval for domain associations.

Highlights

  • Enhanced Domain Lookup Functionality: The lookupDomainByProductId and lookupDomainByCloudProvider methods in the ObjectStoreConnection interface and its JDBCConnection implementation have been updated to return a List<String> of domain names instead of a single String. This change allows the system to correctly handle scenarios where multiple domains might be associated with the same product ID or cloud provider attribute.
  • Centralized Uniqueness Check Logic: A new helper method, uniquenessCheck, has been introduced in JDBCConnection.java. This method centralizes the logic for verifying the uniqueness of domain attributes such as product IDs, AWS accounts, Azure subscriptions, and GCP projects, improving code reusability and maintainability.
  • Updated ZMS Service Layer: The DBService.java in the ZMS server has been modified to correctly process the List<String> return type from the updated ObjectStoreConnection lookup methods, ensuring that the ZMS API can now return all matching domains for a given product ID or cloud provider.
  • Comprehensive Test Coverage: Existing unit tests in JDBCConnectionTest.java have been updated to reflect the new List<String> return types and to use getString("name") for ResultSet operations. A new test case, testMultipleDomainsWithSameProductId, has been added to ZMSMetaAttributeTest.java to validate the system's behavior when multiple domains share the same product ID, particularly when uniqueness enforcement is disabled.
  • Minor Refactoring: A small typo in the setOperationTimeout method parameter name (opTimout to opTimeout) was corrected in ObjectStoreConnection.java, and assertEquals calls in JDBCConnectionTest.java were adjusted for consistency (actual, expected).
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request modifies the storage layer to support multiple domains being associated with a single product ID. The lookupDomainByProductId and lookupDomainByCloudProvider methods in ObjectStoreConnection and its JDBCConnection implementation have been updated to return a List<String> instead of a single String.

The implementation in DBService has been updated to correctly handle the list of domains.

A good refactoring was done in JDBCConnection to introduce a uniquenessCheck helper method, which centralizes logic and reduces code duplication in various uniqueness verification methods.

The tests have been updated to reflect these changes, and a new integration test has been added to verify the support for multiple domains with the same product ID, which is great.

I've found one issue where a method returning a list can return null, which could lead to a NullPointerException. Please see my specific comment.

Also, please note that changing method signatures in the ObjectStoreConnection interface is a breaking change. While all internal implementations are updated, this could affect any external consumers of this interface.

Signed-off-by: Henry Avetisyan <hga@yahooinc.com>
@psasidhar psasidhar merged commit 256e0e2 into master Dec 11, 2025
8 checks passed
@psasidhar psasidhar deleted the dom-list branch December 11, 2025 16:19
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.

2 participants