Skip to content

Updated engage snippets to accomodate feedback#945

Open
shashvatgupta-49 wants to merge 1 commit into
android:mainfrom
shashvatgupta-49:main
Open

Updated engage snippets to accomodate feedback#945
shashvatgupta-49 wants to merge 1 commit into
android:mainfrom
shashvatgupta-49:main

Conversation

@shashvatgupta-49

Copy link
Copy Markdown
  1. Updated EngageWorker to ensure empty continuation cluster publish guard

  2. Updated ClusterRequestFactory to ensure account profile and recommendation type are added

  3. Updated ItemToEntityConverter to add code

@snippet-bot

snippet-bot Bot commented Jun 12, 2026

Copy link
Copy Markdown

Here is the summary of changes.

You are about to add 1 region tag.

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

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

Copy link
Copy Markdown
Contributor

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 enables continuation publishing in the Engage worker, implements an empty continuation guard to delete clusters when no data is present, and adds a helper function demonstrating dual content rating conversions. The review identified critical compilation errors due to a missing constant definition and an unimplemented method in ClusterRequestFactory. Additionally, it is recommended to use localized string resources instead of a hardcoded title for the recommendation cluster.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread misc/src/main/java/com/example/snippets/engage/EngageWorker.kt
Comment thread misc/src/main/java/com/example/snippets/engage/EngageWorker.kt

val items = appDataRepository.getRecommendations()
val recommendationCluster = com.google.android.engage.common.datamodel.RecommendationCluster.Builder()
.setTitle("Recommended Content") // Required field

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The title string "Recommended Content" is hardcoded. To support internationalization (i18n) and localization, it is recommended to retrieve this string from the application resources using context.getString().

Suggested change
.setTitle("Recommended Content") // Required field
.setTitle(context.getString(R.string.recommended_content)) // Required field

1. Updated EngageWorker to ensure empty
continuation cluster publish guard

2. Updated ClusterRequestFactory to ensure account
profile and recommendation type are added

3. Updated ItemToEntityConverter to add code

@kkuan2011 kkuan2011 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks Shashvat for the PR! Would you mind getting a teammate to approve the PR first? Then Yacine/I can approve. Thank you!

.setEntityId(movie.id)
.setName(movie.title)
// ... other fields
.addContentRating(ratingSystem) // Recommended API

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

to confirm, you want both addContentRating and addContentRatingLegacy to be called on the same builder?

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