google-cloud-go icon indicating copy to clipboard operation
google-cloud-go copied to clipboard

chore: add snippetgen phase 2

Open quartzmo opened this issue 1 year ago • 1 comments

quartzmo avatar Sep 16 '22 15:09 quartzmo

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

snippet-bot[bot] avatar Sep 16 '22 15:09 snippet-bot[bot]

@amanda-tarafa @codyoss @tbpg

I replaced internal/generated/snippets/speech/apiv1/AdaptationClient/create_custom_class.go with speech/apiv1/adaptation_client_create_custom_class_example_test.go as the target output for the generator.

The goal is to support godoc examples, Cloud Rad, and snippets with the same output file. (Or nearly the same file, the region tags that appear here should probably be added later to a copy of this content, as is done today with generator examples and Phase 1 snippets.)

See Testable Examples in Go - Larger examples for background on how this works. The conversion from sort/example_keys_test.go source to the published SortKeys example godoc provides a demonstration.

quartzmo avatar Oct 06 '22 22:10 quartzmo

@amanda-tarafa @codyoss @tbpg

I replaced internal/generated/snippets/speech/apiv1/AdaptationClient/create_custom_class.go with speech/apiv1/adaptation_client_create_custom_class_example_test.go as the target output for the generator.

The goal is to support godoc examples, Cloud Rad, and snippets with the same output file. (Or nearly the same file, the region tags that appear here should probably be added later to a copy of this content, as is done today with generator examples and Phase 1 snippets.)

See Testable Examples in Go - Larger examples for background on how this works. The conversion from sort/example_keys_test.go source to the published SortKeys example godoc provides a demonstration.

The only thing I would say about the file name is that it should probably include the config ID (Basic in this case) as we may have several different samples for the same RPC, but config ID is unique for a given Service/RPC pair.

amanda-tarafa avatar Oct 07 '22 08:10 amanda-tarafa

I'd separate the idea of the GoDoc example file and the generated snippet output file. They can be in separate spots and that's fine. The GoDoc ones show up in GoDoc and need a different format than snippetgen. Unless that's causing issues for some reason?

tbpg avatar Oct 11 '22 14:10 tbpg

Closing this as I think this will no longer be happening here.

codyoss avatar Feb 14 '23 16:02 codyoss