Skip to content

feat(retail): add Vertex AI Search for commerce snippets#10252

Merged
iennae merged 11 commits intoGoogleCloudPlatform:mainfrom
alarconesparza:alarconesparza-vertex-ai-search-502616950
Apr 30, 2026
Merged

feat(retail): add Vertex AI Search for commerce snippets#10252
iennae merged 11 commits intoGoogleCloudPlatform:mainfrom
alarconesparza:alarconesparza-vertex-ai-search-502616950

Conversation

@alarconesparza
Copy link
Copy Markdown
Contributor

@alarconesparza alarconesparza commented Apr 21, 2026

Description

Fixes internal b/502616950

Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.

Checklist

  • I have followed Sample Format Guide
  • pom.xml parent set to latest shared-configuration
  • Appropriate changes to README are included in PR
  • These samples need a new API enabled in testing projects to pass (let us know which ones)
  • These samples need a new/updated env vars in testing projects set to pass (let us know which ones)
  • Tests pass: mvn clean verify required
  • Lint passes: mvn -P lint checkstyle:check required
  • Static Analysis: mvn -P lint clean compile pmd:cpd-check spotbugs:check advisory only
  • This sample adds a new sample directory, and I updated the CODEOWNERS file with the codeowners for this sample
  • This sample adds a new Product API, and I updated the Blunderbuss issue/PR auto-assigner with the codeowners for this sample
  • Please merge this PR for me once it is approved

@product-auto-label product-auto-label Bot added api: retail Issues related to the Retail API API. samples Issues that are directly related to samples. labels Apr 21, 2026
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 introduces Java code samples for Vertex AI Search for commerce, covering basic search, pagination, and offset functionalities, along with corresponding integration tests. The review feedback identifies several improvement opportunities: using getTotalSize() instead of getResultsCount() to ensure accurate result counts across pages, simplifying API response handling, and removing redundant output in the samples. Additionally, the feedback suggests optimizing resource management in test utilities by reusing service clients instead of recreating them within loops.

Comment thread retail/snippets/src/test/java/com/example/search/Utils.java Outdated
Comment thread retail/snippets/src/main/java/com/example/search/Search.java
Comment thread retail/snippets/src/main/java/com/example/search/Search.java Outdated
Comment thread retail/snippets/src/main/java/com/example/search/SearchOffset.java Outdated
Comment thread retail/snippets/src/main/java/com/example/search/SearchPagination.java Outdated
Comment thread retail/snippets/src/test/java/com/example/search/Utils.java Outdated
Comment thread retail/snippets/src/test/java/com/example/search/Utils.java Outdated
@alarconesparza
Copy link
Copy Markdown
Contributor Author

/gemini review

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 introduces Java code samples and integration tests for Vertex AI Search for commerce, covering basic search, pagination, and offset functionality. The feedback provided focuses on correcting an inaccurate description in the README, optimizing the POM file by leveraging the BOM for dependency management, and improving the efficiency and reliability of test utilities by reusing service clients and extending the indexing wait times to prevent flaky tests.

Comment thread retail/snippets/README.md
Comment thread retail/snippets/pom.xml
Comment thread retail/snippets/src/test/java/com/example/search/Utils.java
Comment thread retail/snippets/src/test/java/com/example/search/Utils.java
Comment thread retail/snippets/src/test/java/com/example/search/Utils.java Outdated
@alarconesparza
Copy link
Copy Markdown
Contributor Author

/gemini review

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 introduces Java code samples for Vertex AI Search for commerce, including implementations for basic search, pagination, and offset-based results. It also provides a comprehensive suite of integration tests and a utility class for managing test data. A review comment suggests increasing the retry limit in the test utility to ensure products are fully indexed before tests run, reducing potential flakiness.

Comment thread retail/snippets/src/test/java/com/example/search/Utils.java
Comment thread retail/snippets/src/main/java/com/example/search/Search.java
Comment thread retail/snippets/src/main/java/com/example/search/Search.java
@XrossFox
Copy link
Copy Markdown

LGTM

@alarconesparza alarconesparza marked this pull request as ready for review April 24, 2026 23:20
@alarconesparza alarconesparza requested review from a team and yoshi-approver as code owners April 24, 2026 23:20
@snippet-bot
Copy link
Copy Markdown

snippet-bot Bot commented Apr 24, 2026

Here is the summary of changes.

You are about to add 3 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@XrossFox
Copy link
Copy Markdown

LGTM

Just checked the new test, all is looking good to me.

@iennae iennae merged commit 51c722e into GoogleCloudPlatform:main Apr 30, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: retail Issues related to the Retail API API. samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants