Skip to content

feat: modernize Kotlin snippets module with capabilities and visual test suites - #2427

Open
dkhawk wants to merge 3 commits into
feat/snippets-java-appfrom
feat/snippets-kotlin-app
Open

dkhawk wants to merge 3 commits into
feat/snippets-java-appfrom
feat/snippets-kotlin-app

Conversation

@dkhawk

@dkhawk dkhawk commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Create :snippets:kotlin-app with 14 snippet categories, KTX extensions, and documentation region tags
  • Add Kotlin snippet infrastructure (KotlinSnippetsActivity, MapActivity, SnippetRegistry, TrackedMap)
  • Add Kotlin capabilities test suite (CatalogCapabilitiesTestSuite, CameraControl, Events, MapInit, Marker)
  • Add Kotlin visual test suite (BaseVisualTest, VisualTests)
  • Remove legacy Kotlin snippet modules (snippets/app-ktx, snippets/app-utils-ktx)
  • Update root settings.gradle.kts

Stacked Base

Stacked on #2426 (feat/snippets-java-app).

Reviewers

@kikoso

@dkhawk
dkhawk force-pushed the feat/snippets-kotlin-app branch from 3eb7aaa to 8c6b89b Compare September 15, 2026 00:25
@dkhawk
dkhawk force-pushed the feat/snippets-kotlin-app branch from 8c6b89b to 293149c Compare September 15, 2026 00:35
@dkhawk
dkhawk marked this pull request as ready for review September 15, 2026 00:38
@dkhawk
dkhawk requested a review from kikoso September 15, 2026 00:38
@snippet-bot

snippet-bot Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Here is the summary of changes.

You are about to add 131 region tags.
You are about to delete 40 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

@dkhawk
dkhawk added this pull request to stack #2429 September 15, 2026 00:43
@dkhawk
dkhawk force-pushed the feat/snippets-kotlin-app branch from 293149c to 00469c2 Compare September 15, 2026 18:22
@dkhawk
dkhawk force-pushed the feat/snippets-kotlin-app branch from 00469c2 to 37ae58f Compare September 15, 2026 22:54

@github-advanced-security github-advanced-security AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Android Lint found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

layer.addLayerToMap()
// [END maps_android_utils_kml_add_layer]

// [START maps_android_utils_kml_remove_layer]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same class of issue I flagged on #2426, smaller in scope here. This PR drops 3 devsite region tags from the repo entirely:

tag was in
maps_android_utils_kml_remove_layer this file, line 52
maps_android_ktx_install_snippet snippets/app-ktx/build.gradle.kts:74
maps_android_utils_ktx_install_snippet snippets/app-utils-ktx/build.gradle.kts:73

I verified by diffing every [START ...] tag between feat/snippets-java-app and feat/snippets-kotlin-app, then grepping each missing one across the whole tree to rule out relocation.

The two *_install_snippet tags are the Gradle dependency snippets for the KTX libraries, which are exactly the sort of thing an installation page includes by tag. Worth noting that snippets/app-ktx/build.gradle.kts is detected as a rename to snippets/kotlin-app/build.gradle.kts (R059), so the file survives but the tag inside it does not.

Could you carry these three across to the new module, or confirm they are safe to retire?

Separately, nice work on the androidTest suites here. SnippetDiscoveryTest plus the per-capability tests is a good pattern, and it's a real step up from what the legacy modules had.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Addressed in commit bc534e92. All 3 dropped devsite region tags have been restored and verified:

  • maps_android_ktx_install_snippet and maps_android_utils_ktx_install_snippet have been carried over to snippets/kotlin-app/build.gradle.kts.
  • maps_android_utils_kml_remove_layer has been added to UtilsSnippets.kt (removeKmlLayer).
  • Also forwarded missing GoogleMap methods on TrackedMap.kt and eliminated .delegate calls across snippet tags, and sanitized API key logging in MapActivity.kt.

@dkhawk
dkhawk force-pushed the feat/snippets-kotlin-app branch from 98c117d to bc534e9 Compare September 29, 2026 23:22
@dkhawk
dkhawk force-pushed the feat/snippets-kotlin-app branch from bc534e9 to 25476e6 Compare September 30, 2026 03:11
@dkhawk
dkhawk force-pushed the feat/snippets-kotlin-app branch 2 times, most recently from 8aace02 to 65c7503 Compare September 30, 2026 22:06
@dkhawk
dkhawk requested review from LoyalAbbas and kikoso September 30, 2026 23:14
@dkhawk
dkhawk force-pushed the feat/snippets-kotlin-app branch from 65c7503 to d3c82f0 Compare September 30, 2026 23:20
…est suites

- Create :snippets:kotlin-app with 14 snippet categories, KTX extensions, and documentation region tags
- Add Kotlin snippet infrastructure (KotlinSnippetsActivity, MapActivity, SnippetRegistry, TrackedMap)
- Add Kotlin capabilities test suite (CatalogCapabilitiesTestSuite, CameraControl, Events, MapInit, Marker)
- Add Kotlin visual test suite (BaseVisualTest, VisualTests)
- Remove legacy Kotlin snippet modules (snippets/app-ktx, snippets/app-utils-ktx)
- Update root settings.gradle.kts
@dkhawk
dkhawk force-pushed the feat/snippets-kotlin-app branch from d3c82f0 to 5ecabb3 Compare September 30, 2026 23:46
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.

3 participants